Active
Project:
Commerce Core
Version:
7.x-1.x-dev
Component:
Cart
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
7 Oct 2015 at 05:49 UTC
Updated:
8 Oct 2015 at 14:37 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
Evgeny_Yudkin commentedFixed
Comment #3
Evgeny_Yudkin commentedComment #5
Evgeny_Yudkin commentedComment #6
Evgeny_Yudkin commentedComment #8
Evgeny_Yudkin commentedComment #10
Evgeny_Yudkin commentedComment #11
rszrama commentedThis is actually an inappropriate fix, because the Order module / form isn't concerned with cart orders or refreshes. From the back office, the solution would really be to just set a status other than shopping cart - otherwise, the mere act of submitting the form doesn't refresh the prices but the subsequent load.
One thing we could do is move the setting of the variable in the order's data array into the refresh function itself (as opposed to the order load hook). This would ensure the variable gets set when the form used to trigger a manual order refresh is submitted.
Comment #12
IRuslan commentedI think the patch make sense, conditions if order in the cart are dynamic because of
foreach (module_implements('commerce_cart_order_is_cart') as $module) {in commerce_cart_order_is_cart(). So it could vary depending from the site configuration.
And in same time we need to ensure that last_refresh properly set up during creation.
Approach in the patch follows consistency with approach in commerce_cart_product_add() — set value at the moment when actually order saved with some products added.
Just as improvement probably also make sense to set up order's data variable in order presave phase, during creation — else, just created order always will fall inside commerce_cart_order_can_refresh() conditions.