feat(settings): unify settings and ui-texts with canonical aliases, add PriceInput thousand separators, and synchronize financial endpoints
Deploy Canina / deploy (push) Successful in 1m46s
Deploy Canina / deploy (push) Successful in 1m46s
This commit is contained in:
1 parent
45c9db133c
commit
b3c60a1a7d
17 files changed
+79340
-78724
No files matched your search
@@ -72,13 +72,16 @@ export default function CheckoutPage() {
|
||||
|
||||
const roundStep = Number(useSettingsStore((state) => state.getText('CHARITY_ROUND_STEP', '10000'))) || 10000;
|
||||
const shippingFeeSetting = useSettingsStore((state) => state.getText('shipping_fee', '0'));
|
||||
const shippingFee = Number(shippingFeeSetting) || 0;
|
||||
const baseShippingFee = Number(shippingFeeSetting) || 0;
|
||||
const freeThreshold = Number(useSettingsStore((state) => state.getText('free_shipping_threshold', '2000000'))) || 0;
|
||||
const subtotal = getSubtotal();
|
||||
const shippingFee = (freeThreshold > 0 && subtotal >= freeThreshold) ? 0 : baseShippingFee;
|
||||
|
||||
const isCardToCardEnabled = useSettingsStore((state) =>
|
||||
state.getBoolean('PAY_GATEWAY_CARD_ENABLE', true) &&
|
||||
state.getBoolean('cardToCardEnabled', true) &&
|
||||
state.getBoolean('payment_card_to_card_enabled', true)
|
||||
);
|
||||
const subtotal = getSubtotal();
|
||||
const remainder = subtotal % roundStep;
|
||||
const roundUpDiff = remainder === 0 ? roundStep : roundStep - remainder;
|
||||
|
||||
|
||||
@@ -68,6 +68,11 @@ export const useSettingsStore = create<SettingsStore>()((set, get) => ({
|
||||
if (key === 'site_logo_text_en') return texts['BRAND_LOGO_TEXT_EN'] || fallback;
|
||||
if (key === 'site_logo_text_fa') return texts['BRAND_LOGO_TEXT_FA'] || texts['brand_name_fa'] || fallback;
|
||||
if (key === 'site_logo_subtitle') return texts['BRAND_LOGO_SUBTITLE'] || texts['brand_subtitle'] || fallback;
|
||||
if (key === 'shipping_fee') return texts['SHIPPING_FEE'] || texts['standardShippingFee'] || fallback;
|
||||
if (key === 'free_shipping_threshold') return texts['FREE_SHIPPING_THRESHOLD'] || texts['freeShippingThreshold'] || fallback;
|
||||
if (key === 'min_order_amount') return texts['MIN_ORDER_AMOUNT'] || texts['minOrderAmount'] || fallback;
|
||||
if (key === 'charity_round_step') return texts['CHARITY_ROUND_STEP'] || texts['charityRoundStep'] || fallback;
|
||||
if (key === 'tax_percentage') return texts['TAX_PERCENTAGE'] || texts['taxPercentage'] || fallback;
|
||||
return fallback;
|
||||
}
|
||||
return value;
|
||||
|
||||
Reference in new issue
Block a user