1
votes

I have the following problem in virtuemart:
I have made a function to calculate shipping cost based on a five stage cost given by the shipping company. This works perfectly on the cart page, but on the order details and order history page it does not, as I cannot get the product weight in these pages.
I have looked into order_items.php where the order details references are kept, but there is no reference to the product weight, only to product id, quantity, category, etc.
Could anyone help me in how to get the product weight inside the order details page? I can do the rest in calculating the shipping rates and updating the final sales price, but I am stuck in getting this info.
Any help is welcomed :)

1

1 Answers

0
votes

Try this,

I think you missed something about order tables, hope you are using VM2.x

In this version once the order is processed its payment,shipment information gets saved on the #__orders table.

In additionally the payment method Id and Shipment method Id also gets saved. So you can identify the method used on the order.

The idea of calculating ordered products shipping cost later on admin side is not practical bcoz later the shipping cost may very.

So practically once the user placed an order that time you have to save these information on the above table. If you're using VM default Shipping plugins they will do this by default.

Hope its clear.