Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Front end hooks into the js trigger updated_checkout.
  2. When updated_checkout is triggered the plugin has pushed a variable through the filter woocommerce_update_order_review_fragments.
  3. 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.
  4. rbwc_cart_total is keeping track on when cart total becomes 0, and proceeding through resursPlaceOrderControl() in the front end.
  5. 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.
  6. 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.
  7. 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.

...