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 = ShopifyAPI::Product.find(:all, params: { order: 'inventory_total desc', limit: 250 }) | |
process_products(products) | |
3.times do | |
break unless products.next_page? | |
products = products.fetch_next_page | |
process_products(products) | |
end |
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
rate_definitions: | |
- | |
name: Standard | |
price: 0 | |
currency: CAD | |
rate_class_id: 10 | |
conditions: | |
- | |
field: total_price | |
criteria: 100 |
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
time_namelookup: 0.326604s | |
time_connect: 0.467748s | |
time_appconnect: 0.000000s | |
time_pretransfer: 0.467986s | |
time_redirect: 0.000000s | |
time_starttransfer: 0.584812s | |
---------- | |
time_total: 0.584852s |
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
time_namelookup: %{time_namelookup}s\n | |
time_connect: %{time_connect}s\n | |
time_appconnect: %{time_appconnect}s\n | |
time_pretransfer: %{time_pretransfer}s\n | |
time_redirect: %{time_redirect}s\n | |
time_starttransfer: %{time_starttransfer}s\n | |
----------\n | |
time_total: %{time_total}s\n |
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
{ | |
destination_address: { | |
country_code: "CA", | |
province_code: "QC", | |
city: "Montreal", | |
address1: "address 1", | |
address2: "address 2", | |
address3: "address 3", | |
postal_code: "K2K2K2" | |
}, |
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
<div class="animated-text"> | |
<div id="animated-container"> | |
{{ section.settings.start-text }} | |
<div id="scroll"> | |
<div><div>{{ section.settings.text1 }}</div></div> | |
<div><div>{{ section.settings.text2 }}</div></div> | |
<div><div>{{ section.settings.text3 }}</div></div> | |
</div> | |
{{ section.settings.end-text }} | |
</div> |
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 available %} | |
{% if product.price_varies and template == 'collection' %} | |
From {{ product.price_min | money }} to {{ product.price_max | money }} | |
{% else %} | |
{{ money_price }} | |
{% endif %} | |
{% else %} | |
{{ 'products.product.sold_out' | t }} | |
{% 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
# Use an array to keep track of the discount campaigns desired. | |
CAMPAIGNS = [ | |
# $5 off all items with the "sale" tag | |
ItemCampaign.new( | |
AndSelector.new( | |
TagSelector.new("sale"), | |
ExcludeGiftCardSelector.new, | |
), | |
MoneyDiscount.new(5_00, "5$ off all items on sale",), | |
), |
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
def Shopify.set_product_metafield_map(id, namespace, key, map) | |
# convert the map to JSON so it fits in one metafield | |
data = { | |
"metafield" => { | |
"namespace" => namespace, | |
"key" => key, | |
"value" => map.to_json, | |
"value_type" => "string" | |
} | |
} |
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
{ | |
"_type": "export", | |
"__export_format": 3, | |
"__export_date": "2018-11-02T17:49:05.621Z", | |
"__export_source": "insomnia.desktop.app:v6.0.2", | |
"resources": [ | |
{ | |
"_id": "wrk_566964f3c7d044748b99b8c814e40d8e", | |
"created": 1538419476867, | |
"description": "", |