Skip to content

Commit

Permalink
Update from Shopify for theme shopify-tailwind-starter-base/trade
Browse files Browse the repository at this point in the history
Committed from shop: christy-unite
  • Loading branch information
shopify[bot] authored Oct 16, 2024
1 parent fa37b37 commit bd32d35
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
6 changes: 4 additions & 2 deletions layout/theme.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,8 @@
document.documentElement.classList.add('shopify-design-mode');
}
</script>
</head>
{% include 'store-credit-launcher' %}

Check warning on line 301 in layout/theme.liquid

View workflow job for this annotation

GitHub Actions / Theme Check Report

layout/theme.liquid#L301

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

<body class='gradient{% if settings.animations_hover_elements != 'none' %} animate--hover-{{ settings.animations_hover_elements }}{% endif %}'>
<a class='skip-to-content-link button visually-hidden' href='#MainContent'>
Expand Down Expand Up @@ -378,5 +379,6 @@
{%- if settings.cart_type == 'drawer' -%}
<script src='{{ 'cart-drawer.js' | asset_url }}' defer='defer'></script>
{%- endif -%}
</body>
{% include 'store-credit-launcher' %}

Check warning on line 382 in layout/theme.liquid

View workflow job for this annotation

GitHub Actions / Theme Check Report

layout/theme.liquid#L382

[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 bd32d35

Please sign in to comment.