@lancom/shared 0.0.280 → 0.0.282

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.
Files changed (95) hide show
  1. package/assets/js/api/admin.js +3 -0
  2. package/assets/js/api/index.js +7 -4
  3. package/assets/js/models/print-area.js +8 -4
  4. package/assets/js/utils/colors.js +1 -1
  5. package/assets/js/utils/fabric-helper.js +5 -18
  6. package/assets/js/utils/filters.js +2 -2
  7. package/assets/js/utils/product.js +10 -1
  8. package/assets/scss/_common.scss +10 -0
  9. package/components/asides/contact_us/contact-us.vue +9 -2
  10. package/components/asides/menu/menu.vue +1 -25
  11. package/components/checkout/cart/cart.mixin.js +3 -3
  12. package/components/checkout/cart/cart.scss +8 -109
  13. package/components/checkout/cart/cart.vue +84 -46
  14. package/components/checkout/cart/cart_entity/cart_entity_color_simple_products/cart_entity_color_simple_product/cart-entity-color-simple-product.vue +7 -4
  15. package/components/checkout/cart/cart_price_info/cart-price-info.vue +4 -5
  16. package/components/checkout/cart/cart_pricing/cart-pricing.scss +34 -0
  17. package/components/checkout/cart/cart_pricing/cart-pricing.vue +112 -0
  18. package/components/checkout/cart/cart_shipments_pricing/cart-shipments-pricing.vue +2 -2
  19. package/components/checkout/order/address-form/address-form.scss +16 -0
  20. package/components/checkout/order/address-form/address-form.vue +199 -91
  21. package/components/checkout/order/order-billing-information/order-billing-information.scss +1 -1
  22. package/components/checkout/order/order-payment-information/order-payment-information.vue +15 -5
  23. package/components/checkout/order/order.vue +2 -1
  24. package/components/common/client_settings/client-settings.scss +6 -0
  25. package/components/common/client_settings/client-settings.vue +9 -1
  26. package/components/common/payment/payment_card/stripe/stripe.vue +1 -0
  27. package/components/common/payment/payment_success/payment-success.vue +8 -1
  28. package/components/common/postcode_select/postcode-select.vue +24 -12
  29. package/components/common/price.vue +1 -1
  30. package/components/common/pricing_table/pricing-table.vue +3 -2
  31. package/components/common/tabs.vue +17 -8
  32. package/components/editor/editor.scss +6 -0
  33. package/components/editor/editor.vue +9 -25
  34. package/components/editor/editor_layers/editor-layers.scss +18 -0
  35. package/components/editor/editor_layers/editor-layers.vue +76 -20
  36. package/components/editor/editor_layers/editor_layers_layer/editor-layers-layer.vue +11 -4
  37. package/components/editor/editor_print_area_options/editor-print-area-options.vue +6 -1
  38. package/components/editor/editor_print_area_options/editor_print_area_option/editor-print-area-option.vue +2 -2
  39. package/components/editor/editor_product_details/editor-product-details.scss +8 -2
  40. package/components/editor/editor_product_details/editor-product-details.vue +22 -25
  41. package/components/editor/editor_wizard/editor-wizard.vue +2 -1
  42. package/components/editor/editor_workspace/editor-workspace.vue +7 -3
  43. package/components/editor/editor_workspace/editor_workspace_side/editor-workspace-side.vue +17 -20
  44. package/components/editor/mobile_editor_product_details/mobile-editor-product-details.scss +2 -2
  45. package/components/modals/cart_modal/cart-modal.vue +1 -1
  46. package/components/modals/order_modal/order-modal.vue +6 -0
  47. package/components/modals/payment_modal/payment-modal.vue +4 -3
  48. package/components/order/order_payment/order-payment.vue +6 -6
  49. package/components/product/editor_pricing/editor-pricing.scss +75 -0
  50. package/components/product/editor_pricing/editor-pricing.vue +197 -0
  51. package/components/product/editor_pricing/editor_pricing_details/editor-pricing-details.scss +0 -0
  52. package/components/product/editor_pricing/editor_pricing_details/editor-pricing-details.vue +29 -0
  53. package/components/product/editor_pricing/editor_pricing_details/editor_pricing_details_prints/editor-pricing-details-prints.scss +41 -0
  54. package/components/product/editor_pricing/editor_pricing_details/editor_pricing_details_prints/editor-pricing-details-prints.vue +118 -0
  55. package/components/product/editor_pricing/editor_pricing_details/editor_pricing_details_products/editor-pricing-details-products.scss +41 -0
  56. package/components/product/editor_pricing/editor_pricing_details/editor_pricing_details_products/editor-pricing-details-products.vue +102 -0
  57. package/components/product/product.vue +1 -1
  58. package/components/product/product_colors_selector/product-colors-selector.scss +117 -0
  59. package/components/product/product_colors_selector/product-colors-selector.vue +188 -0
  60. package/components/product/product_multipacks_carousel/product-multipacks-carousel.vue +3 -1
  61. package/components/product/product_size_selector/product_size_selector_color/product_size_selector_color_cell/product-size-selector-color-cell.vue +4 -5
  62. package/components/product/products_size_selector_color/product_size_selector_color/product-size-selector-color.scss +58 -0
  63. package/components/product/products_size_selector_color/product_size_selector_color/product-size-selector-color.vue +128 -0
  64. package/components/product/products_size_selector_color/products-size-selector-color.scss +12 -0
  65. package/components/product/products_size_selector_color/products-size-selector-color.vue +43 -0
  66. package/components/product/wizard/wizard_print_layers/wizard_print_layer/wizard-print-layer.vue +4 -34
  67. package/components/product/wizard/wizard_print_size/wizard_print_area_print_size/wizard-print-area-print-size.vue +2 -1
  68. package/components/product/wizard/wizard_print_text_or_logo/wizard-print-text-or-logo.vue +22 -1
  69. package/components/product/wizard/wizard_print_type/wizard_print_area_print_type/wizard-print-area-print-type.vue +2 -1
  70. package/components/products/product_list/product-list.scss +2 -2
  71. package/components/products/product_list_product/product-list-product.scss +7 -11
  72. package/components/products/product_list_product/product-list-product.vue +7 -15
  73. package/components/the_aside/the-aside.vue +1 -0
  74. package/components/the_navbar/the-navbar.scss +1 -1
  75. package/feeds/google-shopping.js +5 -5
  76. package/layouts/error.vue +39 -0
  77. package/layouts/products.vue +386 -0
  78. package/mixins/add-to-cart.js +64 -0
  79. package/mixins/payment.js +2 -1
  80. package/mixins/print-layer.js +45 -0
  81. package/mixins/product-preview.js +1 -1
  82. package/mixins/product-view.js +313 -0
  83. package/nuxt.config.js +0 -5
  84. package/package.json +1 -1
  85. package/pages/checkout/cart.vue +40 -0
  86. package/pages/checkout/order.vue +72 -0
  87. package/pages/customer/create.vue +33 -0
  88. package/pages/customer/password/_token.vue +79 -0
  89. package/pages/customer/recovery.vue +33 -0
  90. package/pages/customer/settings.vue +33 -0
  91. package/pages/customer/signin.vue +33 -0
  92. package/routes/index.js +35 -0
  93. package/store/cart.js +15 -6
  94. package/store/order.js +2 -2
  95. package/store/product.js +5 -12
@@ -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
  },
@@ -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);
@@ -154,8 +154,11 @@ const api = {
154
154
  sendFailedConversionFile(data, shop) {
155
155
  return _post(`shop/${shop}/image/send-failed-conversion`, data);
156
156
  },
157
- fetchSuburbs(params) {
158
- return _get('postcodes', params);
157
+ fetchSuburbs(params, shop) {
158
+ return _get(`shop/${shop || '-1'}/postcodes`, params);
159
+ },
160
+ fetchAddressInfo(id, shop) {
161
+ return _get(`shop/${shop || '-1'}/postcodes/address/${id}`);
159
162
  },
160
163
  fetchProductPrintTemplates() {
161
164
  return _get('print-templates');
@@ -42,11 +42,13 @@ export const getProductPrintsAreasPrices = (product, printType) => {
42
42
  return areas;
43
43
  };
44
44
 
45
- export const getPrintAreaByName = ({ printArea, editorWidth, editorHeight, printSize, printAreaOffsets }, product) => {
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 size = printSize || pa.printSize;
49
- const offsets = printAreaOffsets || pa.printAreaOffsets;
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;
@@ -72,5 +74,7 @@ export const getPrintAreaByName = ({ printArea, editorWidth, editorHeight, print
72
74
  const widthInInches = widthCm * cmToInchesRatio;
73
75
  const heightInInches = heightCm * cmToInchesRatio;
74
76
 
75
- return { width, height, top, left, center, printArea, widthInInches, heightInInches };
77
+ const info = { width, height, top, left, center, printArea, widthInInches, heightInInches };
78
+ // console.log('getPrintAreaByName:info ', offsets, info, params);
79
+ return info;
76
80
  };
@@ -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,14 +191,16 @@ export default class FabricHelper {
191
191
  }
192
192
 
193
193
  createObject({ layer, active }) {
194
- const initial = false; // !layer.modifiedAt;
194
+ const initial = !layer.modifiedAt;
195
+ console.log('createObject...', layer.type, layer.top, layer.left);
195
196
  return new Promise(resolve => {
196
197
  const methods = {
197
198
  text: 'createTextObject',
198
199
  art: 'createArtObject'
199
200
  };
200
201
  this[methods[layer.type]]({ layer, initial }).then(obj => {
201
- obj.clipPath = this.boundingBox;
202
+ // obj.clipPath = this.boundingBox;
203
+ console.log('obj: ', obj.top, obj.left);
202
204
  this.handleListeners(obj, layer.type);
203
205
  this.editor.add(obj);
204
206
  if (active) {
@@ -222,21 +224,6 @@ export default class FabricHelper {
222
224
  buildWireframe({ width, height, editor: this.editor, print });
223
225
  }
224
226
 
225
- checkAnyBoundingIntersection() {
226
- const objects = this.editor.getObjects();
227
-
228
- if (!objects.length) {
229
- return this.dispatch('outOfPrintArea', false);
230
- }
231
-
232
- let isOut = false;
233
- objects.forEach(object => {
234
- if (!isOut) {
235
- isOut = this.checkBoundingIntersection(object);
236
- }
237
- });
238
- }
239
-
240
227
  checkBoundingIntersection(object) {
241
228
  const width = object.width * object.scaleX;
242
229
  const height = object.height * object.scaleY;
@@ -359,7 +346,7 @@ export default class FabricHelper {
359
346
  this.dispatch('setField', { field: 'copy', value: object.text });
360
347
  } else {
361
348
  this.dispatch('setDeleteButtonPosition', object.oCoords.tr);
362
- this.checkBoundingIntersection(object);
349
+ // this.checkBoundingIntersection(object);
363
350
  }
364
351
  });
365
352
  }
@@ -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];
@@ -148,4 +148,13 @@ export function sortByOrder(items, itemProp) {
148
148
  export function sortByOrderASC(items, itemProp) {
149
149
  const getOrder = item => (itemProp ? +(item[itemProp] && item[itemProp].order) : item.order) || 0;
150
150
  return [...(items || [])].sort((a, b) => getOrder(a) - getOrder(b));
151
- }
151
+ }
152
+
153
+ export function getAllPrintAreas(product) {
154
+ return product.printAreas
155
+ ?.reduce((options, pa) => [
156
+ ...options,
157
+ pa,
158
+ ...pa.sizes.map(s => ({ ...s, side: pa.side }))
159
+ ], []) || [];
160
+ }
@@ -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="required|phone"
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
- <div
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
- padding: 12px;
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
- &-container {
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="entities.length">
5
- <div class="form-row Cart__products">
6
- <div class="d-flex">
7
- <btn
8
- v-if="hasSelectedEntities"
9
- btn-class="green"
10
- btn-label="Remove Selected"
11
- @onclick="removeSelectedEntities" />
12
- <btn
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="Cart__postcode-container">
28
- <div
29
- v-if="!suburb"
30
- class="lc_regular16 Cart__postcode-prompt">
31
- <i class="icon-attention-circled Cart__postcode-prompt-icon"></i>
32
- Enter postcode to calculate delivery
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 CartEntitiesGroup from './cart_entities_group/cart-entities-group';
58
- import CartPriceInfo from './cart_price_info/cart-price-info';
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
- CartEntitiesGroup,
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
- <product-total-pricing
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 ProductTotalPricing from '@lancom/shared/components/common/products_total_pricing/products-total-pricing';
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
- ProductTotalPricing
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
+ }