@lancom/shared 0.0.382 → 0.0.384
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/assets/js/api/index.js +3 -0
- package/components/checkout/cart/cart.mixin.js +8 -13
- package/components/checkout/cart/cart.vue +9 -44
- package/components/checkout/cart/cart_price_info/cart-price-info.scss +11 -0
- package/components/checkout/cart/cart_price_info/cart-price-info.vue +7 -2
- package/components/checkout/cart/cart_pricing/cart-pricing.scss +11 -3
- package/components/checkout/cart/cart_pricing/cart-pricing.vue +6 -2
- package/components/checkout/cart/cart_shipments_pricing/cart-shipments-pricing.scss +3 -0
- package/components/checkout/cart/cart_shipments_pricing/cart-shipments-pricing.vue +13 -3
- package/components/checkout/cart/cart_shipping/cart-shipping.scss +43 -0
- package/components/checkout/cart/cart_shipping/cart-shipping.vue +126 -0
- package/components/checkout/order/address-form/address-form.vue +5 -0
- package/components/checkout/order/order-billing-information/order-billing-information.vue +6 -5
- package/components/checkout/order/order-payment-information/order-payment-information.vue +9 -0
- package/components/common/payment/payment_card/applepay/applepay.scss +8 -0
- package/components/common/payment/payment_card/applepay/applepay.vue +16 -0
- package/components/common/payment/payment_card/payment-card.vue +7 -0
- package/components/common/postcode_select/postcode-select.scss +6 -0
- package/components/common/postcode_select/postcode-select.vue +16 -6
- package/components/common/pricing_discounts_table/pricing-discounts-table.vue +12 -2
- package/components/customer/customer_coupons/customer-coupons.scss +33 -0
- package/components/customer/customer_coupons/customer-coupons.vue +103 -0
- package/components/customer/customer_coupons/customer_coupon_apply/customer-coupon-apply.scss +1 -0
- package/components/customer/customer_coupons/customer_coupon_apply/customer-coupon-apply.vue +51 -0
- package/components/customer/customer_coupons/customer_coupon_prints/customer-coupon-prints.scss +1 -0
- package/components/customer/customer_coupons/customer_coupon_prints/customer-coupon-prints.vue +33 -0
- package/components/customer/customer_coupons/customer_coupon_prints/customer_coupon_print/customer-coupon-print.scss +19 -0
- package/components/customer/customer_coupons/customer_coupon_prints/customer_coupon_print/customer-coupon-print.vue +82 -0
- package/components/customer/customer_coupons/customer_coupon_products/customer-coupon-products.scss +1 -0
- package/components/customer/customer_coupons/customer_coupon_products/customer-coupon-products.vue +33 -0
- package/components/customer/customer_coupons/customer_coupon_products/customer_coupon_product/customer-coupon-product.scss +17 -0
- package/components/customer/customer_coupons/customer_coupon_products/customer_coupon_product/customer-coupon-product.vue +52 -0
- package/components/customer/customer_navigation_menu/customer-navigation-menu.vue +72 -0
- package/components/customer/customer_orders/customer-orders.scss +26 -12
- package/components/customer/customer_orders/customer-orders.vue +64 -33
- package/components/customer/customer_orders/customer_order_reorder/customer-order-reorder.scss +1 -0
- package/components/customer/customer_orders/customer_order_reorder/customer-order-reorder.vue +55 -0
- package/components/customer/customer_orders/customer_order_trackings/customer-order-trackings.scss +8 -0
- package/components/customer/customer_orders/customer_order_trackings/customer-order-trackings.vue +38 -0
- package/components/quotes/quote_view/quote-view.vue +1 -0
- package/components/quotes/quote_view/quote_option_view/quote-option-view.vue +4 -0
- package/components/quotes/quote_view/quote_product_color_simple_products/quote-product-color-simple-products.vue +9 -2
- package/components/quotes/quote_view/quote_product_color_simple_products/quote_product_color_simple_product/quote-product-color-simple-product.scss +54 -1
- package/components/quotes/quote_view/quote_product_color_simple_products/quote_product_color_simple_product/quote-product-color-simple-product.vue +83 -5
- package/components/quotes/quote_view/quote_view_product/quote-view-product.scss +7 -0
- package/components/quotes/quote_view/quote_view_product/quote-view-product.vue +33 -11
- package/feeds/google-shopping.js +10 -4
- package/package.json +1 -1
- package/pages/checkout/order.vue +13 -4
- package/pages/customer/coupons.vue +39 -0
- package/pages/customer/orders.vue +39 -0
- package/pages/customer/settings.vue +4 -2
- package/routes/index.js +6 -1
- package/store/cart.js +4 -3
- package/pages/customer/orders/index.vue +0 -29
|
@@ -1,40 +1,53 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="CustomerOrders__wrapper">
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
</
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
3
|
+
<client-only>
|
|
4
|
+
<v-server-table
|
|
5
|
+
:key="uniqueKey"
|
|
6
|
+
ref="table"
|
|
7
|
+
:columns="columns"
|
|
8
|
+
:options="options">
|
|
9
|
+
<template #createdAt="{ row }">
|
|
10
|
+
{{ row.createdAt | date }}
|
|
11
|
+
</template>
|
|
12
|
+
<template #code="{ row }">
|
|
13
|
+
<a
|
|
14
|
+
:href="`/order/${row.token}`"
|
|
15
|
+
target="_blank">
|
|
16
|
+
{{ row.code }}
|
|
17
|
+
</a>
|
|
18
|
+
</template>
|
|
19
|
+
<template #tracking="{ row }">
|
|
20
|
+
<div class="CustomerOrders__trackings">
|
|
21
|
+
<customer-order-trackings :order="row" />
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
<template #reorder="{ row }">
|
|
25
|
+
<div class="CustomerOrders__reorder">
|
|
26
|
+
<customer-order-reorder :order="row" />
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
</v-server-table>
|
|
30
|
+
</client-only>
|
|
27
31
|
</div>
|
|
28
32
|
</template>
|
|
29
33
|
|
|
30
34
|
<script>
|
|
31
35
|
import { mapGetters } from 'vuex';
|
|
32
|
-
import
|
|
36
|
+
import Vue from 'vue';
|
|
37
|
+
import { ServerTable } from 'vue-tables-2';
|
|
33
38
|
import { date } from '@lancom/shared/assets/js/utils/filters';
|
|
39
|
+
import CustomerOrderTrackings from './customer_order_trackings/customer-order-trackings';
|
|
40
|
+
import CustomerOrderReorder from './customer_order_reorder/customer-order-reorder';
|
|
41
|
+
import { _get } from './../../../assets/js/api/helpers';
|
|
34
42
|
|
|
43
|
+
Vue.use(ServerTable);
|
|
35
44
|
|
|
36
45
|
export default {
|
|
37
46
|
name: 'CustomerOrders',
|
|
47
|
+
components: {
|
|
48
|
+
CustomerOrderTrackings,
|
|
49
|
+
CustomerOrderReorder
|
|
50
|
+
},
|
|
38
51
|
filters: {
|
|
39
52
|
date
|
|
40
53
|
},
|
|
@@ -46,19 +59,37 @@ export default {
|
|
|
46
59
|
},
|
|
47
60
|
data() {
|
|
48
61
|
return {
|
|
49
|
-
|
|
62
|
+
uniqueKey: Date.now(),
|
|
63
|
+
orders: [],
|
|
64
|
+
columns: ['createdAt', 'status', 'code', 'totalGST', 'tracking', 'reorder']
|
|
50
65
|
}
|
|
51
66
|
},
|
|
52
67
|
computed: {
|
|
53
|
-
...mapGetters(['
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
68
|
+
...mapGetters(['shop']),
|
|
69
|
+
url() {
|
|
70
|
+
return `shop/${this.shop._id}/customer/${this.customer._id}/orders`;
|
|
71
|
+
},
|
|
72
|
+
options() {
|
|
73
|
+
return {
|
|
74
|
+
query: null,
|
|
75
|
+
perPage: 15,
|
|
76
|
+
perPageValues: [15],
|
|
77
|
+
initialPage: 1,
|
|
78
|
+
filterable: false,
|
|
79
|
+
headings: { select: '' },
|
|
80
|
+
requestFunction: params => this.request(params),
|
|
81
|
+
columnsClasses: {
|
|
82
|
+
controls: 'controls-column'
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
}
|
|
57
86
|
},
|
|
58
87
|
methods: {
|
|
59
|
-
async
|
|
60
|
-
|
|
61
|
-
|
|
88
|
+
async request(params) {
|
|
89
|
+
const query = { ...params };
|
|
90
|
+
const result = await _get(this.url, query);
|
|
91
|
+
return result;
|
|
92
|
+
},
|
|
62
93
|
}
|
|
63
94
|
};
|
|
64
95
|
</script>
|
package/components/customer/customer_orders/customer_order_reorder/customer-order-reorder.scss
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "@/assets/scss/variables";
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="CustomerOrderReorder__wrapper">
|
|
3
|
+
<btn
|
|
4
|
+
btn-class="green"
|
|
5
|
+
:btn-disabled="processing"
|
|
6
|
+
:btn-processing="processing"
|
|
7
|
+
btn-label="Re-order"
|
|
8
|
+
@onclick="reorder()">
|
|
9
|
+
</btn>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
import { mapActions } from 'vuex';
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
name: 'CustomerOrderTrackings',
|
|
18
|
+
data() {
|
|
19
|
+
return {
|
|
20
|
+
processing: false
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
props: {
|
|
24
|
+
order: {
|
|
25
|
+
type: Object,
|
|
26
|
+
required: true
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
methods: {
|
|
30
|
+
...mapActions('cart', ['clearCart', 'addToCart']),
|
|
31
|
+
async reorder() {
|
|
32
|
+
try {
|
|
33
|
+
this.processing = true;
|
|
34
|
+
await this.clearCart();
|
|
35
|
+
await this.addToCart({
|
|
36
|
+
entities: this.order.products,
|
|
37
|
+
shop: this.order.shop,
|
|
38
|
+
country: this.order.country,
|
|
39
|
+
currency: this.order.currency
|
|
40
|
+
});
|
|
41
|
+
this.$router.push('/checkout/cart');
|
|
42
|
+
} catch (e) {
|
|
43
|
+
console.log(e);
|
|
44
|
+
} finally {
|
|
45
|
+
this.processing = false;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<style lang="scss">
|
|
53
|
+
@import 'customer-order-reorder';
|
|
54
|
+
</style>
|
|
55
|
+
|
package/components/customer/customer_orders/customer_order_trackings/customer-order-trackings.vue
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="CustomerOrderTrackings__wrapper">
|
|
3
|
+
<div
|
|
4
|
+
v-for="tracking of trackings"
|
|
5
|
+
:key="tracking._id"
|
|
6
|
+
class="CustomerOrderTrackings__item">
|
|
7
|
+
<a
|
|
8
|
+
:href="tracking.link"
|
|
9
|
+
target="_blank">
|
|
10
|
+
{{ tracking.code }}
|
|
11
|
+
</a>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
export default {
|
|
18
|
+
name: 'CustomerOrderTrackings',
|
|
19
|
+
props: {
|
|
20
|
+
order: {
|
|
21
|
+
type: Object,
|
|
22
|
+
required: true
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
computed: {
|
|
26
|
+
trackings() {
|
|
27
|
+
return (this.order.shipments || [])
|
|
28
|
+
.filter(s => !s.hasException)
|
|
29
|
+
.reduce((trackings, shipment) => [...trackings, ...(shipment.trackingNumbers || [])], []);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<style lang="scss">
|
|
36
|
+
@import 'customer-order-trackings';
|
|
37
|
+
</style>
|
|
38
|
+
|
|
@@ -37,7 +37,8 @@
|
|
|
37
37
|
<quote-product-color-simple-product
|
|
38
38
|
v-for="simpleProduct in group.simpleProducts"
|
|
39
39
|
:key="simpleProduct._id"
|
|
40
|
-
:simple-product="simpleProduct"
|
|
40
|
+
:simple-product="simpleProduct"
|
|
41
|
+
@change="onChangeColorSimpleProduct($event)" />
|
|
41
42
|
</div>
|
|
42
43
|
<div class="QuoteProductColorSimpleProducts__totals">
|
|
43
44
|
<div
|
|
@@ -89,7 +90,13 @@ export default {
|
|
|
89
90
|
},
|
|
90
91
|
mixins: [
|
|
91
92
|
QuoteProductColorSimpleProducts
|
|
92
|
-
]
|
|
93
|
+
],
|
|
94
|
+
methods: {
|
|
95
|
+
onChangeColorSimpleProduct() {
|
|
96
|
+
console.log('onChangeColorSimpleProduct:change...');
|
|
97
|
+
this.$emit('change');
|
|
98
|
+
}
|
|
99
|
+
}
|
|
93
100
|
};
|
|
94
101
|
</script>
|
|
95
102
|
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
align-items: center;
|
|
8
8
|
flex-direction: column;
|
|
9
9
|
margin-right: 4px;
|
|
10
|
+
margin-bottom: 5px;
|
|
10
11
|
}
|
|
11
12
|
&__label {
|
|
12
13
|
font-weight: 600;
|
|
@@ -17,10 +18,16 @@
|
|
|
17
18
|
margin-bottom: 6px;
|
|
18
19
|
margin-top: 0px;
|
|
19
20
|
}
|
|
21
|
+
&__field-wrapper {
|
|
22
|
+
position: relative;
|
|
23
|
+
&:hover .QuoteProductColorSimpleProduct__controls {
|
|
24
|
+
display: flex;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
20
27
|
&__field {
|
|
21
28
|
width: 32px;
|
|
22
29
|
height: 28px;
|
|
23
|
-
background:
|
|
30
|
+
background: $gray;
|
|
24
31
|
font-weight: 600;
|
|
25
32
|
font-size: 14px;
|
|
26
33
|
line-height: 19px;
|
|
@@ -28,5 +35,51 @@
|
|
|
28
35
|
color: #A2A2A2;
|
|
29
36
|
border-radius: 0;
|
|
30
37
|
padding: 2px !important;
|
|
38
|
+
|
|
39
|
+
&::-webkit-outer-spin-button,
|
|
40
|
+
&::-webkit-inner-spin-button {
|
|
41
|
+
-webkit-appearance: none;
|
|
42
|
+
margin: 0;
|
|
43
|
+
}
|
|
44
|
+
&[type=number] {
|
|
45
|
+
-moz-appearance: textfield;
|
|
46
|
+
}
|
|
47
|
+
&.empty {
|
|
48
|
+
color: #272727;
|
|
49
|
+
}
|
|
50
|
+
&.error {
|
|
51
|
+
color: #ff5a5a;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
&__price {
|
|
55
|
+
width: 32px;
|
|
56
|
+
height: 28px;
|
|
57
|
+
font-size: 9px;
|
|
58
|
+
text-align: center;
|
|
59
|
+
color: #A2A2A2;
|
|
60
|
+
padding-top: 5px;
|
|
61
|
+
}
|
|
62
|
+
&__controls {
|
|
63
|
+
display: flex;
|
|
64
|
+
flex-direction: column;
|
|
65
|
+
display: none;
|
|
66
|
+
}
|
|
67
|
+
&__control {
|
|
68
|
+
position: absolute;
|
|
69
|
+
bottom: -10px;
|
|
70
|
+
width: 16px;
|
|
71
|
+
height: 16px;
|
|
72
|
+
background: $white;
|
|
73
|
+
border: 1px solid $gray;
|
|
74
|
+
font-size: 12px;
|
|
75
|
+
z-index: 4;
|
|
76
|
+
cursor: pointer;
|
|
77
|
+
text-align: center;
|
|
78
|
+
&--encrease {
|
|
79
|
+
right: 0px;
|
|
80
|
+
}
|
|
81
|
+
&--decrease {
|
|
82
|
+
left: 0px;
|
|
83
|
+
}
|
|
31
84
|
}
|
|
32
85
|
}
|
|
@@ -1,23 +1,101 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="QuoteProductColorSimpleProduct__wrapper">
|
|
3
|
-
<
|
|
3
|
+
<label
|
|
4
|
+
:for="`amount-${simpleProduct.guid}`"
|
|
5
|
+
class="lc_regular16 QuoteProductColorSimpleProduct__label">
|
|
4
6
|
{{ simpleProduct.size.shortName }}
|
|
5
|
-
</
|
|
6
|
-
<div
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
</label>
|
|
8
|
+
<div class="QuoteProductColorSimpleProduct__field-wrapper">
|
|
9
|
+
<input
|
|
10
|
+
:id="`amount-${simpleProduct.guid}`"
|
|
11
|
+
ref="input"
|
|
12
|
+
v-model.number="model"
|
|
13
|
+
type="number"
|
|
14
|
+
min="0"
|
|
15
|
+
class="form-field centered QuoteProductColorSimpleProduct__field"
|
|
16
|
+
:class="{
|
|
17
|
+
empty: !model,
|
|
18
|
+
error: model > simpleProduct.quantityStock
|
|
19
|
+
}"
|
|
20
|
+
@wheel="onWheel"
|
|
21
|
+
@change="onChange()" />
|
|
22
|
+
<div class="QuoteProductColorSimpleProduct__controls">
|
|
23
|
+
<span
|
|
24
|
+
class="QuoteProductColorSimpleProduct__control QuoteProductColorSimpleProduct__control--decrease"
|
|
25
|
+
@click="decrease()">
|
|
26
|
+
-
|
|
27
|
+
</span>
|
|
28
|
+
<span
|
|
29
|
+
class="QuoteProductColorSimpleProduct__control QuoteProductColorSimpleProduct__control--encrease"
|
|
30
|
+
@click="encrease()">
|
|
31
|
+
+
|
|
32
|
+
</span>
|
|
33
|
+
</div>
|
|
9
34
|
</div>
|
|
10
35
|
</div>
|
|
11
36
|
</template>
|
|
12
37
|
|
|
13
38
|
<script>
|
|
39
|
+
import confirm from '@lancom/shared/mixins/confirm';
|
|
40
|
+
import { inRange, price } from '@lancom/shared/assets/js/utils/filters';
|
|
41
|
+
|
|
14
42
|
export default {
|
|
15
43
|
name: 'QuoteProductColorSimpleProduct',
|
|
44
|
+
mixins: [confirm],
|
|
45
|
+
filters: {
|
|
46
|
+
price
|
|
47
|
+
},
|
|
16
48
|
props: {
|
|
17
49
|
simpleProduct: {
|
|
18
50
|
type: Object,
|
|
19
51
|
required: true
|
|
20
52
|
}
|
|
53
|
+
},
|
|
54
|
+
computed: {
|
|
55
|
+
model: {
|
|
56
|
+
get() {
|
|
57
|
+
return this.simpleProduct.amount;
|
|
58
|
+
},
|
|
59
|
+
set(value) {
|
|
60
|
+
this.setSimpleProductAmount({
|
|
61
|
+
guid: this.simpleProduct.guid,
|
|
62
|
+
amount: this.formatAmount(value)
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
methods: {
|
|
68
|
+
setSimpleProductAmount({ amount }) {
|
|
69
|
+
this.simpleProduct.amount = amount;
|
|
70
|
+
},
|
|
71
|
+
onWheel(e) {
|
|
72
|
+
e.target.blur();
|
|
73
|
+
},
|
|
74
|
+
onChange() {
|
|
75
|
+
if (this.$refs.input) {
|
|
76
|
+
this.$refs.input.blur();
|
|
77
|
+
}
|
|
78
|
+
this.$emit('change');
|
|
79
|
+
},
|
|
80
|
+
formatAmount(value) {
|
|
81
|
+
return inRange(value, 0, this.simpleProduct.quantityStock || 999);
|
|
82
|
+
},
|
|
83
|
+
encrease() {
|
|
84
|
+
console.log('encrease...');
|
|
85
|
+
this.setSimpleProductAmount({
|
|
86
|
+
guid: this.simpleProduct.guid,
|
|
87
|
+
amount: this.formatAmount(this.model + 1)
|
|
88
|
+
});
|
|
89
|
+
this.$emit('change');
|
|
90
|
+
},
|
|
91
|
+
decrease() {
|
|
92
|
+
console.log('decrease...');
|
|
93
|
+
this.setSimpleProductAmount({
|
|
94
|
+
guid: this.simpleProduct.guid,
|
|
95
|
+
amount: this.formatAmount(this.model - 1)
|
|
96
|
+
});
|
|
97
|
+
this.$emit('change');
|
|
98
|
+
}
|
|
21
99
|
}
|
|
22
100
|
};
|
|
23
101
|
</script>
|
|
@@ -63,7 +63,13 @@
|
|
|
63
63
|
:entity="product"
|
|
64
64
|
:group="group"
|
|
65
65
|
:default-preview="groupedProducts.size === 1"
|
|
66
|
+
@change="onChangeColorSimpleProduct()"
|
|
66
67
|
class="QuoteViewProduct__item" />
|
|
68
|
+
<div
|
|
69
|
+
v-if="!isValidTotalQty"
|
|
70
|
+
class="QuoteViewProduct__qty-warning">
|
|
71
|
+
Total Qty Should Be: <b>{{ product.totalAmount }}</b>
|
|
72
|
+
</div>
|
|
67
73
|
</div>
|
|
68
74
|
<div
|
|
69
75
|
v-if="hasPrints"
|
|
@@ -103,12 +109,18 @@ export default {
|
|
|
103
109
|
type: Object,
|
|
104
110
|
required: true
|
|
105
111
|
},
|
|
112
|
+
pricing: {
|
|
113
|
+
type: Object
|
|
114
|
+
},
|
|
106
115
|
withDivider: {
|
|
107
116
|
type: Boolean,
|
|
108
117
|
default: true
|
|
109
118
|
}
|
|
110
119
|
},
|
|
111
120
|
computed: {
|
|
121
|
+
isValidTotalQty() {
|
|
122
|
+
return this.product.totalAmount > 0 && this.product.totalAmount === this.amount;
|
|
123
|
+
},
|
|
112
124
|
productLink() {
|
|
113
125
|
return this.product.product ? generateProductLink(this.product.product) : null;
|
|
114
126
|
},
|
|
@@ -128,17 +140,27 @@ export default {
|
|
|
128
140
|
return [...groupSimpleProducts(this.product, !this.product.isCustom, true)].filter(([, g]) => g.amount > 0);
|
|
129
141
|
},
|
|
130
142
|
totalPrice() {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
const
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
143
|
+
if (this.pricing) {
|
|
144
|
+
return this.pricing?.products[this.product._id]?.totalPriceWithoutTax;
|
|
145
|
+
} else {
|
|
146
|
+
const printsTotal = (this.product.prints || []).reduce((total, print) => {
|
|
147
|
+
const isMultiplePrint = (print.products || []).length > 0;
|
|
148
|
+
const printProducts = print.products || [];
|
|
149
|
+
const isMultiplePrintMainProduct = printProducts.indexOf(this.product.guid) === 0 || printProducts.indexOf(this.product._id) === 0;
|
|
150
|
+
const isFreeSetup = print.freeSetupOver >= 0 && this.amount > print.freeSetupOver;
|
|
151
|
+
const printCost = print.costType === 'setup only' ? 0 : print.printCost;
|
|
152
|
+
const setupCost = (isMultiplePrint && !isMultiplePrintMainProduct) ? 0 : (print.costType === 'item cost only' || isFreeSetup) ? 0 : print.setupCost;
|
|
153
|
+
return total + this.amount * printCost + setupCost;
|
|
154
|
+
}, 0);
|
|
155
|
+
const productsTotal = this.simpleProducts.reduce((total, { amount = 0, productCost = 0 }) => total + amount * productCost, 0);
|
|
156
|
+
return this.amount > 0 ? (printsTotal + productsTotal) : 0;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
methods: {
|
|
161
|
+
onChangeColorSimpleProduct() {
|
|
162
|
+
console.log('onChangeColorSimpleProduct2:change...');
|
|
163
|
+
this.$emit('change');
|
|
142
164
|
}
|
|
143
165
|
}
|
|
144
166
|
};
|
package/feeds/google-shopping.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
async function googleLocalShoppingFeed(axios, config, availableStores, country) {
|
|
2
|
-
const result = await googleShoppingFeed(axios, config, availableStores, country);
|
|
2
|
+
const result = await googleShoppingFeed(axios, config, availableStores, country, false, { allowSameDayDelivery: true });
|
|
3
3
|
|
|
4
4
|
const fields = [
|
|
5
5
|
'g:availability',
|
|
@@ -8,10 +8,11 @@ async function googleLocalShoppingFeed(axios, config, availableStores, country)
|
|
|
8
8
|
'g:pickup_sla',
|
|
9
9
|
'g:price',
|
|
10
10
|
'g:quantity',
|
|
11
|
-
'g:store_code'
|
|
11
|
+
'g:store_code',
|
|
12
|
+
'g:local_shipping_label'
|
|
12
13
|
];
|
|
13
14
|
result.rss.channel.item = result.rss.channel.item
|
|
14
|
-
.map(i => fields.reduce((item, field) => ({ ...item, [field]: i[field] }), {}));
|
|
15
|
+
.map(i => fields.reduce((item, field) => i[field] ? ({ ...item, [field]: i[field] }) : item, {}));
|
|
15
16
|
return result;
|
|
16
17
|
}
|
|
17
18
|
|
|
@@ -19,7 +20,8 @@ const COUNTRIES_SIZE_SYSTEMS = {
|
|
|
19
20
|
GB: 'UK'
|
|
20
21
|
};
|
|
21
22
|
|
|
22
|
-
async function googleShoppingFeed(axios, config, availableStores, country, isEditor) {
|
|
23
|
+
async function googleShoppingFeed(axios, config, availableStores, country, isEditor, params) {
|
|
24
|
+
const { allowSameDayDelivery } = params || {};
|
|
23
25
|
const { data } = await axios.get(`${config.LOCAL_API_URL}/feed/products?host=${config.HOST_NAME}&country=${country || ''}`);
|
|
24
26
|
const spliceFirstImage = images => (images || []).splice(0, 1)[0];
|
|
25
27
|
const getImages = images => (images || []).length > 0 ? images : null;
|
|
@@ -127,6 +129,10 @@ async function googleShoppingFeed(axios, config, availableStores, country, isEdi
|
|
|
127
129
|
info['g:shipping_label'] = product.country;
|
|
128
130
|
}
|
|
129
131
|
|
|
132
|
+
if (allowSameDayDelivery && product.sameDayDelivery) {
|
|
133
|
+
info['g:local_shipping_label'] = { _text: 'sameday' };
|
|
134
|
+
}
|
|
135
|
+
|
|
130
136
|
const productHighlight = `${product.feedProductHighlight || ''}`
|
|
131
137
|
.trim()
|
|
132
138
|
.split(/\n+/g)
|
package/package.json
CHANGED
package/pages/checkout/order.vue
CHANGED
|
@@ -3,10 +3,19 @@
|
|
|
3
3
|
:data-aos="aosFadeRight"
|
|
4
4
|
class="CheckoutOrderPage__wrapper">
|
|
5
5
|
<order>
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
<template #after-steps>
|
|
7
|
+
<div class="CheckoutOrderPage__pricing">
|
|
8
|
+
<btn
|
|
9
|
+
btn-class="black"
|
|
10
|
+
btn-label="EDIT CART"
|
|
11
|
+
:btn-block="true"
|
|
12
|
+
to="/checkout/cart" />
|
|
13
|
+
<cart-price-info
|
|
14
|
+
class="mt-10"
|
|
15
|
+
:disabled-rates="true"
|
|
16
|
+
@loaded="loadedPricing($event)" />
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
10
19
|
</order>
|
|
11
20
|
</div>
|
|
12
21
|
</template>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:data-aos="aosFadeRight"
|
|
4
|
+
class="CustomerCouponsPage__wrapper">
|
|
5
|
+
<customer-menu active-menu-item="coupons" />
|
|
6
|
+
<customer-coupons :customer="user" />
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
import { mapGetters } from 'vuex';
|
|
12
|
+
import metaInfo from '@lancom/shared/mixins/meta-info';
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
name: 'CustomerCouponsPage',
|
|
16
|
+
components: {
|
|
17
|
+
CustomerCoupons: () => import('@lancom/shared/components/customer/customer_coupons/customer-coupons'),
|
|
18
|
+
CustomerMenu: () => import('@lancom/shared/components/customer/customer_navigation_menu/customer-navigation-menu')
|
|
19
|
+
},
|
|
20
|
+
mixins: [metaInfo],
|
|
21
|
+
computed: {
|
|
22
|
+
...mapGetters('auth', ['user'])
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<style lang="scss" scoped>
|
|
28
|
+
@import "@/assets/scss/variables";
|
|
29
|
+
|
|
30
|
+
.CustomerCouponsPage {
|
|
31
|
+
&__wrapper {
|
|
32
|
+
margin: 50px auto;
|
|
33
|
+
width: 1100px;
|
|
34
|
+
@media (max-width: $bp-extra-small-max) {
|
|
35
|
+
width: auto;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
</style>
|