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
products_to_exclude = [444750805, 444750821] #product ids to exclude | |
trigger_customer_tag = 'member-50' #customer tags to trigger script discount | |
if Input.cart&.customer&.tags.include?(trigger_customer_tag) && Input.cart&.discount_code == nil #does the customer have the right tag, and are there no discounts applied? | |
Input.cart.line_items.each do |line_item| | |
product = line_item.variant.product | |
next if product.gift_card? # don't discount gift cards | |
next if products_to_exclude.include?(product.id) # don't discount excluded products | |
line_item.change_line_price(line_item.line_price * 0.50, message: "Pro Deal - 50% Discount") #discount everything else by X% |
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
// @ts-check | |
// Use JSDoc annotations for type safety. | |
/** | |
* @typedef {import("../generated/api").InputQuery} InputQuery | |
* @typedef {import("../generated/api").FunctionResult} FunctionResult | |
*/ | |
/** | |
* @type {FunctionResult} | |
*/ | |
const NO_CHANGES = { |
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
mutation priceListCreate($input: PriceListCreateInput!) { | |
priceListCreate(input: $input) { | |
priceList { | |
id | |
} | |
userErrors { | |
field | |
message | |
} | |
} |
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
const sheet = SpreadsheetApp.getActive().getSheetByName("[sheet_name]"); | |
const data = sheet.getDataRange().getValues(); | |
function postData(giftData) { | |
let options = { | |
'method' : 'post', | |
'contentType': 'application/json', | |
'payload' : JSON.stringify(giftData), | |
'headers': { |
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
<ul> | |
{% for article in blogs.news.articles %} | |
<li> | |
<h4>{{ article.title }}</h4> | |
{{ article.content }} | |
</li> | |
{% endfor %} | |
</ul> |
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
{% for refund in refunds %} | |
{% for item in refund.refund_line_items %} | |
{% for line in line_items %} | |
{% if item.line_item_id == line.id %} | |
title: {{ line.title }} | |
price: {{ line.price | money }} | |
{% endif %} | |
{% endfor %} | |
quantity: {{ item.quantity }} | |
{% endfor %} |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
<input id="search-input" name="q" type="text" class="search-query" placeholder="{{ 'general.search.search_button' | t }}" data-provide="typeahead" data-source="[{% for product in collections[settings.typeahead_collection].products %}"{{ product.title }} - {{ product.price | money | strip_html }}"{% unless forloop.last %},{% endunless %}{% endfor %}]" autocomplete="off"> |
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
{% if product.metafields.properties.size > 0 %} | |
<div class="col-xs-12 col-lg-6"> | |
{% for l_item in product.metafields.properties %} | |
{% assign key = l_item.first | split: ':' %} | |
{% assign key_type = key.last %} | |
{% assign key_title = key.first %} | |
{% assign value = l_item.last %} | |
<div class="form-group"> | |
<label>{{ key_title }}</label> | |
{% if key_type == 'select' %} |
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
<fieldset data-overrides-fieldset="checkout"> | |
<legend>Checkout</legend> | |
<table> | |
<tbody> | |
<tr> | |
<td colspan="2"> | |
<h3>Banner</h3> | |
</td> | |
</tr> | |
<tr class="horizontal"> |
NewerOlder