@moonbase.sh/vue 0.1.78 → 0.1.80
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 +12 -5
- package/dist/index.js +12 -5
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -315,7 +315,9 @@ function useCart() {
|
|
|
315
315
|
bundleId: item.id,
|
|
316
316
|
bundle: item,
|
|
317
317
|
quantity: 1,
|
|
318
|
-
|
|
318
|
+
variation,
|
|
319
|
+
variationId: variation.id,
|
|
320
|
+
price: variation.price
|
|
319
321
|
};
|
|
320
322
|
storefront.currentOrder.value.items.push(lineItem);
|
|
321
323
|
} else if (item.type === "product") {
|
|
@@ -325,7 +327,9 @@ function useCart() {
|
|
|
325
327
|
productId: item.id,
|
|
326
328
|
product: item,
|
|
327
329
|
quantity: 1,
|
|
328
|
-
|
|
330
|
+
variation,
|
|
331
|
+
variationId: variation.id,
|
|
332
|
+
price: variation.price
|
|
329
333
|
};
|
|
330
334
|
storefront.currentOrder.value.items.push(lineItem);
|
|
331
335
|
}
|
|
@@ -335,9 +339,12 @@ function useCart() {
|
|
|
335
339
|
const _ = storefront.pushOrderContent();
|
|
336
340
|
},
|
|
337
341
|
setQuantity: (cartItem, quantity) => {
|
|
338
|
-
|
|
339
|
-
if (
|
|
340
|
-
|
|
342
|
+
const cartItemRef = storefront.currentOrder.value.items.find((i) => i.id === cartItem.id);
|
|
343
|
+
if (!cartItemRef)
|
|
344
|
+
throw new Error("Cart item not found");
|
|
345
|
+
cartItemRef.quantity = quantity;
|
|
346
|
+
if (cartItemRef.quantity <= 0) {
|
|
347
|
+
const index = storefront.currentOrder.value.items.findIndex((i) => i.id === cartItemRef.id);
|
|
341
348
|
storefront.currentOrder.value.items.splice(index, 1);
|
|
342
349
|
}
|
|
343
350
|
const _ = storefront.pushOrderContent();
|
package/dist/index.js
CHANGED
|
@@ -281,7 +281,9 @@ function useCart() {
|
|
|
281
281
|
bundleId: item.id,
|
|
282
282
|
bundle: item,
|
|
283
283
|
quantity: 1,
|
|
284
|
-
|
|
284
|
+
variation,
|
|
285
|
+
variationId: variation.id,
|
|
286
|
+
price: variation.price
|
|
285
287
|
};
|
|
286
288
|
storefront.currentOrder.value.items.push(lineItem);
|
|
287
289
|
} else if (item.type === "product") {
|
|
@@ -291,7 +293,9 @@ function useCart() {
|
|
|
291
293
|
productId: item.id,
|
|
292
294
|
product: item,
|
|
293
295
|
quantity: 1,
|
|
294
|
-
|
|
296
|
+
variation,
|
|
297
|
+
variationId: variation.id,
|
|
298
|
+
price: variation.price
|
|
295
299
|
};
|
|
296
300
|
storefront.currentOrder.value.items.push(lineItem);
|
|
297
301
|
}
|
|
@@ -301,9 +305,12 @@ function useCart() {
|
|
|
301
305
|
const _ = storefront.pushOrderContent();
|
|
302
306
|
},
|
|
303
307
|
setQuantity: (cartItem, quantity) => {
|
|
304
|
-
|
|
305
|
-
if (
|
|
306
|
-
|
|
308
|
+
const cartItemRef = storefront.currentOrder.value.items.find((i) => i.id === cartItem.id);
|
|
309
|
+
if (!cartItemRef)
|
|
310
|
+
throw new Error("Cart item not found");
|
|
311
|
+
cartItemRef.quantity = quantity;
|
|
312
|
+
if (cartItemRef.quantity <= 0) {
|
|
313
|
+
const index = storefront.currentOrder.value.items.findIndex((i) => i.id === cartItemRef.id);
|
|
307
314
|
storefront.currentOrder.value.items.splice(index, 1);
|
|
308
315
|
}
|
|
309
316
|
const _ = storefront.pushOrderContent();
|
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.80",
|
|
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.80"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@types/uuid": "^9.0.7",
|