@{{ variable.name }}
@@ -87,10 +87,15 @@
-
+
@@ -198,16 +203,12 @@
this.product = sku;
},
- addCart(isBuyNow) {
- const data = {
- sku_id: this.product.id,
- quantity: this.quantity
- };
- console.log(data);
- return;
-
- $http.post('/carts', data).then((res) => {
+ addCart(isBuyNow = false) {
+ $http.post('/carts', {sku_id: this.product.id, quantity: this.quantity}).then((res) => {
layer.msg(res.message)
+ if (isBuyNow) {
+ location.href = '{{ shop_route("checkout.index") }}'
+ }
})
},