- Posts: 13
- Thank you received: 1
How do I change shipping cost based on a formula?
-- Joomla version -- : 3.9.10
-- PHP version -- : 7.4.13
-- Browser(s) name and version -- : Edge
Our shipping company will charge 7.99 for shipping 1 or 2 boxes, 14.98 for 3 to 4 ... etc.
Using the manual plugin, how do I do this? I've noticed a 'Formula' field, but all of the documentation doesn't seem to be up to date with the 4.4.0 release.
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
Firstly, can you give us more information about :
- how do you exactly want to configure your shippings throush some screenshots for example
- what do you exactly mean by "boxes", are they products and do they have a defined weight / dimensions ?
Thank you,
Kind regards,
Mohamed.
Please Log in or Create an account to join the conversation.
). Our courier charges by weight, so 1 or 2 boxes is 7.99, 3 or 4 is 14.98 etc.
Will there be some up to date documentation soon, as I'm guessing the 'Formula' field may do what I need, but I have found zero information about it?
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
If your courier charge a fixed price by weight, the solution will be to set the "Formula" filed to : {weight} * PRICE_PER_WEIGHT
You'll just have to replace PRICE_PER_WEIGHT by the price per weight.
Else, the best solution will probably be to directly use that plugin which will do the job :
www.hikashop.com/marketplace/product/136...ghts-by-obsidev.html
Kind regards,
Mohamed.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
This input is new with the HikaShop 4.4, and unfortunately we are a little late on documentation, let's try to detail this and give you some concrete case.
List of tags :
{price} = Shipping price
{volume} = Current volume of the order
{weight} = Current weight in the order
{quantity} = Current quantity of product in the cart
From this you can create this kind of :
Example :
{weight}*10-{quantity}
Which means for a weight of 5 kg and 3 products which leads to this operation :
5 * 10 - 3 => 47 €
OR
Let's say that you have set in your shipping method a price of 2 € per Kg
Example :
{price}*{weight}
2 * 5 => 10 €
Hope this will help you to achieved what you need.
Regards
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
ceil({weight}/25) * 7.5
Is this possible?
Please Log in or Create an account to join the conversation.
I checked the code of the library we're using for that and it doesn't seem to support ceil.
However, I think you could add that easily.
In the file administrator/components/com_hikashop/inc/expression.php you have this list of supported PHP functions:
And while you can't cast numbers into integers, you can use the intval() function for that so you could also add in that same array of allowed functions.
Modulo is supported since you can use the % operator.
Let us know how it goes so that we could add these extra functions to the list so that you won't have issues updating in the future.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Thanks for your feedback. We'll add that to the next version.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Yes. And not just ceil. We've added all these functions to it:
'ceil', 'intval', 'floor', 'round', 'exp'
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.