Last active
October 11, 2017 14:43
-
-
Save boldsupport/b8c974d5d115ea7d5cd6c453d8666c7f to your computer and use it in GitHub Desktop.
Loyalty Points liquid file linked from: https://support.boldcommerce.com/hc/en-us/articles/209762003-Loyalty-Points-Install-Instructions
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 shop.metafields.bold_loyalties.active == 1 %} | |
<style> | |
@import url('//loy.boldapps.net/app_assets/css/client/product.css'); | |
</style> | |
{% if customer %} | |
{% include 'bold-loyalties-modal' %} | |
{% endif %} | |
<script> | |
var BoldApps = BoldApps||{}; | |
BoldApps.Loyalties =BoldApps.Loyalties ||{}; | |
BoldApps.Loyalties.ProductDisplaySettings={ | |
title:{ | |
show:true | |
}, | |
body:{ | |
'text' : '{{ shop.metafields.bold_loyalties.product_earn_callout_text}}' | |
}, | |
redeem:{ | |
'buttonText' : '{{ shop.metafields.bold_loyalties.product_redeem_button_text}}' | |
} | |
}; | |
BoldApps.Loyalties.shop = { | |
domain:'{{ shop.domain}}', | |
permanent_domain: '{{shop.permanent_domain}}', | |
url:'{{shop.url}}', | |
metafields: {{ shop.metafields.bold_loyalties | json }} | |
}; | |
BoldApps.Loyalties.product = {{ product | json }} | |
{% if product.metafields.bold_loyalties.has_special_rewards %} | |
BoldApps.Loyalties.product_has_special_rewards = ({{ product.metafields.bold_loyalties.has_special_rewards}} == 1)? true:false; | |
{% endif %} | |
BoldApps.Loyalties.product.metafields = {{ product.metafields.bold_loyalties | json }} | |
BoldApps.Loyalties.customer = null; | |
{% if shop.customer_accounts_enabled %} | |
{% if customer %} | |
BoldApps.Loyalties.customer ={ | |
email:'{{ customer.email}}', | |
id:{{ customer.id}}, | |
uuid: '{{ customer.metafields.bold_loyalties.uuid }}' | |
} ; | |
BoldApps.Loyalties.customer.metafields = {{ customer.metafields.bold_loyalties | json }} | |
{% endif %} | |
{% endif %} | |
</script> | |
<script src="//loy.boldapps.net/front_end/product_js"></script> | |
{% endif %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment