@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
package/assets/js/api/index.js
CHANGED
|
@@ -38,6 +38,9 @@ const api = {
|
|
|
38
38
|
fetchCustomerOrders(customer, shop) {
|
|
39
39
|
return _get(`shop/${shop}/customer/${customer._id}/orders`);
|
|
40
40
|
},
|
|
41
|
+
fetchCustomerCoupons(customer, shop) {
|
|
42
|
+
return _get(`shop/${shop}/customer/${customer._id}/coupons`);
|
|
43
|
+
},
|
|
41
44
|
searchProducts(shop, text, save) {
|
|
42
45
|
return _get(`shop/${shop}/products/search`, { text, save });
|
|
43
46
|
},
|
|
@@ -8,6 +8,7 @@ export default {
|
|
|
8
8
|
],
|
|
9
9
|
data() {
|
|
10
10
|
return {
|
|
11
|
+
visiblePickupError: false,
|
|
11
12
|
calculateCartPriceWithDebounce: debounce(this.calculateCartPrice, 300)
|
|
12
13
|
};
|
|
13
14
|
},
|
|
@@ -16,6 +17,7 @@ export default {
|
|
|
16
17
|
...mapGetters('auth', ['user']),
|
|
17
18
|
...mapGetters('cart', [
|
|
18
19
|
'needToPickup',
|
|
20
|
+
'needToPickupWithoutErrors',
|
|
19
21
|
'entities',
|
|
20
22
|
'cartPricing',
|
|
21
23
|
'simpleProducts',
|
|
@@ -26,22 +28,15 @@ export default {
|
|
|
26
28
|
'quantities',
|
|
27
29
|
'notValidProductsQuantities',
|
|
28
30
|
'notValidStockQuantities',
|
|
29
|
-
'notValidPrintsQuantities'
|
|
31
|
+
'notValidPrintsQuantities',
|
|
32
|
+
'notValidProductsPickup'
|
|
30
33
|
]),
|
|
31
|
-
wantsToPickup: {
|
|
32
|
-
get() {
|
|
33
|
-
return this.needToPickup;
|
|
34
|
-
},
|
|
35
|
-
set(needToPickup) {
|
|
36
|
-
if (needToPickup) {
|
|
37
|
-
this.setSuburb(null);
|
|
38
|
-
}
|
|
39
|
-
this.setNeedToPickup(needToPickup);
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
34
|
isNotValidQuantity() {
|
|
43
35
|
return this.isNotValidProductsQuantity || this.isNotValidStockQuantity || this.isNotValidPrintsQuantity || this.isNotValidPrintsBigSizeQuantity;
|
|
44
36
|
},
|
|
37
|
+
isNotValidShipping() {
|
|
38
|
+
return (this.needToPickup && this.notValidProductsPickup.length > 0) || !this.suburb;
|
|
39
|
+
},
|
|
45
40
|
isNotValidProductsQuantity() {
|
|
46
41
|
return this.notValidProductsQuantities.length > 0;
|
|
47
42
|
},
|
|
@@ -81,7 +76,7 @@ export default {
|
|
|
81
76
|
},
|
|
82
77
|
handleSuburbChange(suburb) {
|
|
83
78
|
this.setSuburb(suburb);
|
|
84
|
-
this.setNeedToPickup(false);
|
|
79
|
+
// this.setNeedToPickup(false);
|
|
85
80
|
this.calculateCartPrice({ shop: this.shop, country: this.country, currency: this.currency });
|
|
86
81
|
},
|
|
87
82
|
handleCouponChange(coupon) {
|
|
@@ -20,36 +20,13 @@
|
|
|
20
20
|
:btn-block="true"
|
|
21
21
|
@onclick="removeAllSimpleProducts" />
|
|
22
22
|
<div class="Cart__total-container">
|
|
23
|
+
<cart-shipping
|
|
24
|
+
class="mb-10"
|
|
25
|
+
@suburb="handleSuburbChange" />
|
|
23
26
|
<cart-price-info @loaded="loadedPricing($event)" />
|
|
24
27
|
</div>
|
|
25
28
|
<div class="Cart__postcode-container">
|
|
26
|
-
|
|
27
|
-
:suburb="suburb"
|
|
28
|
-
:labelless="true"
|
|
29
|
-
:only-postcode="onlyPostcode"
|
|
30
|
-
:placeholder="postcodeLabel"
|
|
31
|
-
:label-text="postcodeInfoLabel"
|
|
32
|
-
@select="handleSuburbChange" />
|
|
33
|
-
</div>
|
|
34
|
-
<div>
|
|
35
|
-
<div class="mt-20 mb-20">
|
|
36
|
-
<checkbox
|
|
37
|
-
v-model="wantsToPickup"
|
|
38
|
-
:disabled="hasNotValidProductsPickup"
|
|
39
|
-
:dark="true"
|
|
40
|
-
@change="recalculatePricing()">
|
|
41
|
-
<div class="ml-10 Cart__pickup-label">Wants to pickup</div>
|
|
42
|
-
</checkbox>
|
|
43
|
-
</div>
|
|
44
|
-
<div v-if="hasNotValidProductsPickup">
|
|
45
|
-
<ul class="Cart__pickup-errors">
|
|
46
|
-
<li
|
|
47
|
-
v-for="product in notValidProductsPickup"
|
|
48
|
-
:key="product._id">
|
|
49
|
-
Not Available for pickup <b>{{ product.name }}. {{ product.size ? product.size.shortName : '' }}</b> order quantity: {{ product.amount }}. Available {{ product.warehouseQuantityStock }}
|
|
50
|
-
</li>
|
|
51
|
-
</ul>
|
|
52
|
-
</div>
|
|
29
|
+
|
|
53
30
|
</div>
|
|
54
31
|
<div class="Cart__coupon-container">
|
|
55
32
|
<coupon-select
|
|
@@ -62,7 +39,7 @@
|
|
|
62
39
|
</div>
|
|
63
40
|
<div class="mt-10">
|
|
64
41
|
<btn
|
|
65
|
-
:btn-disabled="isNotValidQuantity || cartPricingError || cartPricingCalculating"
|
|
42
|
+
:btn-disabled="isNotValidShipping || isNotValidQuantity || cartPricingError || cartPricingCalculating"
|
|
66
43
|
:btn-block="true"
|
|
67
44
|
:to="'/checkout/order'"
|
|
68
45
|
btn-class="green"
|
|
@@ -93,13 +70,13 @@
|
|
|
93
70
|
<script>
|
|
94
71
|
import { mapGetters, mapMutations } from 'vuex';
|
|
95
72
|
import gtm from '@lancom/shared/assets/js/utils/gtm';
|
|
96
|
-
import PostcodeSelect from '@lancom/shared/components/common/postcode_select/postcode-select';
|
|
97
73
|
import CouponSelect from '@lancom/shared/components/common/coupon_select/coupon-select';
|
|
98
74
|
import CartQuantityErrors from '@lancom/shared/components/checkout/cart/cart_quantity_errors/cart-quantity-errors';
|
|
99
75
|
import CartEntity from '@lancom/shared/components/checkout/cart/cart_entity/cart-entity';
|
|
100
76
|
import { price } from '@lancom/shared/assets/js/utils/filters';
|
|
101
77
|
import CartMixin from '@lancom/shared/components/checkout/cart/cart.mixin';
|
|
102
78
|
import CartPriceInfo from '@lancom/shared/components/checkout/cart/cart_price_info/cart-price-info';
|
|
79
|
+
import CartShipping from '@lancom/shared/components/checkout/cart/cart_shipping/cart-shipping';
|
|
103
80
|
|
|
104
81
|
export default {
|
|
105
82
|
name: 'CheckoutCart',
|
|
@@ -107,26 +84,14 @@ export default {
|
|
|
107
84
|
CartEntity,
|
|
108
85
|
CartPriceInfo,
|
|
109
86
|
CartQuantityErrors,
|
|
110
|
-
|
|
111
|
-
|
|
87
|
+
CouponSelect,
|
|
88
|
+
CartShipping
|
|
112
89
|
},
|
|
113
90
|
filters: { price },
|
|
114
91
|
mixins: [CartMixin],
|
|
115
92
|
computed: {
|
|
116
93
|
...mapGetters(['MESSAGES', 'SETTINGS', 'currency', 'country']),
|
|
117
|
-
...mapGetters('cart', ['isEmpty',
|
|
118
|
-
hasNotValidProductsPickup() {
|
|
119
|
-
return this.notValidProductsPickup.length > 0;
|
|
120
|
-
},
|
|
121
|
-
onlyPostcode() {
|
|
122
|
-
return !!this.SETTINGS.CART_ONLY_POSTCODE && this.country?.isoCode === 'UK';
|
|
123
|
-
},
|
|
124
|
-
postcodeLabel() {
|
|
125
|
-
return this.onlyPostcode ? 'Postcode' : (this.MESSAGES.CART_POSTCODE || 'Postcode');
|
|
126
|
-
},
|
|
127
|
-
postcodeInfoLabel() {
|
|
128
|
-
return this.MESSAGES.CART_POSTCODE_INFO || 'Enter postcode to calculate shipping';
|
|
129
|
-
},
|
|
94
|
+
...mapGetters('cart', ['isEmpty','cartPricingError', 'cartPricing', 'cartPricingCalculating', 'entities']),
|
|
130
95
|
couponLabel() {
|
|
131
96
|
return (this.MESSAGES.CART_COUPON || 'Coupon code').trim();
|
|
132
97
|
},
|
|
@@ -7,4 +7,15 @@
|
|
|
7
7
|
color: $white;
|
|
8
8
|
background-color: $error;
|
|
9
9
|
}
|
|
10
|
+
&__pickup-label {
|
|
11
|
+
font-weight: 800;
|
|
12
|
+
font-size: 16px;
|
|
13
|
+
line-height: 22px;
|
|
14
|
+
text-transform: uppercase;
|
|
15
|
+
color: #303030;
|
|
16
|
+
}
|
|
17
|
+
&__pickup-errors {
|
|
18
|
+
color: $error;
|
|
19
|
+
font-size: 13px;
|
|
20
|
+
}
|
|
10
21
|
}
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
<slot name="cart-pricing" v-bind="{ cartPricing, itemsLabel }">
|
|
4
4
|
<cart-pricing
|
|
5
5
|
v-if="cartPricing && cartPricing.amount"
|
|
6
|
-
:pricing="cartPricing"
|
|
6
|
+
:pricing="cartPricing"
|
|
7
|
+
:disabled-rates="disabledRates" />
|
|
7
8
|
</slot>
|
|
8
9
|
<div
|
|
9
10
|
v-if="cartPricingError"
|
|
@@ -31,6 +32,10 @@ export default {
|
|
|
31
32
|
itemsLabel: {
|
|
32
33
|
type: String,
|
|
33
34
|
default: 'Tee'
|
|
35
|
+
},
|
|
36
|
+
disabledRates: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: false
|
|
34
39
|
}
|
|
35
40
|
},
|
|
36
41
|
data() {
|
|
@@ -40,7 +45,7 @@ export default {
|
|
|
40
45
|
};
|
|
41
46
|
},
|
|
42
47
|
computed: {
|
|
43
|
-
...mapGetters(['shop', 'country', 'currency']),
|
|
48
|
+
...mapGetters(['shop', 'country', 'currency', 'contacts']),
|
|
44
49
|
...mapGetters('cart', [
|
|
45
50
|
'entities',
|
|
46
51
|
'cartPricing',
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
.CartPricing {
|
|
4
4
|
&__wrapper {
|
|
5
5
|
border: 2px solid $gray;
|
|
6
|
-
padding: 28px 20px;
|
|
6
|
+
padding: 0px 20px 28px 20px;
|
|
7
7
|
@media (max-width: $bp-small-max) {
|
|
8
|
-
padding: 15px 10px;
|
|
8
|
+
padding: 0px 10px 15px 10px;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
@media (max-width: $bp-small-max) {
|
|
12
12
|
.lc_h3 {
|
|
13
|
-
font-size:
|
|
13
|
+
font-size: 16px;
|
|
14
14
|
}
|
|
15
15
|
.lc_body-large {
|
|
16
16
|
font-size: 14px;
|
|
@@ -20,6 +20,14 @@
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
+
&__header {
|
|
24
|
+
padding: 10px;
|
|
25
|
+
background-color: $gray;
|
|
26
|
+
margin: 0 -20px;
|
|
27
|
+
@media (max-width: $bp-small-max) {
|
|
28
|
+
margin: 0 -10px;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
23
31
|
&__info {
|
|
24
32
|
padding: 11px;
|
|
25
33
|
display: flex;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="CartPricing__wrapper">
|
|
3
|
-
<div class="
|
|
3
|
+
<div class="lc_h4 lc_uppercase lc_black CartPricing__header">
|
|
4
4
|
Order summary
|
|
5
5
|
</div>
|
|
6
6
|
<div class="CartPricing__info">
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
{{ pricing.products.totalPriceWithoutTax | price(currency) }}
|
|
28
28
|
</div>
|
|
29
29
|
</div>
|
|
30
|
-
<cart-shipments-pricing />
|
|
30
|
+
<cart-shipments-pricing :disabled-rates="disabledRates" />
|
|
31
31
|
<div class="CartPricing__info">
|
|
32
32
|
<div class="lc_body-large lc_gray-main">
|
|
33
33
|
Total Delivery:
|
|
@@ -90,6 +90,10 @@ export default {
|
|
|
90
90
|
type: Object,
|
|
91
91
|
required: true
|
|
92
92
|
},
|
|
93
|
+
disabledRates: {
|
|
94
|
+
type: Boolean,
|
|
95
|
+
default: false
|
|
96
|
+
},
|
|
93
97
|
itemsLabel: {
|
|
94
98
|
type: String,
|
|
95
99
|
default: 'Tee'
|
|
@@ -15,7 +15,11 @@
|
|
|
15
15
|
class="CartShipmentsPricing__supplier">
|
|
16
16
|
<div class="CartShipmentsPricing__supplier-info">
|
|
17
17
|
<div class="CartShipmentsPricing__supplier-brands">
|
|
18
|
-
<div
|
|
18
|
+
<div
|
|
19
|
+
:class="{
|
|
20
|
+
'CartShipmentsPricing__supplier-info--disabled': disabledRates
|
|
21
|
+
}"
|
|
22
|
+
@click="removeSupplierConfirm(supplier)">
|
|
19
23
|
<i class="icon-delete"></i>
|
|
20
24
|
</div>
|
|
21
25
|
<div>
|
|
@@ -31,9 +35,9 @@
|
|
|
31
35
|
:key="`rate-${i}`"
|
|
32
36
|
class="CartShipmentsPricing__rate"
|
|
33
37
|
:class="{
|
|
34
|
-
'CartShipmentsPricing__rate--disabled': rate.disabled
|
|
38
|
+
'CartShipmentsPricing__rate--disabled': disabledRates || rate.disabled
|
|
35
39
|
}"
|
|
36
|
-
@click="selectRate({ supplier, rate, shop, country, currency })">
|
|
40
|
+
@click="!rate.selected && selectRate({ supplier, rate, shop, country, currency })">
|
|
37
41
|
<div class="CartShipmentsPricing__rate-info">
|
|
38
42
|
<div class="CartShipmentsPricing__rate-icon">
|
|
39
43
|
<checked-icon :checked="rate.selected" />
|
|
@@ -76,6 +80,12 @@ export default {
|
|
|
76
80
|
}
|
|
77
81
|
},
|
|
78
82
|
mixins: [confirm],
|
|
83
|
+
props: {
|
|
84
|
+
disabledRates: {
|
|
85
|
+
type: Boolean,
|
|
86
|
+
default: false
|
|
87
|
+
}
|
|
88
|
+
},
|
|
79
89
|
computed: {
|
|
80
90
|
...mapGetters(['shop', 'country', 'currency']),
|
|
81
91
|
...mapGetters('cart', [
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
@import '@/assets/scss/variables';
|
|
2
|
+
|
|
3
|
+
.CartShipping {
|
|
4
|
+
&__wrapper {
|
|
5
|
+
border: 2px solid $gray;
|
|
6
|
+
padding: 0px 20px 20px 20px;
|
|
7
|
+
@media (max-width: $bp-small-max) {
|
|
8
|
+
padding: 0px 10px 15px 10px;
|
|
9
|
+
}
|
|
10
|
+
@media (max-width: $bp-small-max) {
|
|
11
|
+
.lc_h3 {
|
|
12
|
+
font-size: 16px;
|
|
13
|
+
}
|
|
14
|
+
.lc_body-large {
|
|
15
|
+
font-size: 14px;
|
|
16
|
+
}
|
|
17
|
+
.lc_title-large {
|
|
18
|
+
font-size: 16px;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
::v-deep {
|
|
22
|
+
.form-label {
|
|
23
|
+
font-size: 15px !important;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
&--warning {
|
|
27
|
+
border-color: $error;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
&__header {
|
|
31
|
+
padding: 10px;
|
|
32
|
+
background-color: $gray;
|
|
33
|
+
margin: 0 -20px;
|
|
34
|
+
@media (max-width: $bp-small-max) {
|
|
35
|
+
margin: 0 -10px;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
&__pickup-errors {
|
|
39
|
+
color: $error;
|
|
40
|
+
font-size: 13px;
|
|
41
|
+
line-height: 17px;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="CartShipping__wrapper"
|
|
4
|
+
:class="{
|
|
5
|
+
'CartShipping__wrapper--warning': (needToPickup && hasNotValidProductsPickup) || !suburb
|
|
6
|
+
}">
|
|
7
|
+
<div class="lc_h4 lc_uppercase lc_black CartShipping__header">
|
|
8
|
+
Order Shipping
|
|
9
|
+
</div>
|
|
10
|
+
<div class="mt-10">
|
|
11
|
+
<postcode-select
|
|
12
|
+
:suburb="suburb"
|
|
13
|
+
:labelless="true"
|
|
14
|
+
:only-postcode="onlyPostcode"
|
|
15
|
+
:placeholder="postcodeLabel"
|
|
16
|
+
:label-text="postcodeInfoLabel"
|
|
17
|
+
:allow-empty="true"
|
|
18
|
+
@select="$emit('suburb', $event)" />
|
|
19
|
+
<div class="mt-10 mb-10">
|
|
20
|
+
<checkbox
|
|
21
|
+
v-model="wantsToPickup"
|
|
22
|
+
:dark="true"
|
|
23
|
+
@change="calculatePrice()">
|
|
24
|
+
<div class="ml-10 CartPriceInfo__pickup-label">
|
|
25
|
+
{{ contacts.warehousePickupInfo ? `Pickup from ${contacts.warehousePickupInfo}` : 'Wants to pickup' }}
|
|
26
|
+
</div>
|
|
27
|
+
</checkbox>
|
|
28
|
+
</div>
|
|
29
|
+
<div
|
|
30
|
+
v-if="visiblePickupError && hasNotValidProductsPickup"
|
|
31
|
+
class="CartShipping__pickup-errors">
|
|
32
|
+
<div>Not all items in cart are available for pickup. Some items are available for delivery only</div>
|
|
33
|
+
<ul>
|
|
34
|
+
<li
|
|
35
|
+
v-for="product in notValidProductsPickup"
|
|
36
|
+
:key="product._id">
|
|
37
|
+
<b>{{ product.name }}. {{ product.size ? product.size.shortName : '' }}</b> order quantity: {{ product.amount }}. Available {{ product.warehouseQuantityStock }}
|
|
38
|
+
</li>
|
|
39
|
+
</ul>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
44
|
+
|
|
45
|
+
<script>
|
|
46
|
+
import { mapGetters, createNamespacedHelpers } from 'vuex';
|
|
47
|
+
import PostcodeSelect from '@lancom/shared/components/common/postcode_select/postcode-select';
|
|
48
|
+
import { price } from '@lancom/shared/assets/js/utils/filters';
|
|
49
|
+
|
|
50
|
+
const { mapActions, mapMutations } = createNamespacedHelpers('cart');
|
|
51
|
+
|
|
52
|
+
export default {
|
|
53
|
+
name: 'LancomCartShipping',
|
|
54
|
+
filters: { price },
|
|
55
|
+
components: {
|
|
56
|
+
PostcodeSelect
|
|
57
|
+
},
|
|
58
|
+
props: {
|
|
59
|
+
itemsLabel: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: 'Tee'
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
data() {
|
|
65
|
+
return {
|
|
66
|
+
visiblePickupError: null,
|
|
67
|
+
price: null
|
|
68
|
+
};
|
|
69
|
+
},
|
|
70
|
+
computed: {
|
|
71
|
+
...mapGetters(['shop', 'SETTINGS', 'MESSAGES', 'country', 'currency', 'contacts']),
|
|
72
|
+
...mapGetters('cart', [
|
|
73
|
+
'suburb',
|
|
74
|
+
'notValidProductsPickup',
|
|
75
|
+
'needToPickup',
|
|
76
|
+
'needToPickupWithoutErrors',
|
|
77
|
+
'cartPricing',
|
|
78
|
+
'cartPricingError'
|
|
79
|
+
]),
|
|
80
|
+
postcodeInfoLabel() {
|
|
81
|
+
return this.MESSAGES.CART_POSTCODE_INFO || 'Enter postcode to calculate shipping';
|
|
82
|
+
},
|
|
83
|
+
onlyPostcode() {
|
|
84
|
+
return !!this.SETTINGS.CART_ONLY_POSTCODE && this.country?.isoCode === 'UK';
|
|
85
|
+
},
|
|
86
|
+
postcodeLabel() {
|
|
87
|
+
return this.onlyPostcode ? 'Postcode' : (this.MESSAGES.CART_POSTCODE || 'Postcode');
|
|
88
|
+
},
|
|
89
|
+
hasNotValidProductsPickup() {
|
|
90
|
+
return this.notValidProductsPickup.length > 0;
|
|
91
|
+
},
|
|
92
|
+
wantsToPickup: {
|
|
93
|
+
get() {
|
|
94
|
+
return this.needToPickup;
|
|
95
|
+
},
|
|
96
|
+
set(needToPickup) {
|
|
97
|
+
if (needToPickup && this.hasNotValidProductsPickup) {
|
|
98
|
+
this.visiblePickupError = true;
|
|
99
|
+
} else {
|
|
100
|
+
// if (needToPickup) {
|
|
101
|
+
// this.setSuburb(null);
|
|
102
|
+
// }
|
|
103
|
+
this.setNeedToPickup(needToPickup);
|
|
104
|
+
this.visiblePickupError = false;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
methods: {
|
|
110
|
+
...mapMutations([
|
|
111
|
+
'setSuburb',
|
|
112
|
+
'setNeedToPickup'
|
|
113
|
+
]),
|
|
114
|
+
...mapActions([
|
|
115
|
+
'calculateCartPrice'
|
|
116
|
+
]),
|
|
117
|
+
async calculatePrice() {
|
|
118
|
+
await this.calculateCartPrice({ shop: this.shop, country: this.country, currency: this.currency });
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
</script>
|
|
123
|
+
|
|
124
|
+
<style lang="scss" scoped>
|
|
125
|
+
@import 'cart-shipping.scss';
|
|
126
|
+
</style>
|
|
@@ -160,6 +160,7 @@
|
|
|
160
160
|
<postcode-select
|
|
161
161
|
class="form-col col-half"
|
|
162
162
|
:suburb="address.suburb"
|
|
163
|
+
:disabled="disabledPostcode"
|
|
163
164
|
:labelless="true"
|
|
164
165
|
:required="true"
|
|
165
166
|
:name-prefix="namePrefix"
|
|
@@ -244,6 +245,10 @@ export default {
|
|
|
244
245
|
type: Boolean,
|
|
245
246
|
default: false
|
|
246
247
|
},
|
|
248
|
+
disabledPostcode: {
|
|
249
|
+
type: Boolean,
|
|
250
|
+
default: false
|
|
251
|
+
},
|
|
247
252
|
namePrefix: {
|
|
248
253
|
type: String,
|
|
249
254
|
default: ''
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="OrderBillingInformation__wrapper">
|
|
3
3
|
<div class="lc_h3 lc_uppercase lc_bold">
|
|
4
|
-
{{
|
|
4
|
+
{{ needToPickupWithoutErrors ? 'Contact Info' : 'Delivery Address' }}
|
|
5
5
|
</div>
|
|
6
6
|
<div class="OrderBillingInformation__form">
|
|
7
7
|
<validation-observer
|
|
@@ -10,10 +10,11 @@
|
|
|
10
10
|
<div class="OrderBillingInformation__content">
|
|
11
11
|
<address-form
|
|
12
12
|
:address="order.shippingAddress"
|
|
13
|
-
:only-contact-info="
|
|
13
|
+
:only-contact-info="needToPickupWithoutErrors"
|
|
14
|
+
:disabled-postcode="true"
|
|
14
15
|
:without-additional-info="true" />
|
|
15
16
|
<div
|
|
16
|
-
v-if="!
|
|
17
|
+
v-if="!needToPickupWithoutErrors"
|
|
17
18
|
class="mt-20 mb-20">
|
|
18
19
|
<checkbox
|
|
19
20
|
v-model="copyToBillingAddress"
|
|
@@ -78,7 +79,7 @@ export default {
|
|
|
78
79
|
...mapGetters(['currency'])
|
|
79
80
|
},
|
|
80
81
|
mounted() {
|
|
81
|
-
if (this.
|
|
82
|
+
if (this.needToPickupWithoutErrors) {
|
|
82
83
|
this.copyToBillingAddress = false;
|
|
83
84
|
}
|
|
84
85
|
},
|
|
@@ -86,7 +87,7 @@ export default {
|
|
|
86
87
|
async submit() {
|
|
87
88
|
this.isSubmit = true;
|
|
88
89
|
|
|
89
|
-
const isValid = await this.$refs.form.validate() && (!!this.order.shippingAddress.postcode || this.
|
|
90
|
+
const isValid = await this.$refs.form.validate() && (!!this.order.shippingAddress.postcode || this.needToPickupWithoutErrors);
|
|
90
91
|
if (!isValid) {
|
|
91
92
|
return;
|
|
92
93
|
}
|
|
@@ -34,6 +34,14 @@
|
|
|
34
34
|
Google Pay
|
|
35
35
|
</span>
|
|
36
36
|
</label>
|
|
37
|
+
<label
|
|
38
|
+
class="form-label OrderPaymentInformation__checkbox"
|
|
39
|
+
@click="updatePaymentType('apple')">
|
|
40
|
+
<checked-icon :checked="paymentMethod === 'apple'" />
|
|
41
|
+
<span class="lc_regular12 lc__grey1 OrderPaymentInformation__checkbox-label">
|
|
42
|
+
Apple Pay
|
|
43
|
+
</span>
|
|
44
|
+
</label>
|
|
37
45
|
</div>
|
|
38
46
|
<div
|
|
39
47
|
v-if="paymentMethod === 'deposit'"
|
|
@@ -71,6 +79,7 @@
|
|
|
71
79
|
ref="paymentCart"
|
|
72
80
|
:key="paymentMethod"
|
|
73
81
|
:google="paymentMethod === 'google'"
|
|
82
|
+
:apple="paymentMethod === 'apple'"
|
|
74
83
|
:amount="cartPricing.totalPrice"
|
|
75
84
|
:order="orderData"
|
|
76
85
|
@inited="initedCard">
|
|
@@ -17,6 +17,7 @@ import { mapGetters } from 'vuex';
|
|
|
17
17
|
export default {
|
|
18
18
|
name: 'PaymentCard',
|
|
19
19
|
components: {
|
|
20
|
+
Applepay: () => import('./applepay/applepay'),
|
|
20
21
|
Googlepay: () => import('./googlepay/googlepay'),
|
|
21
22
|
Pinpayment: () => import('./pinpayment/pinpayment'),
|
|
22
23
|
Stripe: () => import('./stripe_card/stripe-card'),
|
|
@@ -32,6 +33,9 @@ export default {
|
|
|
32
33
|
},
|
|
33
34
|
google: {
|
|
34
35
|
type: Boolean
|
|
36
|
+
},
|
|
37
|
+
apple: {
|
|
38
|
+
type: Boolean
|
|
35
39
|
}
|
|
36
40
|
},
|
|
37
41
|
computed: {
|
|
@@ -40,6 +44,9 @@ export default {
|
|
|
40
44
|
if (this.google) {
|
|
41
45
|
return 'googlepay';
|
|
42
46
|
}
|
|
47
|
+
if (this.apple) {
|
|
48
|
+
return 'applepay';
|
|
49
|
+
}
|
|
43
50
|
return this.payment?.type || 'stripe-payment';
|
|
44
51
|
}
|
|
45
52
|
},
|