@nuskin/ns-shop 7.6.3-pa-163.1 → 7.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -120,7 +120,7 @@ const checkMaxQuantity = async (status) => {
|
|
|
120
120
|
let configMaxes
|
|
121
121
|
|
|
122
122
|
try {
|
|
123
|
-
configMaxes = basicCfg.
|
|
123
|
+
configMaxes = basicCfg.skuMaxQty
|
|
124
124
|
.map((cm) => JSON.parse(cm))
|
|
125
125
|
.reduce((map, cmItem) => {
|
|
126
126
|
map[cmItem.sku] = cmItem.maxQty;
|
|
@@ -132,9 +132,9 @@ const checkMaxQuantity = async (status) => {
|
|
|
132
132
|
}
|
|
133
133
|
status.maxQuantity = status.availableQuantity < 999 ? status.availableQuantity : 999;
|
|
134
134
|
if (configMaxes && Object.keys(configMaxes).length > 0) {
|
|
135
|
-
if (Object.hasOwn(configMaxes, status.
|
|
136
|
-
if (configMaxes[status.
|
|
137
|
-
status.maxQuantity = configMaxes[status.
|
|
135
|
+
if (Object.hasOwn(configMaxes, status.sku)) {
|
|
136
|
+
if (configMaxes[status.sku] < status.availableQuantity) {
|
|
137
|
+
status.maxQuantity = configMaxes[status.sku];
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
}
|