@lancom/shared 0.0.280 → 0.0.281
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/admin.js +3 -0
- package/assets/js/api/index.js +5 -2
- package/assets/js/models/print-area.js +5 -3
- package/assets/js/utils/colors.js +1 -1
- package/assets/js/utils/fabric-helper.js +1 -1
- package/assets/js/utils/filters.js +2 -2
- package/assets/scss/_common.scss +10 -0
- package/components/asides/contact_us/contact-us.vue +9 -2
- package/components/asides/menu/menu.vue +1 -25
- package/components/checkout/cart/cart.mixin.js +3 -3
- package/components/checkout/cart/cart.scss +8 -109
- package/components/checkout/cart/cart.vue +84 -46
- package/components/checkout/cart/cart_entity/cart_entity_color_simple_products/cart_entity_color_simple_product/cart-entity-color-simple-product.vue +7 -4
- package/components/checkout/cart/cart_price_info/cart-price-info.vue +4 -5
- package/components/checkout/cart/cart_pricing/cart-pricing.scss +34 -0
- package/components/checkout/cart/cart_pricing/cart-pricing.vue +112 -0
- package/components/checkout/cart/cart_shipments_pricing/cart-shipments-pricing.vue +2 -2
- package/components/checkout/order/address-form/address-form.scss +16 -0
- package/components/checkout/order/address-form/address-form.vue +199 -91
- package/components/checkout/order/order-billing-information/order-billing-information.scss +1 -1
- package/components/checkout/order/order-payment-information/order-payment-information.vue +15 -5
- package/components/checkout/order/order.vue +2 -1
- package/components/common/client_settings/client-settings.scss +6 -0
- package/components/common/client_settings/client-settings.vue +9 -1
- package/components/common/payment/payment_card/stripe/stripe.vue +1 -0
- package/components/common/payment/payment_success/payment-success.vue +8 -1
- package/components/common/postcode_select/postcode-select.vue +22 -12
- package/components/common/price.vue +1 -1
- package/components/common/pricing_table/pricing-table.vue +3 -2
- package/components/common/tabs.vue +17 -8
- package/components/editor/editor.scss +6 -0
- package/components/editor/editor.vue +22 -19
- package/components/editor/editor_layers/editor-layers.vue +3 -2
- package/components/editor/editor_print_area_options/editor-print-area-options.vue +2 -0
- package/components/editor/editor_product_details/editor-product-details.scss +8 -2
- package/components/editor/editor_product_details/editor-product-details.vue +22 -25
- package/components/editor/editor_wizard/editor-wizard.vue +2 -1
- package/components/editor/editor_workspace/editor-workspace.vue +3 -2
- package/components/modals/cart_modal/cart-modal.vue +1 -1
- package/components/modals/order_modal/order-modal.vue +6 -0
- package/components/modals/payment_modal/payment-modal.vue +4 -3
- package/components/order/order_payment/order-payment.vue +6 -6
- package/components/product/editor_pricing/editor-pricing.scss +75 -0
- package/components/product/editor_pricing/editor-pricing.vue +228 -0
- package/components/product/editor_pricing/editor_pricing_details/editor-pricing-details.scss +0 -0
- package/components/product/editor_pricing/editor_pricing_details/editor-pricing-details.vue +29 -0
- package/components/product/editor_pricing/editor_pricing_details/editor_pricing_details_prints/editor-pricing-details-prints.scss +41 -0
- package/components/product/editor_pricing/editor_pricing_details/editor_pricing_details_prints/editor-pricing-details-prints.vue +118 -0
- package/components/product/editor_pricing/editor_pricing_details/editor_pricing_details_products/editor-pricing-details-products.scss +41 -0
- package/components/product/editor_pricing/editor_pricing_details/editor_pricing_details_products/editor-pricing-details-products.vue +102 -0
- package/components/product/product.vue +1 -1
- package/components/product/product_colors_selector/product-colors-selector.scss +117 -0
- package/components/product/product_colors_selector/product-colors-selector.vue +188 -0
- package/components/product/product_multipacks_carousel/product-multipacks-carousel.vue +3 -1
- package/components/product/product_size_selector/product_size_selector_color/product_size_selector_color_cell/product-size-selector-color-cell.vue +4 -5
- package/components/product/products_size_selector_color/product_size_selector_color/product-size-selector-color.scss +58 -0
- package/components/product/products_size_selector_color/product_size_selector_color/product-size-selector-color.vue +128 -0
- package/components/product/products_size_selector_color/products-size-selector-color.scss +12 -0
- package/components/product/products_size_selector_color/products-size-selector-color.vue +43 -0
- package/components/product/wizard/wizard_print_layers/wizard_print_layer/wizard-print-layer.vue +2 -1
- package/components/product/wizard/wizard_print_size/wizard_print_area_print_size/wizard-print-area-print-size.vue +2 -1
- package/components/product/wizard/wizard_print_type/wizard_print_area_print_type/wizard-print-area-print-type.vue +2 -1
- package/components/products/product_list/product-list.scss +2 -2
- package/components/products/product_list_product/product-list-product.scss +7 -11
- package/components/products/product_list_product/product-list-product.vue +7 -15
- package/components/the_aside/the-aside.vue +1 -0
- package/feeds/google-shopping.js +4 -4
- package/layouts/error.vue +39 -0
- package/layouts/products.vue +386 -0
- package/mixins/payment.js +2 -1
- package/mixins/product-preview.js +1 -1
- package/mixins/product-view.js +313 -0
- package/nuxt.config.js +0 -5
- package/package.json +1 -1
- package/pages/checkout/cart.vue +40 -0
- package/pages/checkout/order.vue +72 -0
- package/pages/customer/create.vue +33 -0
- package/pages/customer/password/_token.vue +79 -0
- package/pages/customer/recovery.vue +33 -0
- package/pages/customer/settings.vue +33 -0
- package/pages/customer/signin.vue +33 -0
- package/routes/index.js +35 -0
- package/store/cart.js +11 -6
- package/store/order.js +2 -2
- package/store/product.js +0 -6
package/assets/js/api/admin.js
CHANGED
|
@@ -717,6 +717,9 @@ export default {
|
|
|
717
717
|
removeEmailTemplate(id) {
|
|
718
718
|
return _delete(`admin/email-templates/${id}`);
|
|
719
719
|
},
|
|
720
|
+
copyEmailTemplatesToShop(data) {
|
|
721
|
+
return _post(`admin/email-templates/copy-to-shop`, data);
|
|
722
|
+
},
|
|
720
723
|
fetchPrinters(type) {
|
|
721
724
|
return _get('admin/printers', { type });
|
|
722
725
|
},
|
package/assets/js/api/index.js
CHANGED
|
@@ -95,9 +95,9 @@ const api = {
|
|
|
95
95
|
fetchOrderByToken(token, params) {
|
|
96
96
|
return _get(`order/token/${token}`, params);
|
|
97
97
|
},
|
|
98
|
-
createOrderPayment(id, { card, shop, country, invoice, payment, recaptchaToken }) {
|
|
98
|
+
createOrderPayment(id, { card, shop, country, currency, invoice, payment, recaptchaToken }) {
|
|
99
99
|
const url = invoice ? `shop/${shop}/order/${id}/invoice/${invoice}/payment` : `shop/${shop}/order/${id}/payment`;
|
|
100
|
-
return _post(url, { card, country, payment, recaptchaToken });
|
|
100
|
+
return _post(url, { card, country, payment, currency, recaptchaToken });
|
|
101
101
|
},
|
|
102
102
|
addOrderTimeline(id, item) {
|
|
103
103
|
return _post(`order/${id}/timeline`, item);
|
|
@@ -157,6 +157,9 @@ const api = {
|
|
|
157
157
|
fetchSuburbs(params) {
|
|
158
158
|
return _get('postcodes', params);
|
|
159
159
|
},
|
|
160
|
+
fetchAddressInfo(id) {
|
|
161
|
+
return _get(`postcodes/address/${id}`);
|
|
162
|
+
},
|
|
160
163
|
fetchProductPrintTemplates() {
|
|
161
164
|
return _get('print-templates');
|
|
162
165
|
},
|
|
@@ -42,11 +42,13 @@ export const getProductPrintsAreasPrices = (product, printType) => {
|
|
|
42
42
|
return areas;
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
export const getPrintAreaByName = (
|
|
45
|
+
export const getPrintAreaByName = (params, product) => {
|
|
46
|
+
const { printArea, editorWidth, editorHeight, printSize, printAreaOffsets } = params;
|
|
46
47
|
const printAreas = getProductPrintAreas(product);
|
|
47
48
|
const pa = printAreas[printArea] || DEFAULT_PRINT_AREA;
|
|
48
|
-
const
|
|
49
|
-
const
|
|
49
|
+
const productPrintArea = product.printAreasOffsets?.find(p => p.printAreas?.includes(printArea) && (!p.printSize || p.printSize === printSize?._id));
|
|
50
|
+
const size = productPrintArea?.printAreaSize || printSize || pa.printSize;
|
|
51
|
+
const offsets = productPrintArea?.printAreaOffsets || printAreaOffsets || pa.printAreaOffsets;
|
|
50
52
|
const pxPerCm = (editorWidth * product.productToImageRatio) / (product.productWidthInCm || 60);
|
|
51
53
|
const widthCm = size ? size.width : DEFAULT_PRINT_SIZE_CM;
|
|
52
54
|
const heightCm = size ? size.height : DEFAULT_PRINT_SIZE_CM;
|
|
@@ -7,7 +7,7 @@ export const isValidImageType = (i, type) => i.type === type || (i.types || []).
|
|
|
7
7
|
export const isValidImageTypes = (i, types) => types.some(type => isValidImageType(i, type));
|
|
8
8
|
|
|
9
9
|
export const getColorImage = (product = {}, size = 'small', type, color, allowAnyColor = false) => {
|
|
10
|
-
const colorImage = color && (product.images || []).find(i => isValidImageType(i, type || COLORS_IMAGES_TYPES.FRONT) && color._id === i.color);
|
|
10
|
+
const colorImage = color && (product.images || []).find(i => isValidImageType(i, type || COLORS_IMAGES_TYPES.FRONT) && (color._id === i.color || color._id === i.color._id));
|
|
11
11
|
const image = colorImage || (product.images || []).find(i => isValidImageType(i, type || COLORS_IMAGES_TYPES.FRONT) && (allowAnyColor || !i.color));
|
|
12
12
|
return image && staticLink(image[size]);
|
|
13
13
|
};
|
|
@@ -191,7 +191,7 @@ export default class FabricHelper {
|
|
|
191
191
|
}
|
|
192
192
|
|
|
193
193
|
createObject({ layer, active }) {
|
|
194
|
-
const initial =
|
|
194
|
+
const initial = !layer.modifiedAt;
|
|
195
195
|
return new Promise(resolve => {
|
|
196
196
|
const methods = {
|
|
197
197
|
text: 'createTextObject',
|
|
@@ -51,10 +51,10 @@ export const sizesRange = (sizes = []) => {
|
|
|
51
51
|
return isDiffSizes ? `${first.shortName} - ${last.shortName}` : first && first.shortName;
|
|
52
52
|
};
|
|
53
53
|
|
|
54
|
-
export const pricingRange = pricing => {
|
|
54
|
+
export const pricingRange = (pricing, currency) => {
|
|
55
55
|
const calcPrice = (prev, current, calc) => typeof prev === 'number' ? calc(prev, current) : current;
|
|
56
56
|
const [min, max] = (pricing || []).reduce(([min, max], { price }) => [calcPrice(min, price, Math.min), calcPrice(max, price, Math.max)], []);
|
|
57
|
-
return min !== max ? `${price(min)} - ${price(max)}` : price(min);
|
|
57
|
+
return min !== max ? `${price(min, currency)} - ${price(max, currency)}` : price(min, currency);
|
|
58
58
|
};
|
|
59
59
|
|
|
60
60
|
export const print = type => printsLabels[type];
|
package/assets/scss/_common.scss
CHANGED
|
@@ -136,6 +136,16 @@ body {
|
|
|
136
136
|
display: none !important;
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
|
+
.hidden-md-and-down {
|
|
140
|
+
@media (max-width: $bp-medium-max) {
|
|
141
|
+
display: none !important;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
.hidden-lg-and-down {
|
|
145
|
+
@media (max-width: $bp-large-max) {
|
|
146
|
+
display: none !important;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
139
149
|
b {
|
|
140
150
|
font-weight: bold;
|
|
141
151
|
}
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
v-slot="{ errors }"
|
|
71
71
|
tag="div"
|
|
72
72
|
name="Phone"
|
|
73
|
-
rules="
|
|
73
|
+
:rules="phoneRules"
|
|
74
74
|
class="form-row">
|
|
75
75
|
<input
|
|
76
76
|
id="phone"
|
|
@@ -178,6 +178,10 @@ export default {
|
|
|
178
178
|
btnClass: {
|
|
179
179
|
type: String,
|
|
180
180
|
default: 'purple'
|
|
181
|
+
},
|
|
182
|
+
requiredPhone: {
|
|
183
|
+
type: Boolean,
|
|
184
|
+
default: true
|
|
181
185
|
}
|
|
182
186
|
},
|
|
183
187
|
data() {
|
|
@@ -187,7 +191,10 @@ export default {
|
|
|
187
191
|
};
|
|
188
192
|
},
|
|
189
193
|
computed: {
|
|
190
|
-
...mapGetters(['contacts', 'shop'])
|
|
194
|
+
...mapGetters(['contacts', 'shop']),
|
|
195
|
+
phoneRules() {
|
|
196
|
+
return this.requiredPhone ? 'required|phone' : 'phone';
|
|
197
|
+
}
|
|
191
198
|
},
|
|
192
199
|
// mounted() {
|
|
193
200
|
// this.preloadReCaptcha();
|
|
@@ -1,30 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="Menu__wrapper">
|
|
3
|
-
|
|
4
|
-
class="Menu__item"
|
|
5
|
-
@click="goTo('/')">
|
|
6
|
-
Editor
|
|
7
|
-
</div>
|
|
8
|
-
<div
|
|
9
|
-
class="Menu__item"
|
|
10
|
-
@click="goTo('/products')">
|
|
11
|
-
Products
|
|
12
|
-
</div>
|
|
13
|
-
<div
|
|
14
|
-
class="Menu__item"
|
|
15
|
-
@click="goTo('/pricing')">
|
|
16
|
-
Pricing
|
|
17
|
-
</div>
|
|
18
|
-
<div
|
|
19
|
-
class="Menu__item"
|
|
20
|
-
@click="goTo('/news')">
|
|
21
|
-
News
|
|
22
|
-
</div>
|
|
23
|
-
<div
|
|
24
|
-
class="Menu__item"
|
|
25
|
-
@click="goTo('/faq')">
|
|
26
|
-
FAQ
|
|
27
|
-
</div>
|
|
3
|
+
|
|
28
4
|
</div>
|
|
29
5
|
</template>
|
|
30
6
|
|
|
@@ -12,7 +12,7 @@ export default {
|
|
|
12
12
|
};
|
|
13
13
|
},
|
|
14
14
|
computed: {
|
|
15
|
-
...mapGetters(['shop', 'country']),
|
|
15
|
+
...mapGetters(['shop', 'country', 'currency']),
|
|
16
16
|
...mapGetters('auth', ['user']),
|
|
17
17
|
...mapGetters('cart', [
|
|
18
18
|
'entities',
|
|
@@ -75,7 +75,7 @@ export default {
|
|
|
75
75
|
const message = 'This will delete all items in this row, Press OK to continue or Cancel';
|
|
76
76
|
const confirmed = await this.showConfirmationModal(message);
|
|
77
77
|
if (confirmed) {
|
|
78
|
-
const data = { simpleProducts, shop: this.shop };
|
|
78
|
+
const data = { simpleProducts, shop: this.shop, currency: this.currency };
|
|
79
79
|
this.removeSimpleProductsFromCart(data);
|
|
80
80
|
}
|
|
81
81
|
},
|
|
@@ -83,7 +83,7 @@ export default {
|
|
|
83
83
|
const message = 'This will delete all items in cart, Press OK to continue or Cancel';
|
|
84
84
|
const confirmed = await this.showConfirmationModal(message);
|
|
85
85
|
if (confirmed) {
|
|
86
|
-
const data = { simpleProducts: this.simpleProducts, shop: this.shop };
|
|
86
|
+
const data = { simpleProducts: this.simpleProducts, shop: this.shop, currency: this.currency };
|
|
87
87
|
this.removeSimpleProductsFromCart(data);
|
|
88
88
|
}
|
|
89
89
|
}
|
|
@@ -1,115 +1,14 @@
|
|
|
1
1
|
@import '@/assets/scss/variables';
|
|
2
2
|
|
|
3
3
|
.Cart {
|
|
4
|
-
&__total {
|
|
5
|
-
|
|
6
|
-
background-color: $primary_100;
|
|
7
|
-
&-container {
|
|
8
|
-
display: flex;
|
|
9
|
-
align-items: flex-end;
|
|
10
|
-
justify-content: flex-end;
|
|
11
|
-
flex-direction: column;
|
|
12
|
-
margin-top: 50px;
|
|
13
|
-
}
|
|
4
|
+
&__total-container {
|
|
5
|
+
margin-top: 20px;
|
|
14
6
|
}
|
|
15
|
-
&__postcode {
|
|
16
|
-
|
|
17
|
-
margin-top: 30px;
|
|
18
|
-
}
|
|
19
|
-
&-prompt {
|
|
20
|
-
padding-bottom: 10px;
|
|
21
|
-
&-icon {
|
|
22
|
-
font-size: 14px;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
&__quantity-errors {
|
|
27
|
-
margin-top: 10px;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.ProductColorsSelector {
|
|
32
|
-
&__wrapper {
|
|
33
|
-
margin-top: 35px;
|
|
34
|
-
}
|
|
35
|
-
&__controls {
|
|
36
|
-
display: flex;
|
|
37
|
-
}
|
|
38
|
-
&__add-btn {
|
|
39
|
-
flex-grow: 1;
|
|
40
|
-
.Btn__wrapper {
|
|
41
|
-
width: 100%;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
&__head {
|
|
45
|
-
height: 50px;
|
|
46
|
-
flex-grow: 2;
|
|
47
|
-
background: $gray;
|
|
48
|
-
display: flex;
|
|
49
|
-
align-items: center;
|
|
50
|
-
justify-content: space-between;
|
|
51
|
-
padding: 0 20px;
|
|
52
|
-
font-weight: bold;
|
|
53
|
-
font-size: 16px;
|
|
54
|
-
line-height: 22px;
|
|
55
|
-
text-transform: uppercase;
|
|
56
|
-
color: $black;
|
|
57
|
-
cursor: pointer;
|
|
58
|
-
|
|
59
|
-
i {
|
|
60
|
-
&:before {
|
|
61
|
-
transform: rotate(180deg);
|
|
62
|
-
transition: transform .22s ease-in-out;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
&--opened {
|
|
66
|
-
i {
|
|
67
|
-
&:before {
|
|
68
|
-
transform: rotate(0);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
&__section {
|
|
74
|
-
margin-top: 24px;
|
|
75
|
-
}
|
|
76
|
-
&__option {
|
|
77
|
-
display: flex;
|
|
78
|
-
justify-content: space-between;
|
|
79
|
-
align-items: center;
|
|
80
|
-
&-preview {
|
|
81
|
-
width: 30px;
|
|
82
|
-
height: 30px;
|
|
83
|
-
margin-right: 10px;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
::v-deep .ProductColorsSelectorOptions {
|
|
89
|
-
&__wrapper {
|
|
90
|
-
display: grid;
|
|
91
|
-
grid-template-columns: repeat(auto-fill,42px);
|
|
92
|
-
grid-column-gap: 9px;
|
|
93
|
-
grid-row-gap: 9px;
|
|
94
|
-
padding-top: 0;
|
|
95
|
-
}
|
|
96
|
-
&__color {
|
|
97
|
-
width: 42px;
|
|
98
|
-
height: 42px;
|
|
99
|
-
&::before,
|
|
100
|
-
&-inner {
|
|
101
|
-
position: absolute;
|
|
102
|
-
top: 0;
|
|
103
|
-
right: 0;
|
|
104
|
-
bottom: 0;
|
|
105
|
-
left: 0;
|
|
106
|
-
border-radius: 0;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
::v-deep {
|
|
112
|
-
.multiselect__input {
|
|
113
|
-
color: $black;
|
|
7
|
+
&__postcode-container {
|
|
8
|
+
margin-top: 22px;
|
|
114
9
|
}
|
|
10
|
+
// &__total-info {
|
|
11
|
+
// position: sticky;
|
|
12
|
+
// top: 130px;
|
|
13
|
+
// }
|
|
115
14
|
}
|
|
@@ -1,46 +1,64 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="Cart__wrapper">
|
|
3
3
|
<div
|
|
4
|
-
v-if="
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
v-if="hasGroupEntities"
|
|
14
|
-
btn-class="green"
|
|
15
|
-
btn-label="Clear Cart"
|
|
16
|
-
@onclick="removeAllEntities" />
|
|
17
|
-
</div>
|
|
18
|
-
<slot name="cart-entities-groups" v-bind="{ groupedEntities, selectedEntities }">
|
|
19
|
-
<cart-entities-group
|
|
20
|
-
v-for="[groupKey, group] in groupedEntities"
|
|
21
|
-
:key="groupKey"
|
|
22
|
-
:group="group"
|
|
23
|
-
:selected-entities="selectedEntities"
|
|
24
|
-
@remove="removeGroupEntities" />
|
|
25
|
-
</slot>
|
|
4
|
+
v-if="!isEmpty"
|
|
5
|
+
class="row">
|
|
6
|
+
<div class="col-es-12 col-8">
|
|
7
|
+
<cart-entity
|
|
8
|
+
v-for="entity in entities"
|
|
9
|
+
:key="entity._id"
|
|
10
|
+
:entity="entity"
|
|
11
|
+
class="Cart__entity"
|
|
12
|
+
@remove="removeSimpleProducts" />
|
|
26
13
|
</div>
|
|
27
|
-
<div class="
|
|
28
|
-
<div
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
14
|
+
<div class="col-es-12 col-4">
|
|
15
|
+
<div class="Cart__total-info">
|
|
16
|
+
<btn
|
|
17
|
+
class="hidden-extra-small"
|
|
18
|
+
btn-class="black"
|
|
19
|
+
btn-label="CLEAR CART"
|
|
20
|
+
:btn-block="true"
|
|
21
|
+
@onclick="removeAllSimpleProducts" />
|
|
22
|
+
<div class="Cart__total-container">
|
|
23
|
+
<cart-price-info @loaded="loadedPricing($event)" />
|
|
24
|
+
</div>
|
|
25
|
+
<div class="Cart__postcode-container">
|
|
26
|
+
<postcode-select
|
|
27
|
+
:suburb="suburb"
|
|
28
|
+
:labelless="true"
|
|
29
|
+
placeholder="Postcode"
|
|
30
|
+
label-text="Enter postcode to calculate shipping"
|
|
31
|
+
@select="handleSuburbChange" />
|
|
32
|
+
</div>
|
|
33
|
+
<div class="Cart__coupon-container">
|
|
34
|
+
<coupon-select
|
|
35
|
+
v-model="cartCoupon"
|
|
36
|
+
:pricing="cartPricingCalculating ? null : cartPricing"
|
|
37
|
+
label-text="Enter coupon code" />
|
|
38
|
+
</div>
|
|
39
|
+
<div class="Cart__quantity-errors">
|
|
40
|
+
<cart-quantity-errors />
|
|
41
|
+
</div>
|
|
42
|
+
<div class="mt-10">
|
|
43
|
+
<btn
|
|
44
|
+
:btn-disabled="isNotValidQuantity || cartPricingError || cartPricingCalculating"
|
|
45
|
+
:btn-block="true"
|
|
46
|
+
to="/checkout/order"
|
|
47
|
+
btn-class="green"
|
|
48
|
+
btn-label="PROCEED TO CHECKOUT">
|
|
49
|
+
<i
|
|
50
|
+
slot="icon-after"
|
|
51
|
+
class="icon-arrow-right"></i>
|
|
52
|
+
</btn>
|
|
53
|
+
</div>
|
|
54
|
+
<div class="mt-10 hidden-sm-and-up">
|
|
55
|
+
<btn
|
|
56
|
+
btn-class="black"
|
|
57
|
+
btn-label="CLEAR CART"
|
|
58
|
+
:btn-block="true"
|
|
59
|
+
@onclick="removeAllSimpleProducts" />
|
|
60
|
+
</div>
|
|
33
61
|
</div>
|
|
34
|
-
<postcode-select
|
|
35
|
-
:suburb="suburb"
|
|
36
|
-
@select="handleSuburbChange">
|
|
37
|
-
</postcode-select>
|
|
38
|
-
</div>
|
|
39
|
-
<div class="Cart__total-container">
|
|
40
|
-
<cart-price-info :items-label="itemsLabel" />
|
|
41
|
-
</div>
|
|
42
|
-
<div class="Cart__quantity-errors">
|
|
43
|
-
<cart-quantity-errors />
|
|
44
62
|
</div>
|
|
45
63
|
</div>
|
|
46
64
|
<div
|
|
@@ -52,23 +70,43 @@
|
|
|
52
70
|
</template>
|
|
53
71
|
|
|
54
72
|
<script>
|
|
73
|
+
import { mapGetters } from 'vuex';
|
|
74
|
+
import gtm from '@lancom/shared/assets/js/utils/gtm';
|
|
55
75
|
import PostcodeSelect from '@lancom/shared/components/common/postcode_select/postcode-select';
|
|
76
|
+
import CouponSelect from '@lancom/shared/components/common/coupon_select/coupon-select';
|
|
77
|
+
import CartQuantityErrors from '@lancom/shared/components/checkout/cart/cart_quantity_errors/cart-quantity-errors';
|
|
78
|
+
import CartEntity from '@lancom/shared/components/checkout/cart/cart_entity/cart-entity';
|
|
56
79
|
import { price } from '@lancom/shared/assets/js/utils/filters';
|
|
57
|
-
import
|
|
58
|
-
import CartPriceInfo from '
|
|
59
|
-
import CartQuantityErrors from './cart_quantity_errors/cart-quantity-errors.vue';
|
|
60
|
-
import CartMixin from './cart.mixin';
|
|
61
|
-
|
|
80
|
+
import CartMixin from '@lancom/shared/components/checkout/cart/cart.mixin';
|
|
81
|
+
import CartPriceInfo from '@lancom/shared/components/checkout/cart/cart_price_info/cart-price-info';
|
|
62
82
|
export default {
|
|
63
83
|
name: 'CheckoutCart',
|
|
64
84
|
components: {
|
|
65
|
-
|
|
85
|
+
CartEntity,
|
|
66
86
|
CartPriceInfo,
|
|
67
87
|
CartQuantityErrors,
|
|
68
|
-
PostcodeSelect
|
|
88
|
+
PostcodeSelect,
|
|
89
|
+
CouponSelect
|
|
69
90
|
},
|
|
70
91
|
filters: { price },
|
|
71
|
-
mixins: [CartMixin]
|
|
92
|
+
mixins: [CartMixin],
|
|
93
|
+
computed: {
|
|
94
|
+
...mapGetters('cart', ['isEmpty', 'cartPricingError', 'cartPricing', 'cartPricingCalculating', 'entities']),
|
|
95
|
+
cartCoupon: {
|
|
96
|
+
get() {
|
|
97
|
+
return this.coupon;
|
|
98
|
+
},
|
|
99
|
+
set(coupon) {
|
|
100
|
+
this.setCoupon(coupon);
|
|
101
|
+
this.calculateCartPrice({ shop: this.shop, country: this.country });
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
methods: {
|
|
106
|
+
loadedPricing() {
|
|
107
|
+
gtm.viewCart(this.entities, this.cartPricing);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
72
110
|
};
|
|
73
111
|
</script>
|
|
74
112
|
|
|
@@ -92,7 +92,7 @@ export default {
|
|
|
92
92
|
};
|
|
93
93
|
},
|
|
94
94
|
computed: {
|
|
95
|
-
...mapGetters(['shop']),
|
|
95
|
+
...mapGetters(['shop', 'currency']),
|
|
96
96
|
...mapGetters('cart', ['simpleProducts', 'cartProductsPricing']),
|
|
97
97
|
model: {
|
|
98
98
|
get() {
|
|
@@ -106,7 +106,8 @@ export default {
|
|
|
106
106
|
this.setSimpleProductAmount({
|
|
107
107
|
guid: this.simpleProduct.guid,
|
|
108
108
|
amount: this.formatAmount(value),
|
|
109
|
-
shop: this.shop
|
|
109
|
+
shop: this.shop,
|
|
110
|
+
currency: this.currency
|
|
110
111
|
});
|
|
111
112
|
}
|
|
112
113
|
},
|
|
@@ -137,7 +138,8 @@ export default {
|
|
|
137
138
|
this.setSimpleProductAmount({
|
|
138
139
|
guid: this.simpleProduct.guid,
|
|
139
140
|
amount: this.formatAmount(this.model + 1),
|
|
140
|
-
shop: this.shop
|
|
141
|
+
shop: this.shop,
|
|
142
|
+
currency: this.currency
|
|
141
143
|
});
|
|
142
144
|
this.$emit('change');
|
|
143
145
|
},
|
|
@@ -145,7 +147,8 @@ export default {
|
|
|
145
147
|
this.setSimpleProductAmount({
|
|
146
148
|
guid: this.simpleProduct.guid,
|
|
147
149
|
amount: this.formatAmount(this.model - 1),
|
|
148
|
-
shop: this.shop
|
|
150
|
+
shop: this.shop,
|
|
151
|
+
currency: this.currency
|
|
149
152
|
});
|
|
150
153
|
this.$emit('change');
|
|
151
154
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="CartPriceInfo__wrapper">
|
|
3
3
|
<slot name="cart-pricing" v-bind="{ cartPricing, itemsLabel }">
|
|
4
|
-
<
|
|
4
|
+
<cart-pricing
|
|
5
5
|
v-if="cartPricing && cartPricing.amount"
|
|
6
|
-
:pricing="cartPricing"
|
|
7
|
-
:items-label="itemsLabel" />
|
|
6
|
+
:pricing="cartPricing" />
|
|
8
7
|
</slot>
|
|
9
8
|
<div
|
|
10
9
|
v-if="cartPricingError"
|
|
@@ -17,7 +16,7 @@
|
|
|
17
16
|
<script>
|
|
18
17
|
import { mapGetters, createNamespacedHelpers } from 'vuex';
|
|
19
18
|
import debounce from 'lodash.debounce';
|
|
20
|
-
import
|
|
19
|
+
import CartPricing from '@lancom/shared/components/checkout/cart/cart_pricing/cart-pricing';
|
|
21
20
|
import { price } from '@lancom/shared/assets/js/utils/filters';
|
|
22
21
|
|
|
23
22
|
const { mapActions } = createNamespacedHelpers('cart');
|
|
@@ -26,7 +25,7 @@ export default {
|
|
|
26
25
|
name: 'LancomCartPriceInfo',
|
|
27
26
|
filters: { price },
|
|
28
27
|
components: {
|
|
29
|
-
|
|
28
|
+
CartPricing
|
|
30
29
|
},
|
|
31
30
|
props: {
|
|
32
31
|
itemsLabel: {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
@import '@/assets/scss/variables';
|
|
2
|
+
|
|
3
|
+
.CartPricing {
|
|
4
|
+
&__wrapper {
|
|
5
|
+
border: 2px solid $gray;
|
|
6
|
+
padding: 28px 20px;
|
|
7
|
+
@media (max-width: $bp-small-max) {
|
|
8
|
+
padding: 15px 10px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@media (max-width: $bp-small-max) {
|
|
12
|
+
.lc_h3 {
|
|
13
|
+
font-size: 19px;
|
|
14
|
+
}
|
|
15
|
+
.lc_body-large {
|
|
16
|
+
font-size: 14px;
|
|
17
|
+
}
|
|
18
|
+
.lc_title-large {
|
|
19
|
+
font-size: 16px;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
&__info {
|
|
24
|
+
padding: 11px;
|
|
25
|
+
display: flex;
|
|
26
|
+
justify-content: space-between;
|
|
27
|
+
@media (max-width: $bp-small-max) {
|
|
28
|
+
padding: 6px;
|
|
29
|
+
}
|
|
30
|
+
&--gray {
|
|
31
|
+
background-color: $gray;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|