Skip to content

Commit

Permalink
Update from Shopify for theme shopify-tailwind-starter-base/feature/i…
Browse files Browse the repository at this point in the history
…talist

Committed from shop: christy-unite
  • Loading branch information
shopify[bot] authored Oct 16, 2024
1 parent 20e1205 commit 92426ab
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
4 changes: 3 additions & 1 deletion layout/theme.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@
</script>

{% render 'shogun-head' %}
{% include 'store-credit-launcher' %}

Check warning on line 288 in layout/theme.liquid

View workflow job for this annotation

GitHub Actions / Theme Check Report

layout/theme.liquid#L288

[ConvertIncludeToRender] `include` is deprecated - convert it to `render`
</head>

<body
Expand Down Expand Up @@ -358,5 +359,6 @@
{%- if settings.predictive_search_enabled -%}
<script src='{{ 'predictive-search.js' | asset_url }}' defer='defer'></script>
{%- endif -%}
</body>
{% include 'store-credit-launcher' %}

Check warning on line 362 in layout/theme.liquid

View workflow job for this annotation

GitHub Actions / Theme Check Report

layout/theme.liquid#L362

[ConvertIncludeToRender] `include` is deprecated - convert it to `render`
</body>
</html>
29 changes: 29 additions & 0 deletions snippets/store-credit-launcher.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{% assign store_domain = shop.permanent_domain %}
<script>
window.StoreCreditInit = {
shop: '{{ store_domain }}',
cashback_widget_status: 0
}
</script>

{% if customer %}
{% assign storecredit_customer_id = customer.id %}
{% assign storecredit_customer_email = customer.email %}
{% assign storecredit_customer_signature = customer.id | append: 'a43cb766aee7b64891bcea9501f06e8f' | md5 %}

<script>
window.StoreCreditInit.customer_id = '{{ storecredit_customer_id }}';
window.StoreCreditInit.customer_name = '{{ customer.first_name }} {{ customer.last_name }}';
window.StoreCreditInit.customer_email = '{{ storecredit_customer_email }}';
window.StoreCreditInit.customer_signature = '{{ storecredit_customer_signature }}';
// B2B
window.StoreCreditInit.b2b_customer = '{{ customer.b2b? }}';
window.StoreCreditInit.customer_company_id = '{{ customer.current_company.id }}';
{% for location in customer.current_company.available_locations -%}
{% if location.current? %}
window.StoreCreditInit.company_location_id = '{{ location.id }}';
{% endif %}
{%- endfor %}
</script>
{% endif %}

0 comments on commit 92426ab

Please sign in to comment.