Immediately after upgrading a VM store from OPC v2.0.244 to v2.0.273 orders are sporadically coming in without shipping being applied (and in one case an international order having domestic shipping method applied). The store is in the US and all of these cases are international orders. We have tried everything to recreate the issue using same cart details and are not able to find a problem.
Digging into the http logs it seems at least several of the orders are from iPad devices using Safari browser so my theory is something is preventing the shipping from being updated on cart address changes/etc and an invalid shipping option is submitted back to the web server by the customer. To test this scenario we modified the selected shipping method on the web browser to a method number that is invalid based on cart details. When the order is submitted it is processed (gets past the COM_VIRTUEMART_CART_NO_SHIPPINGRATE check in cart_override.php->checkoutData) but the shipping is later set to shipment_id = 0.
I then reinstalled OPC v2.0.244 and did the same test but the order is properly stopped and redirected back to the cart with the COM_VIRTUEMART_CART_NO_SHIPPINGRATE message.
I then did some tracking of the code and found the potential problem. The update I made to fix the problem was to comment out @line 588 in components\com_onepage\helpers\loader.php:
- Code: Select all
//$cart->virtuemart_shipmentmethod_id = $saved_id;
This line is resetting the shipment method id back to the $saved_id. I believe VM is checking if the shipment method is valid for the order in getCheckoutPrices and if it is not the shipping is set to 0. However this gets reset by this line which then does not trigger the COM_VIRTUEMART_CART_NO_SHIPPINGRATE check in cart_override.php->checkoutData
Stan, can you please look at this to see if this issue can be fixed in a future release or let me know if I am off-base with this analysis.
Chuck