From 830dcfb8b445004ba1228b842f56c23bbe4bf050 Mon Sep 17 00:00:00 2001 From: Mathius Date: Thu, 16 Nov 2023 22:07:10 -0800 Subject: [PATCH] wip: add strategy all --- locales/en.json | 4 ++++ .../DiscountApplicationStrategyCard.tsx | 5 +++++ src/types.ts | 1 + 3 files changed, 10 insertions(+) diff --git a/locales/en.json b/locales/en.json index b4c92f05..f79be6b5 100644 --- a/locales/en.json +++ b/locales/en.json @@ -576,6 +576,10 @@ "maximum": { "label": "Maximum", "helpText": "Only apply the discount that offers the maximum reduction." + }, + "all": { + "label": "All", + "helpText": "Apply all discounts with conditions that are satisfied." } } } diff --git a/src/components/DiscountApplicationStrategyCard/DiscountApplicationStrategyCard.tsx b/src/components/DiscountApplicationStrategyCard/DiscountApplicationStrategyCard.tsx index bc681c59..2fd7a54b 100644 --- a/src/components/DiscountApplicationStrategyCard/DiscountApplicationStrategyCard.tsx +++ b/src/components/DiscountApplicationStrategyCard/DiscountApplicationStrategyCard.tsx @@ -44,6 +44,11 @@ export function DiscountApplicationStrategyCard({ label: i18n.translate('maximum.label', I18N_SCOPE), helpText: i18n.translate('maximum.helpText', I18N_SCOPE), }, + { + value: DiscountApplicationStrategy.All, + label: i18n.translate('all.label', I18N_SCOPE), + helpText: i18n.translate('all.helpText', I18N_SCOPE), + }, ]} selected={[strategy.value]} onChange={handleChange} diff --git a/src/types.ts b/src/types.ts index dcaca150..ee99b3c9 100644 --- a/src/types.ts +++ b/src/types.ts @@ -87,6 +87,7 @@ export type CountryCode = SupportedCountryCode | typeof REST_OF_WORLD; export enum DiscountApplicationStrategy { First = 'FIRST', Maximum = 'MAXIMUM', + All = 'ALL', } export interface ProductOrCollectionResource extends Resource { title: string;