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

Gift Card as a Popup

The Gift Card feature allows customers to add personalized gift details such as sender name, receiver name, message, and optional media links.
To enable this feature, you need to include the provided dialog template and implement a button to open it.

 Integration Requirements#

1. Check Feature Availability#

Before including or using the gift card feature, ensure it is enabled in the store settings.
If the flag is disabled, the feature will not work even if the template is included.
{% if safeget(store, "settings.checkout.gift_order_settings.is_gift_order_enabled", False) == '1' %}
  {% include 'vitrin:cart/gift-card.jinja' %}
{% endif %}
This flag can be managed by the merchant in the store’s Dashboard → Settings → Gifting section.
URL pattern:
https://dashboard.zid.sa/en-sa/stores/<store_id>/settings/gifting

2. Include Gift Card Template#

If the feature is enabled, include the following template in your cart page:
{% include 'vitrin:cart/gift-card.jinja' %}
This template is responsible for rendering the gift dialog. No additional implementation inside the template is required.

3. Add Toggle Button#

Add a button anywhere in the cart page to allow users to open the gift card dialog.
Example:
You can also close the dialog manually if needed using:
The dialog automatically closes after successful submission.

4. Listen for Gift Submission Event#

When the gift card form is successfully submitted, a custom event is triggered:
event.detail.data returns the updated cart object.
No need to refetch the cart — simply update your DOM with the new cart data.

5. Display Gift Card Details in Cart#

You can use the gift_card_details object from the cart data to display the current gift information:
Use this data to show a summary card or banner inside your cart if desired.

Custom Styles Integration#

You can customize the look and feel of the Gift Dialog using the Zid SDK Custom Styles system. This allows you to apply your own CSS overrides for specific components without affecting other areas of the store.

How to Use Custom Styles#

You can define your custom styles globally using the window.zidCustomStyles object. The SDK will automatically apply these styles to the corresponding components, ensuring proper scoping and isolation.

Example#


In the example above, the component key for the gift dialog is clearly shown as:
gift_dialog
You can use this key in your window.zidCustomStyles object to apply any style overrides specific to the gift feature.

To understand the complete flow of the Custom Styles system — including structure, validation, and advanced usage — please refer to the Custom Styles Guide for Theme Developers.


Summary#

ActionDescription
Check flagsafeget(store, "settings.checkout.gift_order_settings.is_gift_order_enabled", False) must return '1'
Include template{% include 'vitrin:cart/gift-card.jinja' %} in cart page
Open dialogwindow.gift_dialog.open()
Close dialogwindow.gift_dialog.close() (optional)
Listen for eventvitrin:gift:submitted → returns updated cart
Gift detailsAvailable in cart.gift_card_details

Notes#

Ensure the flag safeget(store, "settings.checkout.gift_order_settings.is_gift_order_enabled", False) returns '1' before including the template.
Merchants can enable or disable the feature from the Dashboard → Settings → Gifting section.
URL pattern: https://dashboard.zid.sa/en-sa/stores/<store_id>/settings/gifting
Include vitrin:cart/gift-card.jinja in your theme’s cart page to enable the feature.
Use window.gift_dialog.open() and window.gift_dialog.close() to control the dialog.
The dialog automatically closes on successful submission.
Listen to the vitrin:gift:submitted event to update your cart dynamically without refetching.
Use cart.gift_card_details to display existing gift details in the cart.
Modified at 2026-02-17 07:02:10
Previous
Custom Styles Guide
Next
Addresses as a Popup
Built with