I would like my customers to be able to buy gift card products and the gift card they receive to include the variant name and the value.
For example…
Gift Card Product - Shoes
With Variants -
Child Shoes £10
Adult Shoes £20
Just now if a customer buys the child shoes version as a gift for someone, they receive a gift card that simply has the text £10. I would like it to say Child Shoes £10.
Is it possible to change the code somewhere to include the variant name?
I also use the Dawn theme and can’t figure out how to display Variant title on email template or giftcard template.
some people seems to manage it with :
Hi @GilRZ ,
Did you get any solution for this problem? It’s strange that when you use {{ gift_card.product }} it returns proper data but {{ gift_card.product.selected_variant }} returns blank or anything related to variant not returning any data.
Please let me know if you have found any solution, I want to display the image of the selected variant.
No, I did not find a suitable answer and ended up going a totally different route using stamped digital downloads as in store vouchers. I did for a time, use the shopify voucher system and changed the voucher email to include variants .
So this is actually a known limitation in Shopify. The gift_card.product.selected_variant object doesn’t work in the gift card notification email - it just returns blank. Multiple people have confirmed this in the community forums.
There are two workarounds that actually work:
Option 1: Line item properties (best solution)
You need to pass the variant title as a line item property when the customer adds the gift card to cart. Then you can access it in the email via gift_card.properties.
On your gift card product page, add JavaScript that captures the variant title and passes it as a line item property:
Note: initial_value is in cents/pence, so £10 = 1000
The first option is more maintainable but requires theme code changes. The second is hacky but quick if you only have a few variants with unique prices.
The proper fix would be for Shopify to make gift_card.product.selected_variant actually work - might be worth submitting feedback to them.