Zid Docs
AppsThemes
Payments
AppsThemes
Payments
Help Center
Slack
  1. Features
  • Getting Started
    • Introduction
    • Theme Development
    • Vitrin Changelog
    • Creating and Managing Theme Presets
    • Legacy Theme Migration
      • Store Settings Mapping
      • Moving to Vitrin Using LLMs
      • Twig to Jinja
      • Breaking Changes
  • Key Concepts
    • Architecture
    • Templates
      • Overview
      • Overridable Templates
      • Legacy Templates
      • Template Replacements
      • Templates Library
        • home.jinja
        • product.jinja
        • cart.jinja
        • category.jinja
        • products.jinja
        • categories.jinja
        • page.jinja
        • blogs.jinja
        • blog.jinja
        • faqs.jinja
        • reviews.jinja
        • questions.jinja
        • shipping_payment.jinja
        • 404_not_found.jinja
    • Settings
      • Schema files
      • Input Settings
      • Media Settings
      • Form Controls Settings
      • Products Settings
      • Additional Settings
      • Conditional Visibility
      • Migrating twig settings schema
    • Localization
      • localization (jinja v. twig)
    • Theme Editor
      • Overview
  • Building with Vitrin
    • Jinja Basics
    • Vitrin's Jinja Extensions
  • Vitrin CLI
    • Introduction
    • CLI Commands
  • Tips & Tricks
    • Performance
  • JS Integration
    • Supporting both Vitrin and Legacy themes
    • Responses & Errors
    • Cart
    • Products
    • Categories
    • Store
    • Account
    • Blogs
    • Options
    • Events
  • Features
    • SDK Popups – Integration Guidelines
    • Custom Styles Guide
    • Gift Card as a Popup
    • Addresses as a Popup
    • Login as a Popup
    • Checkout as a Popup
    • Apple Pay Quick Checkout
    • Region & Language Popup
    • Dynamic Bundle Products
    • Progressive Discounts
    • Customer Wallet & Cashback
    • Add Preorder Support to Your Theme
  • Mobile Apps
    • Scripts
  • API's
    • Authentication
      • Logout
      • Login Status
      • SMS Login
      • Verify SMS Login
      • WhatsApp Login
      • Verify WhatsApp Login
      • Email Login
      • Verify Email Login
      • Register
      • Register Guest
    • Products
      • List Products
      • Search Products
      • Calculate Product Options Price
      • Notify Product Stock Availability
      • Fetch Bundle Offers
      • Fetch Bundle Offers for a Product
      • List My Product Reviews
      • List Product Reviews
      • Create Product Review
      • Update Product Review
      • Delete Product Review
      • List Product Questions
      • Create Product Question
      • Get Product by Slug
      • Get Selection Groups
    • Categories
      • List Categories
    • Checkout
      • Get Cart
      • Remove Cart
      • Duplicate Cart
      • Add Cart Item
      • Empty Cart
      • Update Cart Item
      • Remove Cart Item
      • Upload Cart Input Field
      • Add Gift Card
      • Remove Gift Card
      • Apply Coupon
      • Remove Coupon From Cart
      • Check Coupon Validity
      • Apply Loyalty Points
      • Remove Loyalty Points
      • Preview Rewarded Points
      • List Redemption Methods for Cart
      • Customer’s Loyalty Wallet
      • Customer’s Current Points Balance
    • Account
      • Get Profile
      • Delete Account
      • Update Customer Profile
      • Get Addresses
      • Create an Address
      • Get an Address by ID
      • Update an Existing Address
      • Delete Address
      • Get Orders
      • Get Shareable Wishlist Link
      • Get Wishlist
      • Add Products to Wishlist
      • Remove Product from Wishlist
      • Get Address Form Schema
      • Check Product Purchase Status
    • Storefront
      • Store Scripts
      • Pages
      • Blogs
    • Countries
      • Get Countries
      • Get Cities By Country
  1. Features

Apple Pay Quick Checkout

The Apple Pay Quick Checkout feature allows customers to complete their purchase quickly using Apple Pay.
The behavior of the button depends on where you include the template:
1.
Product Details Page → Apple Pay sells a single product (does NOT affect the regular cart).
2.
Any Other Page (e.g., Cart Page) → Apple Pay sells the entire existing cart.

Modes & Page Placement#

1. Product Page – Buy a Single Product#

When you include the template inside the product details page, Apple Pay will:
Sell only the selected product.
Not modify the store’s regular cart (no add/remove).
This is ideal for “Buy Now” style flows from the product page.
If you are using:
The default quantity input (with the standard id),
The default custom fields templates,
then no extra work is required from your side.
If you are using a fully custom UI, see the sections below for how to keep selected_quantity and custom_fields_payload updated.

2. Cart Page / Other Pages – Buy the Entire Cart#

When you include the same template inside any other page (for example, the cart page) the button will:
Sell the entire existing cart.
Require that the cart already contains products.
In this mode, Apple Pay represents a “Pay for current cart” action.

Important Requirement (Cart Mode)#

Before showing the Apple Pay button in cart mode, you must ensure there are products in the cart.
If the cart is empty, you should hide the Apple Pay button.
You can use your existing cart logic or Zid APIs to:
Check cart line items count
Decide whether to render the button or not

3. Single Instance per Page#

You must not include the Apple Pay Quick Checkout template more than once on the same page.
If the template is included twice:
The system will log a warning.
Only the first instance of the template will be rendered and used.
Additional instances will be ignored.
Best Practice:
Ensure that each page includes the Apple Pay template once only – either:
Once on the product page (single product mode), or
Once on the cart / other page (cart mode).

Integration#

Include the Apple Pay Quick Checkout template in your page:
{% include 'vitrin:checkout/apple-pay-quick-checkout.jinja' %}
How it works based on placement:
Inside Product Details Page
Mode: Buy a Single Product
Uses window.productObj.selected_product
Does not affect the regular cart
Inside Cart Page or Any Other Page
Mode: Sell Existing Cart
Uses the current cart content
Requires cart to have items before showing the button

Global Product Object (Product Page Mode)#

If your theme is using:
1.
The default quantity input, which:
Has the expected id (e.g., product-quantity)
Uses the standard input/select behavior
2.
The default Vitrin custom fields templates
…then everything works automatically without any additional code.
However, if your theme uses a fully custom UI for quantity or custom fields, you only need to keep two values updated inside:
The required fields are:
selected_quantity
custom_fields_payload
window.productObj.selected_product is always defined on the product details page.
your responsibility is simply to keep these two values updated whenever the user changes them.

Testing#

1.
Product Page Mode (Single Product)
Open the product page in Safari (macOS / iOS).
In the browser console, inspect the selected product:
Change:
Quantity
Custom fields
Confirm that:
selected_quantity reflects the latest quantity.
custom_fields_payload contains the expected values.
Click the Apple Pay button and complete a test transaction:
The correct product and quantity are used.
Custom fields and bundle items are sent as expected.
The regular cart is not changed.
2.
Cart Mode (Entire Cart)
Open the cart page (or any other page where you include the template).
Make sure the cart has products.
Ensure your logic hides the button when the cart is empty.
Click the Apple Pay button and confirm:
The entire cart is sold.
Behavior matches your expected cart flow.

Summary#

Placement determines behavior:
Product Page → Apple Pay sells a single product (does not affect the cart).
Cart / Other Page → Apple Pay sells the entire existing cart.
In product page mode:
Default templates: no extra work for quantity/custom fields.
Custom themes must:
Update selected_quantity on quantity change.
Update custom_fields_payload on custom field change (same as Add to Cart).
In cart mode:
Button requires a non-empty cart.
Theme should hide or disable the button when the cart is empty.
Template must be included only once per page:
Multiple inclusions trigger a warning.
Only the first instance will be rendered.
Apple Pay reads values at click time, always ensure selected_product (product page) and cart (cart mode) are up to date.
Modified at 2026-02-17 07:02:10
Previous
Checkout as a Popup
Next
Region & Language Popup
Built with