- Add properties for gift cards under product.liquid. Must be within the tags.
- Retrieve the properties in gift_cart.liquid
- Celebrate
Last active
August 29, 2015 14:13
-
-
Save kyledurand/3730b57fd6835a81c20c to your computer and use it in GitHub Desktop.
Multiple gift cards
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% comment %} | |
Added by Kyle @ Shopify | |
{% endcomment %} | |
{% for property in gift_card.properties %} | |
{% assign giftcardtype = property | last %} | |
{% endfor %} | |
{% comment %} | |
End code added by Kyle Now you can use if statements to show different images. | |
i.e. | |
{% if giftcardtype == 'Thank You Gift Card' %} | |
<img src="{{ 'Thank_You_gift_card.jpg' | asset_url }}" alt="Gift card illustration"> | |
{% endif %} | |
{% endcomment %} | |
{% if giftcardtype == 'Thank You Gift Card' %} | |
<img src="{{ 'Thank_You_gift_card.jpg' | asset_url }}" alt="Gift card illustration"> | |
{% elsif giftcardtype == 'Birthday Gift Card' %} | |
<img src="{{ 'happy_birthday_gift_card.jpg' | asset_url }}" alt="Gift card illustration"> | |
{% else %} | |
<img src="{{ 'gift-card/card.jpg' | shopify_asset_url }}" alt="Gift card illustration"> | |
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if product.title == 'Gift Card' %} | |
<input type="hidden" name="properties[giftcardtype]" value="Standard Gift Card" /> | |
{% elsif product.title == 'Thank You Gift Card' %} | |
<input type="hidden" name="properties[giftcardtype]" value="Thank You Gift Card" /> | |
{% elsif product.title == 'Birthday Gift Card' %} | |
<input type="hidden" name="properties[giftcardtype]" value="Birthday Gift Card" /> | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment