Skip to content

Instantly share code, notes, and snippets.

View nathanparker's full-sized avatar
🏓
Focusing

Nathan Parker nathanparker

🏓
Focusing
View GitHub Profile
@CodeBrotha
CodeBrotha / line_item_property_discount.rb
Created November 11, 2021 00:34
Shopify Scripts - Line Item Properties Discount
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.