Get shipping costs for a product
-
I use the flat_rate method for my shipping costs.
It contains a default cost_per_order and I use 2 shipping_classes inside flat_rate for additional costs for some products.I want to show the shipping costs on the product page.
Right now I use the $product->shipping_class_id() to get the ID but I can’t figure out how to get the costs for this shipping_class_id.
Because if I konw the costs I can add this to the cost_per_order to calculate the total shipping costs for the product.I also can’t figure out how to get the cost_per_order value.
If there is no solution at all, I can use as an emergency solution a switch/case statement and put the costs in there but then I need to change the code when I change the flat_rate costs, so I don’t prefer this kind of solutions.
- The topic ‘Get shipping costs for a product’ is closed to new replies.