LemonStand Documentation

Step-by-step checkout actions

The actions described in this section are designed for implementing the step-by-step checkout process. Please refer to the Implementing the Step-By-Step Checkout article for examples of the actions described in the section. Note that there is another action - shop:checkout, which incorporates all steps of the checkout process and allows you to build the AJAX-driven checkout page, where all steps of the checkout process are displayed one by one on a single page. That sort of checkout process is implemented in our Demo Store. As contrasted with the shop:checkout action, the step-by-step checkout actions allows you to build a checkout process with separate pages. Also, using these actions you can customize the checkout process. For example, it is possible to skip some checkout steps and implement simplified checkout scenarios. Please refer to the Creating the One-Step Checkout article for the example of customizing the checkout process.

The conventional checkout process consists of the following steps:

  1. Billing address information form (the shop:checkout_billing_info action)
  2. Shipping address information form (the shop:checkout_shipping_info aciton)
  3. Shipping method selection form (the shop:checkout_shipping_method action)
  4. Payment method selection form (the shop:checkout_payment_method action)
  5. Order Review page (the shop:checkout_order_review action)

Watching the cart content changes

It is possible that a customer may change the content of the shopping cart during the checkout process. It can be done in a separate browser window. It is recommended to check whether the shopping content has not been changed after the checkout process started. LemonStand automatically saves the cart content identifier to the memory on the Billing address information step (the first step in the checkout process). You can place the following code in the Pre Action Code field of the Action tab of all your checkout pages, excluding the billing address information step.

if (Shop_CheckoutData::get_cart_id() != Shop_Cart::get_content_id())
	Phpr::$response->redirect('/checkout_billing_information');

The code compares the saved cart content identifier with a current identifier, and if they do not match, redirects the browser to the first step of the checkout process. Please use an actual value for the URL of the first checkout step of your online store.

Next: shop:checkout_billing_info
Previous: shop:payment_profile
Return to Reference