How to use shipping price with formula

  • Posts: 231
  • Thank you received: 28
  • Hikashop Business
2 days 5 hours ago #364465

-- HikaShop version -- : 5.1.1
-- Joomla version -- : 4.4.8
-- PHP version -- : 8.1.30

Hi guys, this is more like note for me :P

So if you want to have shipping price by weight you need to do this.
If you have a product with 344g, in database you have just a number 344, no mg, no g, so you will have to convert 344 to grams, if you use Kg, that's perfect for you.
To convert the number to grams, jsut do weight/1000.
In my mai case, the shipping is $59/kg, in my database the weight is saved as grams (for books).
So I have a book with the weight of 344g, and I want the client to pay the full price on kg, so I round up using ceil() function.
If the order has the weight of 1200g, the client it will pay for 2000g.

The formula I use is this: ceil({weight}/1000)*59

The following user(s) said Thank You: nicolas

Please Log in or Create an account to join the conversation.

Time to create page: 0.044 seconds
Powered by Kunena Forum