Skip to content
This repository was archived by the owner on Feb 19, 2025. It is now read-only.

Commit

Permalink
Merge pull request #48 from friendlycart/import-eligibility-errors
Browse files Browse the repository at this point in the history
Import eligiblity error messages from Solidus
  • Loading branch information
mamhoff authored Oct 21, 2023
2 parents fbffb7f + 2310e6b commit fc47a05
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/solidus_friendly_promotions/promotion_rule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def unique_per_promotion
end

def eligibility_error_message(key, options = {})
I18n.t(key, **{scope: [:spree, :eligibility_errors, :messages]}.merge(options))
I18n.t(key, **{scope: [:solidus_friendly_promotions, :eligibility_errors, self.class.name.underscore]}.merge(options))
end
end
end
40 changes: 40 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,46 @@ en:
hints:
solidus_friendly_promotions/calculator:
promotions: This is used to determine the promotional discount to be applied to an order, an item, or shipping charges.
eligibility_errors:
solidus_friendly_promotions/rules/first_order:
not_first_order: This coupon code can only be applied to your first order.
solidus_friendly_promotions/rules/first_repeat_purchase_since:
solidus_friendly_promotions/rules/item_total:
item_total_doesnt_match_with_operator: This coupon code can't be applied to orders %{operator} %{amount}.
item_total_less_than: This coupon code can't be applied to orders less than %{amount}.
item_total_less_than_or_equal: This coupon code can't be applied to orders less than or equal to %{amount}.
solidus_friendly_promotions/rules/discounted_item_total:
item_total_doesnt_match_with_operator: This coupon code can't be applied to orders %{operator} %{amount}.
item_total_less_than: This coupon code can't be applied to orders less than %{amount}.
item_total_less_than_or_equal: This coupon code can't be applied to orders less than or equal to %{amount}.
solidus_friendly_promotions/rules/landing_page:
solidus_friendly_promotions/rules/nth_order:
solidus_friendly_promotions/rules/one_use_per_user:
no_user_specified: You need to login before applying this coupon code.
limit_once_per_user: This coupon code can only be used once per user.
solidus_friendly_promotions/rules/option_value:
solidus_friendly_promotions/rules/line_item_option_value:
solidus_friendly_promotions/rules/product:
has_excluded_product: Your cart contains a product that prevents this coupon code from being applied.
missing_product: This coupon code can't be applied because you don't have all of the necessary products in your cart.
no_applicable_products: You need to add an applicable product before applying this coupon code.
solidus_friendly_promotions/rules/line_item_product:
has_excluded_product: Your cart contains a product that prevents this coupon code from being applied.
missing_product: This coupon code can't be applied because you don't have all of the necessary products in your cart.
no_applicable_products: You need to add an applicable product before applying this coupon code.
solidus_friendly_promotions/rules/taxon:
has_excluded_taxon: Your cart contains a product from an excluded category that prevents this coupon code from being applied.
missing_taxon: You need to add a product from all applicable categories before applying this coupon code.
no_matching_taxons: You need to add a product from an applicable category before applying this coupon code.
solidus_friendly_promotions/rules/line_item_taxon:
has_excluded_taxon: Your cart contains a product from an excluded category that prevents this coupon code from being applied.
missing_taxon: You need to add a product from all applicable categories before applying this coupon code.
no_matching_taxons: You need to add a product from an applicable category before applying this coupon code.
solidus_friendly_promotions/rules/user:
no_user_specified: You need to login before applying this coupon code.
solidus_friendly_promotions/rules/user_logged_in:
no_user_specified: You need to login before applying this coupon code.
solidus_friendly_promotions/rules/user_role:
product_rule:
choose_products: Choose products
label: Order must contain %{select} these products
Expand Down

0 comments on commit fc47a05

Please sign in to comment.