This is the API docs for LemonStand V1, which has been discontinued. LemonStand is now a cloud based platform, available at lemonstand.com.

LemonStand API

shop:checkout_order_review CMS action

Defined in /modules/shop/classes/shop_actions.php, lines 2170-2195
Author LemonStand eCommerce Inc.
Base action for the Order Review checkout page. This action is a part of the step-by-step checkout process. The Order Review page is the last step of the conventional step-by-step checkout process.
Note that there is another action - shop:checkout, which incorporates all steps of the checkout process and allows 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.

Watching the cart content changes

It is possible that a customer can 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.

Supported form fields

Field Type Description
customer_auto_login boolean determines whether the customer should be automatically logged in after placing the order.
customer_registration_notification boolean determines whether the registration notification email message should be sent to the customer.
empty_cart boolean allows to leave the cart content after the order is placed.
submit string a name of the SUBMIT input element.
no_redirect boolean cancels the automatic browser redirection.
cart_name string specifies the shopping cart name.

Generated PHP variables

Variable Type Context Description
goods_tax float specifies the sales tax amount.
discount float specifies the discount amount.
subtotal float specifies the order subtotal amount.
shipping_quote float specifies a shipping quote.
shipping_tax float specifies a shipping tax value.
total float specifies the total order amount.
product_taxes array Review step a list of sales taxes applied to all order items.
shipping_taxes array Review step a list of taxes applied to the shipping service.
billing_info Shop_CheckoutAddressInfo an object of the Shop_CheckoutAddressInfo class containing the customer's billing name and address.
shipping_info Shop_CheckoutAddressInfo an object of the Shop_CheckoutAddressInfo class containing the customer's shipping name and address.
shipping_method object a PHP object representing a selected shipping method.
payment_method object a PHP object representing a selected payment method.

Built-in AJAX handlers

Handler Description
shop:on_checkoutPlaceOrder Processes the form in AJAX mode.

Supported form field details

customer_auto_login form field

Determines whether the customer should be automatically logged in after placing the order. Accepted values are: 0, 1. See also the Automatic customer registration article.

customer_registration_notification form field

Determines whether the registration notification email message should be sent to the customer. LemonStand uses an email template with the shop:registration_confirmation code for the registration notification. Accepted values are: 0, 1.

empty_cart form field

Allows to leave the cart content after the order is placed. This feature allows your customers to return to previous checkout step even if they already placed the order. Accepted values are: 0, 1. The default value is 0 (false).

submit form field

A name of the SUBMIT input element. The submit button should have name submit if you are implementing a regular POST form. Alternatively you can create an AJAX form with shop:on_checkoutPlaceOrder handler.

no_redirect form field

Cancels the automatic browser redirection. By default the browser is automatically redirected to the payment page after the order is placed. Accepted values are: 0, 1.

cart_name form field

Specifies the shopping cart name. LemonStand support multiple shopping cart. By default the cart named main used.

Generated PHP variable details

goods_tax variable

float $goods_tax;
Specifies the sales tax amount.

discount variable

float $discount;
Specifies the discount amount.

subtotal variable

float $subtotal;
Specifies the order subtotal amount.

shipping_quote variable

float $shipping_quote;
Specifies a shipping quote.

shipping_tax variable

float $shipping_tax;
Specifies a shipping tax value.

total variable

float $total;
Specifies the total order amount.

product_taxes variable

array $product_taxes;

Context: Review step

A list of sales taxes applied to all order items. Each element in the array is an object containing the following fields:
  • name - the tax name, for example GST.
  • total - total tax amount.
You can output tax names and values with the following code:
<? foreach ($product_taxes as $tax): ?>
  <?= h($tax->name) ?>: <?= format_currency($tax->total) ?>
<? endforeach ?>

shipping_taxes variable

array $shipping_taxes;

Context: Review step

A list of taxes applied to the shipping service. Each element in the collection is an object containing the following fields:
  • name - the tax name, for example GST.
  • total - total tax amount.

billing_info variable

An object of the Shop_CheckoutAddressInfo class containing the customer's billing name and address.

shipping_info variable

Shop_CheckoutAddressInfo $shipping_info;
An object of the Shop_CheckoutAddressInfo class containing the customer's shipping name and address.

shipping_method variable

object $shipping_method;
A PHP object representing a selected shipping method. The object has the following fields:
  • id - an identifier of the shipping method in LemonStand database.
  • quote - specifies the shipping quote.
  • name - specifies the shipping method name.

payment_method variable

object $payment_method;
A PHP object representing a selected payment method. The object has the following fields:
  • id - an identifier of the payment method in LemonStand database.
  • name - specifies the payment method name.

Built-in AJAX handlers details

shop:on_checkoutPlaceOrder AJAX handler

Processes the form in AJAX mode. The handler creates an order basing on the checkout information gathered during the preceding checkout steps and redirects the browser to the payment page. Use this handler for creating a button, or link, for placing the order. Example:
<input
  type="image"
  src="/resources/images/btn_place_order.gif"
  alt="Place Order and Pay"
  onclick="return $(this).getForm().sendRequest('shop:on_checkoutPlaceOrder')"/>