diff --git a/promo/app/controllers/spree/store_controller_decorator.rb b/promo/app/controllers/spree/store_controller_decorator.rb index 2d17f4659656..9a32c3e65611 100644 --- a/promo/app/controllers/spree/store_controller_decorator.rb +++ b/promo/app/controllers/spree/store_controller_decorator.rb @@ -35,13 +35,13 @@ def apply_coupon_code elsif previous_promo.present? and promo.present? flash[:error] = t(:coupon_code_better_exists) false - elsif (promo.id == 89 and exclusion_rule.present? and !exclusion_rule.eligible?(@order)) - items = exclusion_eligible_products && @order.products.map(&:name) - flash["product-exclusion-preorder-warning"] = "#{t(:coupon_code_not_for_preorders)}, #{t(:go_back_to)} #{t(:shopping_cart)} #{t(:remove_items)}: #{items.join(', ')}".html_safe - false elsif (exclusion_rule.present? and !exclusion_rule.eligible?(@order)) items = exclusion_eligible_products && @order.products.map(&:name) - flash["product-exclusion-warning"] = "#{t(:product_exclusion_rule_warning)} #{t(:listed_items)}: #{items.join(', ')}" + if promo.id == 89 + flash["product-exclusion-preorder-warning"] = "#{t(:coupon_code_not_for_preorders)}, #{t(:go_back_to)} #{t(:shopping_cart)} #{t(:remove_items)}: #{items.join(', ')}".html_safe + else + flash["product-exclusion-warning"] = "#{t(:product_exclusion_rule_warning)} #{t(:listed_items)}: #{items.join(', ')}" + end false elsif promo.present? flash[:error] = t(:coupon_code_not_eligible) diff --git a/promo/config/locales/en.yml b/promo/config/locales/en.yml index e3ce25ad6c6f..6a2b0e946ca2 100644 --- a/promo/config/locales/en.yml +++ b/promo/config/locales/en.yml @@ -22,11 +22,16 @@ en: coupon_code_already_applied: The coupon code has already been applied to this order coupon_code_better_exists: The previously applied coupon code results in a better deal coupon_code_not_found: The coupon code you entered doesn't exist. Please try again. - coupon_code_not_for_preorders: You can't use a free shipping coupon on an order that contains one of the new pre-order items. Please place a separate order for the pre-order items. + coupon_code_not_for_preorders: Oops! The Free Shipping coupon doesn't apply to the new pre-order items in your cart. You will need to place a separate order for the pre-order items. To get the Free Shipping discount on this order coupon_code_max_usage: Coupon code usage limit exceeded coupon_code_not_eligible: This coupon code is not eligible for this order + product_exclusion_rule_warning: Oops! Your cart contains item(s) that will not work with this promotion. + listed_items: The listed item(s) must be removed before the discount can apply editing_promotion: Editing Promotion current_promotion_usage: 'Current Usage: %{count}' + go_back_to: please go back to the + remove_items: and remove the following items + shopping_cart: Shopping Cart events: spree: checkout: