diff --git a/package.json b/package.json index 894e31c..f3e9557 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "shopify-script-creator", "private": true, - "version": "0.31.0", + "version": "0.30.0", "description": "Shopify Script Creator", "main": "index.js", "scripts": { diff --git a/ruby_scripts/lineItem/tiered_discount.rb b/ruby_scripts/lineItem/tiered_discount.rb index dee6049..cbe3d47 100644 --- a/ruby_scripts/lineItem/tiered_discount.rb +++ b/ruby_scripts/lineItem/tiered_discount.rb @@ -30,30 +30,6 @@ def run(cart) when :cart_subtotal cart_total = cart.subtotal_price qualified_tiers = @discount_tiers.select { |tier| cart_total >= Money.new(cents: tier[:tier].to_i * 100) } - when :cart_discounted_subtotal - cart_total = - case cart.discount_code - when CartDiscount::Percentage - if cart.subtotal_price >= cart.discount_code.minimum_order_amount - cart_subtotal_without_gc = cart.line_items.reduce(Money.zero) do |total, item| - total + (item.variant.product.gift_card? ? Money.zero : item.line_price) - end - gift_card_amount = cart.subtotal_price - cart_subtotal_without_gc - cart_subtotal_without_gc * ((Decimal.new(100) - cart.discount_code.percentage) / 100) + gift_card_amount - else - cart.subtotal_price - end - when CartDiscount::FixedAmount - if cart.subtotal_price >= cart.discount_code.minimum_order_amount - [cart.subtotal_price - cart.discount_code.amount, Money.zero].max - else - cart.subtotal_price - end - else - cart.subtotal_price - end - end - qualified_tiers = @discount_tiers.select { |tier| cart_total >= Money.new(cents: tier[:tier].to_i * 100) } when :discountable_total discountable_total = applicable_items.reduce(Money.zero) { |total, item| total + item.line_price } qualified_tiers = @discount_tiers.select { |tier| discountable_total >= Money.new(cents: tier[:tier].to_i * 100) } diff --git a/src/components/ChangeLogContent.js b/src/components/ChangeLogContent.js index 67700c9..dd00f20 100644 --- a/src/components/ChangeLogContent.js +++ b/src/components/ChangeLogContent.js @@ -7,7 +7,7 @@ export default function ChangeLogContent({newVersion} = props) {

Change Log

diff --git a/src/scripts/lineItem.js b/src/scripts/lineItem.js index 3f7dbc8..543dd10 100644 --- a/src/scripts/lineItem.js +++ b/src/scripts/lineItem.js @@ -591,30 +591,6 @@ class TieredDiscount < Campaign when :cart_subtotal cart_total = cart.subtotal_price qualified_tiers = @discount_tiers.select { |tier| cart_total >= Money.new(cents: tier[:tier].to_i * 100) } - when :cart_discounted_subtotal - cart_total = - case cart.discount_code - when CartDiscount::Percentage - if cart.subtotal_price >= cart.discount_code.minimum_order_amount - cart_subtotal_without_gc = cart.line_items.reduce(Money.zero) do |total, item| - total + (item.variant.product.gift_card? ? Money.zero : item.line_price) - end - gift_card_amount = cart.subtotal_price - cart_subtotal_without_gc - cart_subtotal_without_gc * ((Decimal.new(100) - cart.discount_code.percentage) / 100) + gift_card_amount - else - cart.subtotal_price - end - when CartDiscount::FixedAmount - if cart.subtotal_price >= cart.discount_code.minimum_order_amount - [cart.subtotal_price - cart.discount_code.amount, Money.zero].max - else - cart.subtotal_price - end - else - cart.subtotal_price - end - end - qualified_tiers = @discount_tiers.select { |tier| cart_total >= Money.new(cents: tier[:tier].to_i * 100) } when :discountable_total discountable_total = applicable_items.reduce(Money.zero) { |total, item| total + item.line_price } qualified_tiers = @discount_tiers.select { |tier| discountable_total >= Money.new(cents: tier[:tier].to_i * 100) } @@ -1102,10 +1078,6 @@ const campaigns = [{ value: "cart_subtotal", label: "Cart Subtotal" }, - { - value: "cart_discounted_subtotal", - label: "Cart Discounted Subtotal" - }, { value: "cart_items", label: "Cart Items Total Quantity" diff --git a/src/versions.js b/src/versions.js index a1c5353..9136457 100644 --- a/src/versions.js +++ b/src/versions.js @@ -1,4 +1,4 @@ export default { - currentVersion: "0.31.0", + currentVersion: "0.30.0", minimumVersion: "0.1.0", }