-- HikaShop version -- : 5.1.1
-- Joomla version -- : 4.4.8
-- PHP version -- : 8.1.30
Hi guys, this is more like note for me
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