Shopify Script Code

Shopify script to give products with a quantity of 2 or more 10% off

0 Shares
0
0
0
0
0
0
0

Sample code for discount more than 2 line item

Input.cart.line_items.each do |line_item|
  next if line_item.variant.product.gift_card? || line_item.quantity <= 1
  line_item.change_line_price(line_item.line_price * 0.90, message: "10% 2 or more")
end

Output.cart = Input.cart