|
shop:checkout CMS action
Base action for the Checkout page.
The checkout process is split to several steps. A current step name is always available through the $checkout_step field.
The field can have the following values:
Supported form fields
Generated PHP variables
Built-in AJAX handlers
Supported form field details¶ checkout_step form fieldContext: Any checkout step Specifies a current checkout step. Required.
Depending on a value of this field, LemonStand validates corresponding form fields and switches the checkout
process to a next step, when a customer clicks the Next button.
¶ skip_to form fieldContext: Any checkout step Allows to switch the checkout process to a specific step.
¶ auto_skip_shipping form fieldContext: Any checkout step Allows to skip the Shipping Method step if the shopping cart contains only non-shippable items.
Please read Skipping the Shipping Method step for downloadable products or services article
to learn how to configure LemonStand to skip the shipping method checkout step.
¶ empty_cart form fieldContext: Any checkout step Allows to leave the cart content after the order is placed.
This allows your customers to return to previous checkout step even if they already placed the order. The default value is 0 (false).
¶ cart_name form fieldContext: Any checkout step Optional field, the shopping cart name. Use it if you want to the checkout to work with a specific shopping cart.
Please refer to the shop:cart action documentation for the multiple shopping cart feature description.
¶ first_name form fieldContext: Billing and Shipping information steps Specifies the customer billing first name. Required.
¶ last_name form fieldContext: Billing and Shipping information steps Specifies the customer billing last name. Required.
¶ email form fieldContext: Billing and Shipping information steps Specifies the customer email address. Required.
¶ company form fieldContext: Billing and Shipping information steps Specifies the customer company name. Optional.
¶ phone form fieldContext: Billing and Shipping information steps Specifies the customer phone number. Optional.
¶ street_address form fieldContext: Billing and Shipping information steps Specifies the customer billing street address. Required.
¶ city form fieldContext: Billing and Shipping information steps Specifies the customer billing city. Required.
¶ zip form fieldContext: Billing and Shipping information steps Specifies the customer billing ZIP code. Required.
¶ country form fieldContext: Billing and Shipping information steps Specifies the customer billing country identifier. Required.
¶ state form fieldContext: Billing and Shipping information steps Specifies the customer billing state identifier. Required.
¶ is_business form fieldContext: Shipping information step Determines whether the shipping location is a business address. Optional.
Accepted values are 0, 1.
¶ register_customer form fieldContext: Billing information step Use this field if you want a customer to be automatically registered on checkout.
Accepted values are: 0, 1. If this field is not declared or its value is 0 (default), the following fields have no effect:
¶ allow_empty_password form fieldContext: Billing information step Determines whether customers should enter a password to register.
Accepted values are: 0, 1. If the field value is 0, the password is not registered. In this case LemonStand will generate a random password.
The default value is 0. You can set the field value to 1 and omit the customer password fields (customer_password, customer_password_confirm).
The field has no effect if the register_customer field value is 0 (default).
¶ customer_password form fieldContext: Billing and Shipping information steps Specifies the customer password.
This field is optional if the allow_empty_password field has value of 1.
The field has no effect if the register_customer field value is 0 (default).
¶ customer_password_confirm form fieldContext: Billing and Shipping information steps Specifies the customer password confirmation.
Use this field along with the customer_password field.
The field has no effect if the register_customer field value is 0 (default).
¶ no_password_error form fieldContext: Billing information step Specifies an error message to display in case if the customer did not specify the password.
Default value is "Please enter your password.".
The field has no effect if the register_customer field value is 0 (default).
¶ passwords_match_error form fieldContext: Billing information step Specifies an error message to display in case if the password and its confirmation do not match.
Default value is "Password and confirmation password do not match.".
The field has no effect if the register_customer field value is 0 (default).
¶ customer_exists_error form fieldContext: Billing information step Specifies an error to display in case if a customer with the specified email address already exists.
Default value is "A customer with the specified email is already registered. Please log in or use another email.".
The field has no effect if the register_customer field value is 0 (default).
¶ customer_auto_login form fieldContext: Review step Determines whether the new customer should be automatically logged in customer in after placing the order.
Accepted values are: 0, 1. The field has no effect if the register_customer field value is 0 (default).
¶ customer_registration_notification form fieldContext: Review step Determines whether a registration notification email message should be sent to the new customer.
LemonStand uses an email template with the shop:registration_confirmation code for the registration notification. Accepted values are: 0, 1.
The field has no effect if the register_customer field value is 0 (default).
¶ shipping_option form fieldContext: Shipping method step Specifies an identifier of selected shipping method.
¶ payment_method form fieldContext: Payment method step Specifies an identifier of selected payment method.
Generated PHP variable details¶ checkout_step variablestring $checkout_step;
Context: Any checkout step Specifies a current checkout step.
¶ billing_info variableShop_CheckoutAddressInfo $billing_info;
Context: Any checkout step An object of the Shop_CheckoutAddressInfo class containing the customer's billing name and address.
¶ shipping_info variableShop_CheckoutAddressInfo $shipping_info;
Context: Any checkout step An object of the Shop_CheckoutAddressInfo class containing the customer's shipping name and address.
¶ shipping_method variableobject $shipping_method;
Context: Any checkout step A PHP object representing a selected shipping method.
The object has the following fields:
¶ payment_method variableobject $payment_method;
Context: Any checkout step A PHP object representing a selected payment method.
The object has the following fields:
¶ coupon_code variablestring $coupon_code;
Context: Any checkout step Specifies a coupon code entered by a visitor.
¶ discount variablefloat $discount;
Context: Any checkout step Specifies an estimated cart discount.
You can display this value during the checkout process.
¶ applied_discount_rules variablearray $applied_discount_rules;
Context: Any checkout step Contains a list of discount rules applied to the cart products.
Each element in the array is an object with two fields:
<h3>Applied discounts</h3> <? foreach ($applied_discount_rules as $rule_info): ?> <p> <?= $rule_info->rule->name ?> <?= $rule_info->rule->description ?> - <?= format_currency($rule_info->discount) ?> </p> <? endforeach ?> ¶ cart_total variablefloat $cart_total;
Context: Any checkout step Specifies the cart total value (subtotal).
¶ estimated_total variablefloat $estimated_total;
Context: Any checkout step Specifies an estimated total value.
This value is calculated on each step of the checkout process, taking into account price rules and known information about the customer.
¶ estimated_tax variablefloat $estimated_tax;
Context: Any checkout step Specifies an estimated tax value.
This value is calculated on each step of the checkout process, taking into account price rules (defined on the
Shop/Discounts page page) and
known information about the customer. The tax value includes the goods tax and shipping tax.
¶ shipping_required variableboolean $shipping_required;
Context: Any checkout step Determines whether the shopping cart contains only non-shippable items.
This variable is FALSE if the shopping cart contains only non-shippable items (downloadable products or services). *
¶ countries variableDb_DataCollection $countries;
Context: Billing and Shipping information steps A collection of countries for populating the Country list.
Each element in the collection is an object of the Shop_Country class.
¶ states variableDb_DataCollection $states;
Context: Billing and Shipping information steps A collection of states for populating the State list.
Each element in the collection is an object of the Shop_CountryState class
¶ shipping_states variableDb_DataCollection $shipping_states;
Context: Billing information step A collection of states for populating the Shipping State list.
Each element in the collection is an object of the Shop_CountryState class
¶ shipping_options variablearray $shipping_options;
Context: Shipping method step A list of available shipping options.
Each element in the array is an object of the Shop_ShippingOption class.
¶ shipping_options_flat variablearray $shipping_options_flat;
Context: Shipping method step A flat list of shipping options.
In the flat list all options, including options returned by multi-option shipping methods, like FedEx, are presented in a single list.
Each element in the array is an object of the Shop_ShippingOption class.
¶ goods_tax variablefloat $goods_tax;
Context: Payment method step Specifies a value of a goods tax.
¶ subtotal variablefloat $subtotal;
Context: Payment method step Specifies the order subtotal amount.
¶ shipping_quote variablefloat $shipping_quote;
Context: Payment and Shipping method steps Specifies a shipping quote value.
¶ shipping_tax variablefloat $shipping_tax;
Context: Payment method step Specifies a shipping tax value.
¶ payment_methods variablearray $payment_methods;
Context: Payment method step A list of applicable payment methods.
Each element in the array is an object of the Shop_PaymentMethod class.
¶ goods_tax variablefloat $goods_tax;
Context: Review step Specifies an amount of the sales tax.
¶ subtotal variablefloat $subtotal;
Context: Review step Specifies the order subtotal amount.
¶ shipping_quote variablefloat $shipping_quote;
Context: Review step Specifies a shipping quote value.
¶ shipping_tax variablefloat $shipping_tax;
Context: Review step Specifies a shipping tax value.
¶ total variablefloat $total;
Context: Review step Specifies the order total amount.
¶ discount variablefloat $discount;
Context: Review step Specifies a total discount value.
¶ product_taxes variablearray $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:
<? foreach ($product_taxes as $tax): ?> <?= h($tax->name) ?>: <?= format_currency($tax->total) ?> <? endforeach ?> ¶ shipping_taxes variablearray $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:
¶ taxes variablearray $taxes;
Context: Review step A list of all taxes applied to products and shipping.
Taxes are combined by names. Each element in the array is an object containing the following fields:
Built-in AJAX handlers details¶ on_action AJAX handlerPosts a current step form data to the server, validates form data and switches the checkout process to a next step.
Use this hander for creating the Next button on the checkout page. Example:
<input type="image" src="/resources/images/btn_next.gif" alt="Next" onclick="return $(this).getForm().sendRequest('on_action', {update:{'checkout_page': 'checkout_partial'}})"/> ¶ shop:on_copyBillingInfo AJAX handlerCopies billing information (a customer name and address) to the shipping information checkout step.
Use this handler for creating a link Copy billing information on the shipping information step. Example:
<a href="#" onclick="return $(this).getForm().sendRequest( 'shop:on_copyBillingInfo', {update:{'checkout_page': 'checkout_partial'}})"> billing information</a> |