@moonbase.sh/vue 0.1.81 → 0.1.82
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/dist/index.cjs +23 -1
- package/dist/index.js +23 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -278,7 +278,29 @@ function useCart() {
|
|
|
278
278
|
if (!storefront)
|
|
279
279
|
throw new Error("No storefront configured");
|
|
280
280
|
return {
|
|
281
|
-
items: (0, import_vue8.computed)(() => storefront.currentOrder.value.items)
|
|
281
|
+
items: (0, import_vue8.computed)(() => storefront.currentOrder.value.items.map((item) => {
|
|
282
|
+
if (item.type === "Product") {
|
|
283
|
+
const product = storefront.storefront.value.products.find((p) => p.id === item.productId);
|
|
284
|
+
const variations = (product == null ? void 0 : product.variations) || [];
|
|
285
|
+
const variation = variations.find((v) => v.id === item.variationId);
|
|
286
|
+
return {
|
|
287
|
+
...item,
|
|
288
|
+
product,
|
|
289
|
+
variation,
|
|
290
|
+
price: variation == null ? void 0 : variation.price
|
|
291
|
+
};
|
|
292
|
+
} else {
|
|
293
|
+
const bundle = storefront.storefront.value.bundles.find((b) => b.id === item.bundleId);
|
|
294
|
+
const variations = (bundle == null ? void 0 : bundle.variations) || [];
|
|
295
|
+
const variation = variations.find((v) => v.id === item.variationId);
|
|
296
|
+
return {
|
|
297
|
+
...item,
|
|
298
|
+
bundle,
|
|
299
|
+
variation,
|
|
300
|
+
price: variation == null ? void 0 : variation.price
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
})),
|
|
282
304
|
currency: (0, import_vue8.computed)(() => storefront.currentOrder.value.currency || storefront.storefront.value.suggestedCurrency),
|
|
283
305
|
total: (0, import_vue8.computed)(() => {
|
|
284
306
|
const currency = storefront.currentOrder.value.currency || storefront.storefront.value.suggestedCurrency;
|
package/dist/index.js
CHANGED
|
@@ -244,7 +244,29 @@ function useCart() {
|
|
|
244
244
|
if (!storefront)
|
|
245
245
|
throw new Error("No storefront configured");
|
|
246
246
|
return {
|
|
247
|
-
items: computed5(() => storefront.currentOrder.value.items)
|
|
247
|
+
items: computed5(() => storefront.currentOrder.value.items.map((item) => {
|
|
248
|
+
if (item.type === "Product") {
|
|
249
|
+
const product = storefront.storefront.value.products.find((p) => p.id === item.productId);
|
|
250
|
+
const variations = (product == null ? void 0 : product.variations) || [];
|
|
251
|
+
const variation = variations.find((v) => v.id === item.variationId);
|
|
252
|
+
return {
|
|
253
|
+
...item,
|
|
254
|
+
product,
|
|
255
|
+
variation,
|
|
256
|
+
price: variation == null ? void 0 : variation.price
|
|
257
|
+
};
|
|
258
|
+
} else {
|
|
259
|
+
const bundle = storefront.storefront.value.bundles.find((b) => b.id === item.bundleId);
|
|
260
|
+
const variations = (bundle == null ? void 0 : bundle.variations) || [];
|
|
261
|
+
const variation = variations.find((v) => v.id === item.variationId);
|
|
262
|
+
return {
|
|
263
|
+
...item,
|
|
264
|
+
bundle,
|
|
265
|
+
variation,
|
|
266
|
+
price: variation == null ? void 0 : variation.price
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
})),
|
|
248
270
|
currency: computed5(() => storefront.currentOrder.value.currency || storefront.storefront.value.suggestedCurrency),
|
|
249
271
|
total: computed5(() => {
|
|
250
272
|
const currency = storefront.currentOrder.value.currency || storefront.storefront.value.suggestedCurrency;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moonbase.sh/vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.82",
|
|
5
5
|
"description": "Package to let you build vue.js storefronts with Moonbase.sh as payment and delivery provider",
|
|
6
6
|
"author": "Tobias Lønnerød Madsen <m@dsen.tv>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@vue/devtools-api": "^6.5.1",
|
|
20
20
|
"uuid": "^9.0.1",
|
|
21
|
-
"@moonbase.sh/storefront-api": "0.1.
|
|
21
|
+
"@moonbase.sh/storefront-api": "0.1.82"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@types/uuid": "^9.0.7",
|