touch ~/.ssh/config
Open it and modify the file.
Host *
AddKeysToAgent yes
UseKeyChain yes
# ================================================================ | |
# ================================================================ | |
# LINE ITEM COMBO SCRIPT | |
# | |
# This script runs multiple line item scripts. | |
# | |
# Currently contains: | |
# | |
# 1: PRODUCT QUANTITY LIMITS | |
# (Limits line item quantities per order) |
Input.cart.line_items.each do |item| | |
# ================================================================ | |
# LINE ITEM PROPERTY DISCOUNT | |
# ================================================================ | |
# Set the line item property in Shopify theme When adding item to cart | |
# | |
# line item property is a key/value pair. Example: {"_someCoolPromo": "1"} | |
# | |
# In this example: | |
# "_someCoolPromo" is the key we look for here and must ALWAYS start with an underscore. |
# Insomnia Configuration | |
## Run the test query | |
{ | |
shop { | |
id | |
name | |
} | |
} | |
# Query Structure Examples |
touch ~/.ssh/config
Open it and modify the file.
Host *
AddKeysToAgent yes
UseKeyChain yes
Go to https://YOURSTORENAME.myshopify.com/admin/settings/files?limit=250
Open Dev Tools, and go to Console tab.
In Console paste the code below to download shopify-files.html file.
function fetchPageAssets() {
let images = document.querySelectorAll('img[src*=files]');
images.forEach(function(image) {
It's hard to migrate section themes that rely heavily on images. This bit of code helps you download all the CDN assets of your theme.
cdn_assets
folderdownload_assets.js
file at the root of your projectdownload_assets.js
file to match the path to your settings_data.json (line 3)download_assets.js
file to set the "CDN code" of your store.
Each file that you upload from /admin/settings/files
gets uploaded with the following format:
https://cdn.shopify.com/s/files/1/YOUR_CDN_CODE/files/YOURFILE
. The format of the code is /\d{4}\/\d{4}/
(four digits, a forward slash, and four digits)Git 2.13 introduced conditional configuration includes. For now, the only supported condition is matching the filesystem path of the repository, but that’s exactly what we need in this case.
You can configure your conditional includes by adding them to the bottom of your home directory’s ~/.gitconfig file:
[includeIf "gitdir:~/work/"]
path = ~/.gitconfig-work
[includeIf "gitdir:~/specific-project/"]
path = ~/.gitconfig-specific-project
List current remotes:
git remote -v
Add Heroku product & staging remotes:
Using Heroku-CLI:
heroku git:remote -a staging-app-name -r staging
# 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",), | |
), |