fix(dashboard): Ensure conditional prices are assigned to region (#11335)
This commit is contained in:
committed by
GitHub
parent
073eb15d11
commit
7d208afb07
@@ -355,13 +355,19 @@ const getDefaultValues = (prices: HttpTypes.AdminShippingOptionPrice[]) => {
|
||||
}
|
||||
|
||||
if (hasAttributes(price, [REGION_ID_ATTRIBUTE], [ITEM_TOTAL_ATTRIBUTE])) {
|
||||
const regionId = price.price_rules[0].value
|
||||
const regionId = price.price_rules.find(
|
||||
(r) => r.attribute === REGION_ID_ATTRIBUTE
|
||||
)?.value
|
||||
|
||||
region_prices[regionId] = price.amount
|
||||
return
|
||||
}
|
||||
|
||||
if (hasAttributes(price, [REGION_ID_ATTRIBUTE, ITEM_TOTAL_ATTRIBUTE])) {
|
||||
const regionId = price.price_rules[0].value
|
||||
const regionId = price.price_rules.find(
|
||||
(r) => r.attribute === REGION_ID_ATTRIBUTE
|
||||
)?.value
|
||||
|
||||
if (!conditional_region_prices[regionId]) {
|
||||
conditional_region_prices[regionId] = []
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user