@lancom/shared 0.0.257 → 0.0.258

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 (46) hide show
  1. package/assets/js/api/admin.js +11 -11
  2. package/assets/js/constants/country.js +1 -1
  3. package/assets/scss/ui_kit/_forms.scss +2 -2
  4. package/assets/scss/ui_kit/_tooltip.scss +3 -1
  5. package/assets/scss/variables/_theme.scss +3 -3
  6. package/components/checkout/cart/cart.mixin.js +5 -5
  7. package/components/checkout/cart/cart_price_info/cart-price-info.vue +2 -2
  8. package/components/checkout/cart/cart_shipments_pricing/cart-shipments-pricing.vue +2 -2
  9. package/components/checkout/order/address-form/address-form.vue +4 -3
  10. package/components/checkout/order/order-shipping-method/order-shipping-method.vue +2 -2
  11. package/components/checkout/order/order.vue +1 -1
  12. package/components/common/payment/payment_card/pinpayment/pinpayment.vue +34 -5
  13. package/components/common/postcode_select/postcode-select.vue +5 -1
  14. package/components/common/products_total_pricing/products-total-pricing.vue +5 -1
  15. package/components/design/approve_design_header/approve-design-header.vue +1 -1
  16. package/components/editor/editor.vue +8 -2
  17. package/components/editor/editor_pricing/editor-pricing.vue +2 -2
  18. package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_prints/editor-pricing-details-prints.vue +8 -7
  19. package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_products/editor-pricing-details-products.vue +13 -5
  20. package/components/editor/editor_product_details/editor-product-details.scss +6 -0
  21. package/components/editor/editor_product_details/editor-product-details.vue +12 -2
  22. package/components/faq/faq.vue +2 -2
  23. package/components/modals/order_modal/order-modal.vue +17 -3
  24. package/components/order/order_price/order-price.vue +5 -3
  25. package/components/order/order_prints_groups/order-prints-groups.vue +3 -1
  26. package/components/order/order_products_groups/order-products-groups.vue +3 -1
  27. package/components/order/order_refund_view/order-refund-view.vue +5 -3
  28. package/components/order/order_setup_groups/order-setup-groups.vue +4 -2
  29. package/components/order/order_sku_groups/order-sku-groups.vue +3 -1
  30. package/components/order/order_view/order-view.vue +10 -6
  31. package/components/pricing/pricing_digital_printing/pricing-digital-printing.vue +3 -1
  32. package/components/pricing/pricing_example/pricing-example.vue +3 -3
  33. package/components/pricing/pricing_how_we_calculate/pricing-how-we-calculate.vue +7 -2
  34. package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing-product-calculator.vue +2 -2
  35. package/components/pricing/pricing_screen_printing/pricing-screen-printing.vue +3 -1
  36. package/components/product/product_price_range/product-price-range.vue +6 -5
  37. package/components/product/product_prints_price_info/product-prints-price-info.vue +2 -2
  38. package/components/products/products_autocomplete/products-autocomplete.scss +10 -12
  39. package/components/quotes/quote_request/quote-request.vue +1 -1
  40. package/components/quotes/quote_view/quote_option_view/quote-option-view.vue +5 -4
  41. package/mixins/meta-info.js +4 -1
  42. package/mixins/products-price.js +3 -2
  43. package/package.json +1 -1
  44. package/store/cart.js +7 -6
  45. package/store/index.js +15 -4
  46. package/store/product.js +3 -2
@@ -132,34 +132,34 @@ export default {
132
132
  return _post(`admin/orders/pick-pdf`, { orders });
133
133
  },
134
134
  saveOrderSubsequentInvoice(order, invoice) {
135
- return invoice._id ? _put(`admin/shop/${order.shop}/order/${order._id}/invoice/${invoice._id}`, invoice) : _post(`admin/shop/${order.shop}/order/${order._id}/invoice`, invoice);
135
+ return invoice._id ? _put(`admin/shop/${order.shop?._id || order.shop}/order/${order._id}/invoice/${invoice._id}`, invoice) : _post(`admin/shop/${order.shop?._id || order.shop}/order/${order._id}/invoice`, invoice);
136
136
  },
137
137
  sendOrderSubsequentInvoice(order, invoice) {
138
- return _post(`admin/shop/${order.shop}/order/${order._id}/invoice/${invoice}/send`);
138
+ return _post(`admin/shop/${order.shop?._id || order.shop}/order/${order._id}/invoice/${invoice}/send`);
139
139
  },
140
- exportOrderToStarshipit(order, shipment) {
141
- return _post(`admin/shop/${order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}/export-to-starshipit`, shipment);
140
+ exportOrderToShippingService(order, shipment) {
141
+ return _post(`admin/shop/${order.shop?._id || order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}/export-to-shipping-service`, shipment);
142
142
  },
143
143
  markShipmentAsDispatched(order, shipment) {
144
- return _post(`admin/shop/${order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}/dispatched`, shipment);
144
+ return _post(`admin/shop/${order.shop?._id || order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}/dispatched`, shipment);
145
145
  },
146
146
  markSubOrderAsDispatched(order, subOrder) {
147
- return _post(`admin/shop/${order.shop}/order/${order._id}/sub-order/${subOrder._id}/dispatched`, subOrder);
147
+ return _post(`admin/shop/${order.shop?._id || order.shop}/order/${order._id}/sub-order/${subOrder._id}/dispatched`, subOrder);
148
148
  },
149
149
  generateDuplicateOrderCode(order) {
150
150
  return _get(`admin/order/${order}/duplicate-code`);
151
151
  },
152
152
  sendShipmentTracking(order, shipment, tracking) {
153
- return _post(`admin/shop/${order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}/tracking/${tracking._id}/send`, tracking);
153
+ return _post(`admin/shop/${order.shop?._id || order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}/tracking/${tracking._id}/send`, tracking);
154
154
  },
155
- removeShipmentFromStarshipit(order, shipment) {
156
- return _delete(`admin/shop/${order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}`);
155
+ removeShipment(order, shipment) {
156
+ return _delete(`admin/shop/${order.shop?._id || order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}`);
157
157
  },
158
158
  calculateShipmentRates(order, shipment) {
159
- return _get(`admin/shop/${order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}/calculate-shipping`);
159
+ return _get(`admin/shop/${order.shop?._id || order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}/calculate-shipping`);
160
160
  },
161
161
  createPrintLabels(order, shipment, rate) {
162
- return _post(`admin/shop/${order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}/print-labels`, rate);
162
+ return _post(`admin/shop/${order.shop?._id || order.shop}/order/${order._id}/shipment/${shipment._id || shipment.guid}/print-labels`, rate);
163
163
  },
164
164
  createOrderRefund(order, refund, shop) {
165
165
  return _post(`shop/${shop}/order/${order}/refund`, refund);
@@ -1,4 +1,4 @@
1
1
  export const COUNTRIES_CODES = {
2
2
  Australia: 'AU',
3
- 'United Kingdom': 'UK'
3
+ 'United Kingdom': 'GB'
4
4
  };
@@ -177,7 +177,7 @@ html[dir=rtl] .form-icon-left {
177
177
  height: 50px;
178
178
  border-width: 1px;
179
179
  border-style: solid;
180
- border-color: #EFF1F2;
180
+ border-color: $grey_3;
181
181
  border-radius: 5px;
182
182
  font-style: normal;
183
183
  font-weight: normal;
@@ -424,7 +424,7 @@ html[dir=rtl] .textarea {
424
424
  }
425
425
  &__tags {
426
426
  min-height: 50px;
427
- border: 1px solid #e5e5e5;
427
+ border: 1px solid $grey_3;
428
428
  border-radius: 8px !important;
429
429
  padding: 19px 3px 4px 20px;
430
430
  }
@@ -1,3 +1,5 @@
1
+ @import "@/assets/scss/variables";
2
+
1
3
  .tooltip {
2
4
  display: block !important;
3
5
  z-index: 10000;
@@ -25,7 +27,7 @@
25
27
  &.white &-inner {
26
28
  background: #FFF !important;
27
29
  color: #575872 !important;
28
- border: 1px solid #EFF1F2 !important;
30
+ border: 1px solid $grey_3 !important;
29
31
  }
30
32
  &.white &-arrow {
31
33
  border-color: #FFF !important;
@@ -15,7 +15,7 @@ $white_high_emphasis: #FFFFFF;
15
15
  $white_medium_emphasis: rgba(255, 255, 255, .66);
16
16
  $gray: #575872 !default;
17
17
  $medium_gray: #B0B0BA !default;
18
- $light_gray: #F9F9FC !default;
18
+ $light_gray: #F9F9FC;
19
19
  $link: #5D89A9;
20
20
  $error: #E44868;
21
21
  $secondary_900: #20303C;
@@ -52,8 +52,8 @@ $black: #343750 !default;
52
52
  $gray_main: #616277 !default;
53
53
  $grey_1: #616277 !default;
54
54
  $grey_2: #B0B0BA !default;
55
- $grey_3: #EFF1F2 !default;
56
- $grey_4: #F9F9FC !default;
55
+ $grey_3: #EFF1F2;
56
+ $grey_4: #F9F9FC;
57
57
  $grey_5: #9898A5 !default;
58
58
 
59
59
  $white: #fff;
@@ -12,7 +12,7 @@ export default {
12
12
  };
13
13
  },
14
14
  computed: {
15
- ...mapGetters(['shop']),
15
+ ...mapGetters(['shop', 'country']),
16
16
  ...mapGetters('auth', ['user']),
17
17
  ...mapGetters('cart', [
18
18
  'entities',
@@ -45,11 +45,11 @@ export default {
45
45
  },
46
46
  watch: {
47
47
  entities() {
48
- this.calculateCartPriceWithDebounce({ shop: this.shop });
48
+ this.calculateCartPriceWithDebounce({ shop: this.shop, country: this.country });
49
49
  }
50
50
  },
51
51
  mounted() {
52
- this.calculateCartPriceWithDebounce({ shop: this.shop });
52
+ this.calculateCartPriceWithDebounce({ shop: this.shop, country: this.country });
53
53
  if (!this.suburb && this.user?.suburb) {
54
54
  this.handleSuburbChange(this.user.suburb);
55
55
  }
@@ -65,11 +65,11 @@ export default {
65
65
  ]),
66
66
  handleSuburbChange(suburb) {
67
67
  this.setSuburb(suburb);
68
- this.calculateCartPrice({ shop: this.shop });
68
+ this.calculateCartPrice({ shop: this.shop, country: this.country });
69
69
  },
70
70
  handleCouponChange(coupon) {
71
71
  this.setCoupon(coupon);
72
- this.calculateCartPrice({ shop: this.shop });
72
+ this.calculateCartPrice({ shop: this.shop, country: this.country });
73
73
  },
74
74
  async removeSimpleProducts(simpleProducts) {
75
75
  const message = 'This will delete all items in this row, Press OK to continue or Cancel';
@@ -41,7 +41,7 @@ export default {
41
41
  };
42
42
  },
43
43
  computed: {
44
- ...mapGetters(['shop']),
44
+ ...mapGetters(['shop', 'country']),
45
45
  ...mapGetters('cart', [
46
46
  'entities',
47
47
  'cartPricing',
@@ -62,7 +62,7 @@ export default {
62
62
  'calculateCartPrice'
63
63
  ]),
64
64
  async calculatePrice() {
65
- await this.calculateCartPrice({ shop: this.shop });
65
+ await this.calculateCartPrice({ shop: this.shop, country: this.country });
66
66
  }
67
67
  }
68
68
  };
@@ -33,7 +33,7 @@
33
33
  :class="{
34
34
  'CartShipmentsPricing__rate--disabled': rate.disabled
35
35
  }"
36
- @click="selectRate({ supplier, rate, shop })">
36
+ @click="selectRate({ supplier, rate, shop, country })">
37
37
  <div class="CartShipmentsPricing__rate-info">
38
38
  <div class="CartShipmentsPricing__rate-icon">
39
39
  <checked-icon :checked="rate.selected" />
@@ -77,7 +77,7 @@ export default {
77
77
  },
78
78
  mixins: [confirm],
79
79
  computed: {
80
- ...mapGetters(['shop']),
80
+ ...mapGetters(['shop', 'country']),
81
81
  ...mapGetters('cart', [
82
82
  'cartPricing'
83
83
  ]),
@@ -203,7 +203,7 @@
203
203
  <input
204
204
  id="country"
205
205
  ref="country"
206
- value="Only Australia"
206
+ :value="address.country === 'Australia' ? 'Only Australia' : address.country"
207
207
  name="country"
208
208
  type="country"
209
209
  class="form-field filled labelless"
@@ -264,7 +264,7 @@ export default {
264
264
  }
265
265
  },
266
266
  computed: {
267
- ...mapGetters(['shop']),
267
+ ...mapGetters(['shop', 'country']),
268
268
  ...mapGetters('cart', [
269
269
  'suburb'
270
270
  ]),
@@ -296,12 +296,13 @@ export default {
296
296
  this.$set(this.address, 'state', suburb.state);
297
297
  this.$set(this.address, 'postcode', suburb.postcode);
298
298
  this.$set(this.address, 'city', suburb.locality);
299
+ this.$set(this.address, 'country', suburb.country);
299
300
  }
300
301
  },
301
302
  handleSuburbChange(suburb) {
302
303
  this.setAddressSuburb(suburb);
303
304
  this.setSuburb(suburb);
304
- this.calculateCartPrice({ shop: this.shop });
305
+ this.calculateCartPrice({ shop: this.shop, country: this.country });
305
306
  }
306
307
  }
307
308
  };
@@ -45,7 +45,7 @@ export default {
45
45
  };
46
46
  },
47
47
  computed: {
48
- ...mapGetters(['shop']),
48
+ ...mapGetters(['shop', 'country']),
49
49
  ...mapGetters('cart', ['cartPricing']),
50
50
  shippingPricing() {
51
51
  return this.cartPricing?.shipping;
@@ -53,7 +53,7 @@ export default {
53
53
  },
54
54
  mounted() {
55
55
  if (!this.shippingPricing) {
56
- this.calculateCartPrice({ shop: this.shop });
56
+ this.calculateCartPrice({ shop: this.shop, country: this.country });
57
57
  }
58
58
  },
59
59
  methods: {
@@ -98,7 +98,7 @@ export default {
98
98
  company: null,
99
99
  additionalInfo: null,
100
100
  suburb: null,
101
- country: 'Australia',
101
+ country: null,
102
102
  state: null,
103
103
  postcode: null
104
104
  };
@@ -86,6 +86,8 @@
86
86
  </template>
87
87
 
88
88
  <script>
89
+ let interval = null;
90
+
89
91
  export default {
90
92
  name: 'Payment',
91
93
  props: {
@@ -108,14 +110,17 @@ export default {
108
110
  fields: null
109
111
  };
110
112
  },
111
- mounted() {
113
+ async mounted() {
112
114
  this.loading = true;
115
+
116
+ await this.preloadPinpayments();
117
+
113
118
  if (window.HostedFields) {
114
- this.initHostedPayment();
119
+ await this.initHostedPayment();
115
120
  } else {
116
- window.addEventListener('load', () => {
121
+ window.addEventListener('load', async () => {
117
122
  if (!this.fields) {
118
- this.initHostedPayment();
123
+ await this.initHostedPayment();
119
124
  }
120
125
  });
121
126
  }
@@ -194,7 +199,31 @@ export default {
194
199
  }
195
200
  );
196
201
  });
197
- }
202
+ },
203
+ async preloadPinpayments() {
204
+ if (!window.HostedFields) {
205
+ clearInterval(interval);
206
+ await this.loadPinpayments();
207
+ await new Promise((resolve, reject) => {
208
+ interval = setInterval(() => {
209
+ if (window.HostedFields) {
210
+ clearInterval(interval);
211
+ resolve()
212
+ }
213
+ }, 100);
214
+ });
215
+ }
216
+ },
217
+ loadPinpayments() {
218
+ return new Promise((resolve) => {
219
+ const script = document.createElement('script');
220
+ script.type = "text/javascript";
221
+ script.src = 'https://cdn.pinpayments.com/pin.hosted_fields.v1.js';
222
+ script.onload = () => resolve();
223
+ const body = document.getElementsByTagName('body')[0];
224
+ body.appendChild(script);
225
+ });
226
+ }
198
227
  }
199
228
  };
200
229
  </script>
@@ -88,6 +88,9 @@ export default {
88
88
  },
89
89
  filters: { highlight },
90
90
  props: {
91
+ country: {
92
+ type: Object
93
+ },
91
94
  value: {
92
95
  type: String
93
96
  },
@@ -147,7 +150,8 @@ export default {
147
150
  async handleSearch(query) {
148
151
  if (query.length) {
149
152
  this.isLoading = true;
150
- this.suburbs = await api.fetchSuburbs({ query });
153
+ const country = this.country ? (this.country.isoCode === 'GB' ? 'England' : (this.country.name || this.country)) : 'Australia';
154
+ this.suburbs = await api.fetchSuburbs({ query, country });
151
155
  this.options = this.suburbs.map(this.createOptionFromSuburb);
152
156
  this.isLoading = false;
153
157
  } else {
@@ -21,13 +21,14 @@
21
21
  Total: {{ pricing.totalPrice | price(currency) }} <br />
22
22
  </div>
23
23
  <div class="lc_regular14 mt-4">
24
- Incl. GST ({{ pricing.tax.percent }}) {{ pricing.tax.totalPrice | price(currency) }}
24
+ Incl. {{ taxName }} ({{ pricing.tax.percent }}) {{ pricing.tax.totalPrice | price(currency) }}
25
25
  </div>
26
26
  </div>
27
27
  </div>
28
28
  </template>
29
29
 
30
30
  <script>
31
+ import { mapGetters } from 'vuex';
31
32
  import { price } from '@lancom/shared/assets/js/utils/filters';
32
33
 
33
34
  export default {
@@ -44,6 +45,9 @@ export default {
44
45
  type: String,
45
46
  default: 'Tee'
46
47
  }
48
+ },
49
+ computed: {
50
+ ...mapGetters(['taxName'])
47
51
  }
48
52
  };
49
53
  </script>
@@ -36,7 +36,7 @@
36
36
  {{ order.postcode }},
37
37
  {{ order.state }},
38
38
  {{ order.city }},
39
- Australia
39
+ {{ order.country || 'Australia'}}
40
40
  </span>
41
41
  </div>
42
42
  </div>
@@ -18,7 +18,9 @@
18
18
  </component>
19
19
  </template>
20
20
  </tabs>
21
- <div class="Editor__footer">
21
+ <div
22
+ v-if="productAvailableInCurrentCountry"
23
+ class="Editor__footer">
22
24
  <btn
23
25
  btn-label="Start again"
24
26
  btn-class="white"
@@ -135,8 +137,12 @@ export default {
135
137
  ...mapGetters('layers', [
136
138
  'layerThumbnails'
137
139
  ]),
140
+ productAvailableInCurrentCountry() {
141
+ const { countries } = this.product;
142
+ return !(countries || []).length || countries.includes(this.country._id);
143
+ },
138
144
  addToCartDisabled() {
139
- return !(this.template.layers.length && this.usedSimpleProducts.length);
145
+ return !this.usedSimpleProducts.length || (this.product.printOnly && !this.template.layers.length);
140
146
  }
141
147
  },
142
148
  watch: {
@@ -116,11 +116,11 @@ export default {
116
116
  return {
117
117
  price: null,
118
118
  showDetails: false,
119
- calculatePriceWithDebounce: debounce(() => this.calculateProductPrice(this.shop), 500)
119
+ calculatePriceWithDebounce: debounce(() => this.calculateProductPrice({ shop: this.shop, country: this.country }), 500)
120
120
  };
121
121
  },
122
122
  computed: {
123
- ...mapGetters(['shop']),
123
+ ...mapGetters(['shop', 'country']),
124
124
  ...mapGetters('product', [
125
125
  'defaultSimpleProduct',
126
126
  'usedSimpleProducts',
@@ -32,18 +32,18 @@
32
32
  </td>
33
33
  <td>
34
34
  <strong>
35
- {{ group.setupPriceWithoutTax | priceWithTax(pricingSettings, currency) }}
35
+ {{ (priceIncludeGST ? group.setupPrice : group.setupPriceWithoutTax) | priceWithTax(pricingSettings, currency) }}
36
36
  </strong>
37
37
  </td>
38
38
  <td>
39
39
  <span v-if="group.costType !== 'setup only'">
40
40
  <strong>
41
- {{ (displayPricingWithTax ? group.totalPrice : group.totalPriceWithoutTax) | price(currency) }}
41
+ {{ (priceIncludeGST ? group.totalPrice : group.totalPriceWithoutTax) | price(currency) }}
42
42
  </strong>
43
- = {{ group.amount }} x {{ (displayPricingWithTax ? group.price : group.priceWithoutTax) | price(currency) }}
43
+ = {{ group.amount }} x {{ (priceIncludeGST ? group.price : group.priceWithoutTax) | price(currency) }}
44
44
  </span>
45
45
  <strong v-else>
46
- {{ (displayPricingWithTax ? group.totalPrice : group.totalPriceWithoutTax) | price(currency) }}
46
+ {{ (priceIncludeGST ? group.totalPrice : group.totalPriceWithoutTax) | price(currency) }}
47
47
  </strong>
48
48
  </td>
49
49
  </tr>
@@ -58,7 +58,7 @@
58
58
  </td>
59
59
  <td>
60
60
  <strong>
61
- {{ (displayPricingWithTax ? productPricing.products.prints.totalPrice : productPricing.products.prints.totalPriceWithoutTax) | price(currency) }}
61
+ {{ (priceIncludeGST ? productPricing.products.prints.totalPrice : productPricing.products.prints.totalPriceWithoutTax) | price(currency) }}
62
62
  </strong>
63
63
  </td>
64
64
  </tr>
@@ -80,12 +80,13 @@ export default {
80
80
  sizesRange
81
81
  },
82
82
  computed: {
83
- ...mapGetters(['displayPricingWithTax', 'pricingSettings']),
83
+ ...mapGetters(['pricingSettings']),
84
84
  ...mapGetters('product', [
85
85
  'product',
86
86
  'usedSimpleProducts',
87
87
  'productPricing',
88
- 'mainProductPricing'
88
+ 'mainProductPricing',
89
+ 'priceIncludeGST'
89
90
  ]),
90
91
  hasPrintSurcharge() {
91
92
  return this.product.printSurcharge > 0;
@@ -31,13 +31,20 @@
31
31
  {{ group.sizes | sizesRange }}
32
32
  </td>
33
33
  <td>
34
- <span class="EditorPricingDetailsProducts__hoverable">
34
+ <span
35
+ v-if="priceIncludeGST"
36
+ class="EditorPricingDetailsProducts__hoverable">
35
37
  {{ groupPrice | priceWithTax(pricingSettings, currency) }}
36
38
  </span>
39
+ <span
40
+ v-else
41
+ class="EditorPricingDetailsProducts__hoverable">
42
+ {{ groupPrice | price(currency) }}
43
+ </span>
37
44
  </td>
38
45
  <td>
39
46
  <strong>
40
- {{ (displayPricingWithTax ? group.totalPrice : group.totalPriceWithoutTax) | price(currency) }}
47
+ {{ (priceIncludeGST ? group.totalPrice : group.totalPriceWithoutTax) | price(currency) }}
41
48
  </strong>
42
49
  </td>
43
50
  </tr>
@@ -47,7 +54,7 @@
47
54
  </td>
48
55
  <td>
49
56
  <strong>
50
- {{ (displayPricingWithTax ? productPricing.products.products.totalPrice : productPricing.products.products.totalPriceWithoutTax) | price(currency) }}
57
+ {{ (priceIncludeGST ? productPricing.products.products.totalPrice : productPricing.products.products.totalPriceWithoutTax) | price(currency) }}
51
58
  </strong>
52
59
  </td>
53
60
  </tr>
@@ -69,12 +76,13 @@ export default {
69
76
  sizesRange
70
77
  },
71
78
  computed: {
72
- ...mapGetters(['displayPricingWithTax', 'pricingSettings']),
79
+ ...mapGetters(['pricingSettings']),
73
80
  ...mapGetters('product', [
74
81
  'product',
75
82
  'usedSimpleProducts',
76
83
  'mainProductPricing',
77
- 'productPricing'
84
+ 'productPricing',
85
+ 'priceIncludeGST'
78
86
  ]),
79
87
  hasUsedSimpleProducts() {
80
88
  return this.usedSimpleProducts.length > 0;
@@ -47,4 +47,10 @@
47
47
  text-align: center;
48
48
  }
49
49
  }
50
+ &__available-warning {
51
+ background-color: $error;
52
+ color: $white;
53
+ padding: 10px;
54
+ margin-top: 10px;
55
+ }
50
56
  }
@@ -61,8 +61,13 @@
61
61
  </div>
62
62
  </div>
63
63
  </div>
64
+ <div
65
+ v-if="!productAvailableInCurrentCountry"
66
+ class="EditorProductDetails__available-warning">
67
+ Product Not Available in {{ country.name }}
68
+ </div>
64
69
  <fragment
65
- v-if="productDetailsLoaded">
70
+ v-if="productDetailsLoaded && productAvailableInCurrentCountry">
66
71
  <div class="EditorProductDetails__section">
67
72
  <product-colors-selector />
68
73
  </div>
@@ -112,8 +117,13 @@ export default {
112
117
  'layerThumbnails'
113
118
  ]),
114
119
  ...mapGetters([
115
- 'pricingSettings'
120
+ 'pricingSettings',
121
+ 'country'
116
122
  ]),
123
+ productAvailableInCurrentCountry() {
124
+ const { countries } = this.product;
125
+ return !(countries || []).length || countries.includes(this.country._id);
126
+ },
117
127
  productLink() {
118
128
  return generateProductLink(this.product);
119
129
  },
@@ -111,7 +111,7 @@ export default {
111
111
  </script>
112
112
 
113
113
  <style lang="scss">
114
- @import "@lancom/shared/assets/scss/variables";
114
+ @import "@/assets/scss/variables";
115
115
  $types: delivery, general, other, printing, garments;
116
116
  .FAQ {
117
117
  &__wrapper {
@@ -218,7 +218,7 @@ $types: delivery, general, other, printing, garments;
218
218
  &-body {
219
219
  padding: 6px 30px 24px 30px;
220
220
  line-height: 27px;
221
- color: $gray;
221
+ color: $grey_1;
222
222
  overflow: hidden;
223
223
  @import "@lancom/shared/assets/scss/normalize";
224
224
  }
@@ -127,11 +127,11 @@
127
127
  {{ errors[0] }}
128
128
  </span>
129
129
  </validation-provider>
130
- <div class="form-row">
130
+ <div v-if="suburb" class="form-row">
131
131
  <input
132
132
  id="country"
133
133
  ref="country"
134
- value="Only Australia"
134
+ :value="suburb.country"
135
135
  name="country"
136
136
  type="country"
137
137
  class="form-field filled labelless"
@@ -303,6 +303,9 @@ export default {
303
303
  mounted() {
304
304
  if (this.orderData) {
305
305
  this.form = {
306
+ state: null,
307
+ country: null,
308
+ postcode: null,
306
309
  city: this.orderData.city,
307
310
  phone: this.orderData.phone,
308
311
  addressLine1: this.orderData.addressLine1,
@@ -325,16 +328,27 @@ export default {
325
328
  ...mapActions('cart', [
326
329
  'calculateCartPrice'
327
330
  ]),
331
+ setAddressSuburb(suburb) {
332
+ this.$set(this.form, 'suburb', suburb);
333
+ if (suburb) {
334
+ this.$set(this.form, 'state', suburb.state);
335
+ this.$set(this.form, 'postcode', suburb.postcode);
336
+ this.$set(this.form, 'city', suburb.locality);
337
+ this.$set(this.form, 'country', suburb.country);
338
+ }
339
+ },
328
340
  handleSuburbChange(suburb) {
329
341
  this.form.suburb = suburb;
342
+ this.setAddressSuburb(suburb);
330
343
  this.setSuburb(suburb);
331
- this.calculateCartPrice({ shop: this.shop });
344
+ this.calculateCartPrice({ shop: this.shop, country: this.country });
332
345
  },
333
346
  back() {
334
347
  this.switchModal('showCartModal');
335
348
  },
336
349
  async submit() {
337
350
  try {
351
+ debugger;
338
352
  this.processing = true;
339
353
  const recaptchaToken = await this.getRecaptcha('create_order');
340
354
  await this.createOrder({
@@ -25,19 +25,20 @@
25
25
  <b>Delivery:</b> {{ price.shipping.totalPriceWithoutTax | price(currency) }} ({{ price.shipping.weight }})
26
26
  </div>
27
27
  <div class="lc_caption OrderPrice__row">
28
- <b>Order amount ex GST:</b> {{ price.totalPriceWithoutTax | price(currency) }}
28
+ <b>Order amount ex {{ taxName }}:</b> {{ price.totalPriceWithoutTax | price(currency) }}
29
29
  </div>
30
30
  <div class="lc_caption OrderPrice__row">
31
- <b>GST:</b> {{ price.tax.totalPrice | price(currency) }} ({{ price.tax.percent }})
31
+ <b>{{ taxName }}:</b> {{ price.tax.totalPrice | price(currency) }} ({{ price.tax.percent }})
32
32
  </div>
33
33
  <div class="lc_caption OrderPrice__row">
34
- <b>Order amount inc GST:</b> {{ price.totalPrice | price(currency) }}
34
+ <b>Order amount inc {{ taxName }}:</b> {{ price.totalPrice | price(currency) }}
35
35
  </div>
36
36
  </div>
37
37
  </div>
38
38
  </template>
39
39
 
40
40
  <script>
41
+ import { mapGetters } from 'vuex';
41
42
  import { groupProductsPrintsBySize } from '@lancom/shared/assets/js/utils/products-grouping';
42
43
  import { price, print } from '@lancom/shared/assets/js/utils/filters';
43
44
 
@@ -51,6 +52,7 @@ export default {
51
52
  }
52
53
  },
53
54
  computed: {
55
+ ...mapGetters(['taxName']),
54
56
  price() {
55
57
  return this.order.price;
56
58
  },