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
/* Customer orders are recieved as "authorized". The number of days left in their trial is passed as a line | |
item prop charge_delay. This cron job checks each hour for any orders that are still in authorized state. | |
If the (order date + charge_delay) is > current date, their trial has ended and we capture payment if | |
they are still have the "Active Subscriber" tag. | |
*/ | |
async function captureUnpaidOrders() { | |
console.log('Debug: Getting unpaid orders'); | |
/* Finds any orders where financial status is authorized. | |
Then checks if the created_at date + the charge_delay is less than the current date. |
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": "mutation publishablePublish($id: ID!, $input: [PublicationInput!]!) { publishablePublish(id: $id, input: $input) { publishable { availablePublicationCount publicationCount publishedOnCurrentPublication } shop { id } userErrors { field message } }}", | |
"variables": { | |
"id": "gid://shopify/Product/{{product.legacyResourceId}}", | |
"input": [{ "publicationId": "gid://shopify/Publication/25658064918" }] | |
} | |
} |
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
/* MTBD Product filtering solution * | |
This could all be done in liquid as well | |
Add a product-options id to the fieldset | |
*/ | |
var options = [[], [], [], []]; | |
var optionsFieldSet = document.getElementById("product-options"); | |
var fieldSetInputs = optionsFieldSet.getElementsByTagName("input"); |
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 %} Renders gift with purchase products that merchant selects {% endcomment %} | |
<style> | |
.gallery__item:hover { | |
cursor: pointer; | |
} | |
</style> | |
<script> | |
function addToCart(variant_id) { |
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
<title> | |
{{ page_title }}{% if current_tags %}{% assign current_tags_joined = current_tags | join: ', ' %} – {{ 'general.meta.tags' | t: tags: current_tags_joined }}{% endif %}{% if current_page != 1 %} – {{ 'general.meta.page' | t: page: current_page }}{% endif %}{% unless page_title contains shop.name %} – {{ shop.name }}{% endunless %} | |
</title> |
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
payment_gateways = ["Afterpay", "BitPay"] # Gateways to hide | |
tag = "lowstock" # Tag to look for | |
lowStockVariantIDS = [] # Will contain variant ID's of low stock items | |
# Loop over line items to check if any have low stock tag. | |
# If product doeshave tag, add it to our lowStockVariantIDs array. | |
Input.cart.line_items.each do |item| | |
#Note: this won't be very efficient for products with lots of tags | |
item.variant.product.tags.each do |tag| |
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
# ================================ Customizable Settings ================================ | |
# ================================================================ | |
# Tiered Discounts by Quantity | |
# | |
# A list of discount tier offers where: | |
# - 'product_selector_match_type' determines whether we look for | |
# products that do or don't match the entered selectors. Can | |
# be: | |
# - ':include' to check if the product does match | |
# - ':exclude' to make sure the product doesn't match |
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
<!-- This code will add an item to the cart on button click. --> | |
{%- assign has_bib = false -%} | |
{%- assign has_jersey = false -%} | |
{%- assign has_bundle = false -%} | |
{%- for item in cart.items -%} | |
{% if item.product.type == 'Bib' -%} | |
{%- assign has_bib = true -%} | |
{%- elsif item.product.type == 'Jersey' -%} |
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
{%- assign has_bib = false -%} | |
{%- assign has_jersey = false -%} | |
{%- assign has_bundle = false -%} | |
{%- for item in cart.items -%} | |
{% if item.product.type == 'Bib' -%} | |
{%- assign has_bib = true -%} | |
{%- elsif item.product.type == 'Jersey' -%} | |
{%- assign has_jersey = true -%} | |
{%- endif -%} |
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
{% assign shipping_threshold = 15000 %} <!-- this is in cents. 15000 = $150--> | |
{% assign current_cart = shipping_threshold | minus: cart.total_price %} | |
{{ current_cart }} | |
{{ cart.total_price }} | |
{% if cart.total_price < shipping_threshold %} | |
<p>Add {{ current_cart | money }} to your cart for free express shiping </p> | |
{% else %} | |
<p>Qualify for free express shipping!</p> | |
{% endif %} |
NewerOlder