Skip to content

Instantly share code, notes, and snippets.

@boldsupport
Last active October 11, 2017 14:45
Show Gist options
  • Save boldsupport/2b3b3b0d3e1ba83f47b98f099c5508e1 to your computer and use it in GitHub Desktop.
Save boldsupport/2b3b3b0d3e1ba83f47b98f099c5508e1 to your computer and use it in GitHub Desktop.
{% if shop.metafields.bold_loyalties.active == 1 and shop.metafields.bold_loyalties.callout_type == 'full_width'%}
<div class="bold-loyalties-callout">
{% if customer %}
{% else %}
{{ shop.metafields.bold_loyalties.callout_loggedout_text }}
{% endif %}
<a class="bold-loyalties-close" href="#"> Close</a>
</div>
{% endif %}
{% if shop.metafields.bold_loyalties.active == 1 and shop.metafields.bold_loyalties.callout_type == 'tab'%}
<div class="bold-loyalties-callout-tab">
{% if customer %}
<a href="/account">{{ shop.metafields.bold_loyalties.name }}</a>
{% else %}
{% if shop.metafields.bold_loyalties.details_url %}
<a href="{{shop.metafields.bold_loyalties.details_url}}">{{shop.metafields.bold_loyalties.name}}</a>
{% else %}
{{ shop.metafields.bold_loyalties.name | customer_register_link }}
{% endif %}
{% endif %}
</div>
{% endif %}
{% if shop.metafields.bold_loyalties.active == 1 %}
<style>
@import url('//shappify-cdn.com/loyalties/{{shop.domain}}-callout.css');
</style>
<script>
var BoldApps = BoldApps || {};
BoldApps.Loyalties = BoldApps.Loyalties || {};
BoldApps.Loyalties.CalloutSettings = {
fade_out_after: '{{ shop.metafields.bold_loyalties.callout_fade_out_after }}'
};
{% 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 %}
BoldApps.Loyalties.shop = {
domain:'{{shop.domain}}',
permanent_domain: '{{shop.permanent_domain}}',
url:'{{shop.url}}',
metafields: {{ shop.metafields.bold_loyalties | json }}
};
</script>
<script src="//loy.boldapps.net/front_end/callout_js"></script>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment