In this article, you can learn about the MyCashflow single-page checkout's work logic.
The single-page checkout is one out of three checkout types available in MyCashflow, in which all checkout forms are displayed on one page. Individual checkout sections are updated with AJAX requests.
Different parts of the checkout are printed by using separate tags. They are:
{CheckoutBillingAddress}
{CheckoutShippingAddress}
{CheckoutShippingMethods}
{CheckoutPaymentMethods}
{CheckoutAcceptTerms}
With a one-page checkout, forms are submitted using asynchronous AJAX requests, so the checkout does not need additional page loads when entering information into the forms.
The
attribute is added to all checkout form tags so that the tags return only their own value and potential error notifications.ajax:
true
Depending on the customer's location, the contents of each checkout part are sent as a POST
request either to the /cart or /checkout address. The filled-in form is returned together with the modifications and if the form contains an error, the relevant error notifications are added to the return value.
Once the information entered to a checkout form has been sent to the server and the response has been received, the other checkout forms should be updated with the GET
request. For instance, if changes are made to the delivery address, you may want to update the shipping methods too as they often depend on the country of delivery.
See also the instructions for updating single-page checkout parts.