gift_card.liquid
The gift_card.liquid
template renders the gift card page, which displays the gift card issued to a customer upon purchase.
Unlike other pages in your store, gift card pages are hosted on the checkout.shopify.com
domain. Gift card URLs contain unique identifiers for your store and gift card:
The following image is an example of how Dawn's gift_card.liquid
template renders the gift card page.
The gift_card
template is located in the templates
directory of the theme:
This template can't be a JSON template.
You can include the following in your gift_card template or a section inside of the template:
You can also include a QR code or Apple wallet passes.
The gift_card object
Anchor link to section titled "The gift_card object"You can access the Liquid gift_card
object to display the gift card details.
When working with the gift_card
template, you should familiarize yourself with the following:
- Adding a QR code link
- Including Apple Wallet passes to the template
- Displaying only the gift card details
To learn how to personalize gift card templates with a custom image, refer to the Shopify Help Center.
You can include a QR code link by adding JavaScript that generates a QR code. Add the following snippets in the <head>
and <body>
elements of the page, respectively.
To control the content of the QR code, update the text
property with the desired content.
In this example, the QR code links to the store's URL.
Apple Wallet passes
Anchor link to section titled "Apple Wallet passes"You can include Apple Wallet passes by adding the following snippet to the <body>
element of the page:
Display only the gift card details
Anchor link to section titled "Display only the gift card details"If you don’t want to include theme elements, like the header and footer, you can choose to render the gift_card.liquid
template with no layout or with a custom layout, using the Liquid layout
object.
For example:
Preview the template
Anchor link to section titled "Preview the template"You can preview the gift card's appearance by navigating to the gift card template from the theme editor.
- From the theme editor, open the drop-down menu at the top of the page.
- Under Templates, click Others. Then click Gift card.