Express checkout buttons

To streamline the checkout process, merchants can enable third-party payment services with off-site checkout functionality, such as Apple Pay or Google Pay, via the SHOPLINE Admin. Once enabled, the express checkout functionality can be implemented in the store via the following objects:

  • additional_checkout_buttons: Returns true if any payment service with off-site checkout functionality is enabled for the store; otherwise, returns false.
  • content_for_additional_checkout_buttons: Returns the checkout button HTML for any active payment service with off-site checkout functionality. The HTML will be used to render the off-site checkout button.

Adding express checkout buttons in the theme

You can add the button code in any place of your theme code. The example button code is as follows:

{{#if additional_checkout_buttons}}	// Checks whether any third-party payment service is available.
{{{content_for_additional_checkout_buttons}}} // Displays the checkout button HTML for an active payment service.
{{/if}}

Express checkout buttons cannot be rendered via Ajax requests (including Section rendering API requests), because the initialization logic for these buttons relies on the JavaScript scripts injected via the layout file and these scripts are designed to execute only during the initial page render.

Was this article helpful to you?