As of
Jira Legacy | ||||||
---|---|---|---|---|---|---|
|
Procedure
- Front end hooks into the js trigger updated_checkout.
- When updated_checkout is triggered the plugin has pushed a variable through the filter woocommerce_update_order_review_fragments.
- We should probably add an element rbwc_cart_total somewhere on the page, since we wrongfully using this fake element to store the cart total temporarily.
- rbwc_cart_total is keeping track on when cart total becomes 0, and proceeding through resursPlaceOrderControl() in the front end.
- WooCommerce is updating the "place order"-button automatically when the cart is processing the fragments, so if the cart total is 0, that button returns to the store again, together with the iframe.
- In resursPlaceOrderControl, when the order total is validated as 0, the customer billing/shipping fields will show up again, and the iframe will be temporarily be hidden.
- If the order total is revalidated again as above 0, the billing/shipping fields will hide again, and the iframe will be restored.
Backlashes
...
- When a cart is added with a discount which generates above scenario and customer data is not yet filled in, customer has to do this manually.
...