@reactionary/medusa 0.10.21 → 0.10.22
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.
|
@@ -131,8 +131,17 @@ class MedusaCheckoutCapability extends CheckoutCapability {
|
|
|
131
131
|
shippingMethodResponse.shipping_options
|
|
132
132
|
);
|
|
133
133
|
}
|
|
134
|
+
const calculatedPricesPromises = shippingMethodResponse.shipping_options.filter((x) => x.price_type === "calculated" && !x.calculated_price).map(async (sm) => {
|
|
135
|
+
const updatedSM = await client.store.fulfillment.calculate(sm.id, {
|
|
136
|
+
cart_id: payload.checkout.key
|
|
137
|
+
});
|
|
138
|
+
sm.calculated_price = updatedSM.shipping_option.calculated_price;
|
|
139
|
+
});
|
|
140
|
+
if (calculatedPricesPromises.length > 0) {
|
|
141
|
+
await Promise.all(calculatedPricesPromises);
|
|
142
|
+
}
|
|
134
143
|
for (const sm of shippingMethodResponse.shipping_options) {
|
|
135
|
-
if (!sm.calculated_price) {
|
|
144
|
+
if (!sm.calculated_price || !sm.calculated_price.calculated_amount && !sm.calculated_price.original_amount) {
|
|
136
145
|
console.warn(`Skipping shipping method ${sm.name}/${sm.provider.id} because it has no calculated price for checkout ${payload.checkout.key}`);
|
|
137
146
|
continue;
|
|
138
147
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reactionary/medusa",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.22",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@medusajs/js-sdk": "^2.13.3",
|
|
13
|
-
"@reactionary/core": "0.10.
|
|
13
|
+
"@reactionary/core": "0.10.22",
|
|
14
14
|
"debug": "^4.4.3",
|
|
15
15
|
"@medusajs/types": "^2.13.3",
|
|
16
16
|
"zod": "4.1.9"
|