|
shop:checkout_payment_method CMS action
Base action for the Payment Method checkout page.
This action is a part of the step-by-step checkout process.
The Payment Method page is the fourth 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 changesIt 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.1. if (Shop_CheckoutData::get_cart_id() != Shop_Cart::get_content_id()) 2. Phpr:: $response ->redirect( '/checkout_billing_information' ); See AlsoSupported form fields
Generated PHP variables
Built-in AJAX handlers
Supported form field details¶ payment_method form fieldAn identifier of selected payment method. Required.
You can use either radio button set or a SELECT element for representing a list of available payment methods.
¶ redirect form fieldSpecifies an ULR of a page to redirect the browser after processing the form data.
Use a hidden field for this value. If you are implementing a conventional checkout process, a value of
this field is an URL of the checkout Order Review page.
Note that if your copy of LemonStand is installed in a subdirectory, you need to use the root_url() function
in the redirect field value.
¶ submit form fieldA 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_checkoutSetPaymentMethod handler.
¶ cart_name form fieldSpecifies the shopping cart name.
LemonStand support multiple shopping cart. By default the cart named main used.
Generated PHP variable details¶ payment_methods variablearray $payment_methods;
A list of applicable payment methods.
Each element in the array is an object of the Shop_PaymentMethod class.
¶ payment_method variableobject $payment_method;
A PHP object representing a selected payment method.
The object has the following fields:
¶ goods_tax variablefloat $goods_tax;
Sales tax amount.
¶ discount variablefloat $discount;
Estimated cart discount.
You can display this value during the checkout process.
¶ cart_total variablefloat $cart_total;
Cart total amount (subtotal).
¶ estimated_total variablefloat $estimated_total;
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;
An estimated tax value.
The value includes the sales tax and shipping tax.
Built-in AJAX handlers details¶ shop:on_checkoutSetPaymentMethod AJAX handlerProcesses the form in AJAX mode.
Use this handler for creating a button, or link, for sending the form data to the server and redirecting the browser to
a next checkout step. Example:
1. <input 2. type= "image" 3. src= "/resources/images/btn_next.gif" 4. alt= "Next" 5. onclick= "return $(this).getForm().sendRequest('shop:on_checkoutSetPaymentMethod')" /> |