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
{% liquid | |
assign target_handle = block.settings.default_athlete | |
assign default_object = shop.metaobjects.tier_1_athletes[target_handle] | |
if cart.attributes._ATHLETES != blank | |
assign athlete_handles = cart.attributes._ATHLETES | split: ',' | |
for athlete_handle in athlete_handles | |
assign athlete_object = shop.metaobjects.tier_1_athletes[athlete_handle] | |
if athlete_object != blank |
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
<script type="application/json" data-for-you-initial-state> | |
{ "collections": "{{ cart.attributes['_VIEWED_COLLECTIONS'] }}", "athletes": "{{ cart.attributes['_ATHLETES'] }}", "products": "{{ cart.attributes['_VIEWED_PRODUCTS'] }}", "topics": "{{ cart.attributes['_TOPICS'] }}", "toAdd": { "topic": "{{ page_title | handleize | upcase }}" {% if page.metafields.custom.linked_athlete != blank %}, "athlete": "{{ page.metafields.custom.linked_athlete.value.system.handle }}" {% endif %} {% if product %}, "product": "{{ product.handle }}" {% if collection %},{% endif %} {% endif %} {% if collection %} "collection": "{{ collection.handle }}" {% endif %} } } | |
</script> |
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
class ForYouModule { | |
constructor() { | |
this.state = JSON.parse( | |
document.querySelector('[data-for-you-initial-state]').textContent | |
) | |
this.hasChanges = false | |
this.parseUrlParams() // Call this method to initialize the state from URL parameters | |
this.init() | |
} |
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 -%} | |
---------------------------------------------------------------------------------------------------------------------- | |
SPECULATION RULES SCRIPT COMPONENT | |
---------------------------------------------------------------------------------------------------------------------- | |
This snippet dynamically generates speculation rules scripts for Shopify themes, aiming to enhance loading performance by pre-rendering pages based on the type of page being viewed. It supports three primary contexts: 'page', 'product', and 'collection'. | |
******************************************** | |
Section Settings | |
******************************************** |
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
Query | |
============================================================== | |
query MultiRecommend { | |
productRecommendations1: productRecommendations( | |
productId: "gid://shopify/Product/8197009965299" | |
) { | |
id | |
handle | |
featuredImage { |
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
/* | |
Allows you to hijack the new Customer Accounts login flow and redirect to a custom page after login. | |
10SQ - 2024 | |
10sq.dev | |
*/ | |
const SHOP_ID = "<YOUR-SHOP-ID>"; | |
const CLIENT_ID = "<YOUR-CLIENT-ID>"; // Install https://apps.shopify.com/headless |