@lancom/shared 0.0.266 → 0.0.267

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 (52) 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 +1 -3
  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 +3 -4
  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/file_uploader.vue +1 -0
  13. package/components/common/payment/payment_card/pinpayment/pinpayment.vue +5 -34
  14. package/components/common/postcode_select/postcode-select.vue +1 -5
  15. package/components/common/products_total_pricing/products-total-pricing.vue +1 -5
  16. package/components/design/approve_design_header/approve-design-header.vue +1 -1
  17. package/components/editor/editor.vue +2 -8
  18. package/components/editor/editor_pricing/editor-pricing.vue +2 -2
  19. package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_prints/editor-pricing-details-prints.vue +7 -8
  20. package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_products/editor-pricing-details-products.vue +4 -12
  21. package/components/editor/editor_product_details/editor-product-details.scss +0 -6
  22. package/components/editor/editor_product_details/editor-product-details.vue +2 -12
  23. package/components/faq/faq.vue +2 -2
  24. package/components/modals/order_modal/order-modal.vue +3 -17
  25. package/components/order/order_price/order-price.vue +3 -5
  26. package/components/order/order_prints_groups/order-prints-groups.vue +1 -3
  27. package/components/order/order_products_groups/order-products-groups.vue +1 -3
  28. package/components/order/order_refund_view/order-refund-view.vue +3 -5
  29. package/components/order/order_setup_groups/order-setup-groups.vue +2 -4
  30. package/components/order/order_sku_groups/order-sku-groups.vue +1 -3
  31. package/components/order/order_view/order-view.vue +6 -10
  32. package/components/pricing/pricing_digital_printing/pricing-digital-printing.vue +1 -3
  33. package/components/pricing/pricing_example/pricing-example.vue +3 -3
  34. package/components/pricing/pricing_how_we_calculate/pricing-how-we-calculate.vue +2 -7
  35. package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing-product-calculator.vue +2 -2
  36. package/components/pricing/pricing_screen_printing/pricing-screen-printing.vue +1 -3
  37. package/components/product/product_multipacks_carousel/product-multipacks-carousel.scss +29 -19
  38. package/components/product/product_multipacks_carousel/product-multipacks-carousel.vue +42 -3
  39. package/components/product/product_multipacks_carousel/product_multipack/product-multipack.scss +14 -14
  40. package/components/product/product_multipacks_carousel/product_multipack/product-multipack.vue +13 -18
  41. package/components/product/product_price_range/product-price-range.vue +5 -6
  42. package/components/product/product_prints_price_info/product-prints-price-info.vue +2 -2
  43. package/components/products/products_autocomplete/products-autocomplete.scss +12 -10
  44. package/components/quotes/quote_request/quote-request.vue +1 -1
  45. package/components/quotes/quote_view/quote_option_view/quote-option-view.vue +4 -5
  46. package/feeds/google-shopping.js +2 -2
  47. package/mixins/meta-info.js +1 -4
  48. package/mixins/products-price.js +2 -3
  49. package/package.json +1 -1
  50. package/store/cart.js +6 -7
  51. package/store/index.js +5 -16
  52. package/store/product.js +9 -3
@@ -10,21 +10,20 @@
10
10
  right: 0;
11
11
  top: 41px;
12
12
  padding: 10px;
13
- background-color: white;
14
- border: 1px solid $medium_gray;
15
- z-index: 999;
13
+ background-color: $black;
14
+ color: $white;
16
15
  }
17
16
  &__result-item {
18
17
  padding-bottom: 10px;
19
18
  margin-bottom: 10px;
20
- border-bottom: 1px solid $medium_gray;
19
+ border-bottom: 1px solid $gray_main;
21
20
  &:last-child {
22
21
  border-bottom: none;
23
22
  margin-bottom: 0px;
24
23
  }
25
24
  ::v-deep {
26
25
  a {
27
- color: $gray_main;
26
+ color: $white;
28
27
  font-size: 13px;
29
28
  text-decoration: none;
30
29
  }
@@ -34,22 +33,24 @@
34
33
  padding: 10px;
35
34
  text-align: center;
36
35
  display: block;
37
- background-color: $black;
38
- color: $white !important;
36
+ background-color: $white;
39
37
  &:hover {
40
- background-color: $white;
41
- color: $black !important;
38
+ background-color: $black;
39
+ color: $white;
42
40
  }
43
41
  }
44
42
  }
45
43
  &__input {
46
44
  input {
47
- border-color: $medium_gray;
45
+ background-color: #535353;
46
+ border: none;
48
47
  border-radius: 0px;
48
+ color: $white;
49
49
  height: 41px;
50
50
  position: relative;
51
51
  z-index: 1;
52
52
  &::placeholder {
53
+ font-weight: 600;
53
54
  font-size: 14px;
54
55
  color: $grey_3;
55
56
  }
@@ -60,6 +61,7 @@
60
61
  right: 10px;
61
62
  font-size: 17px;
62
63
  pointer-events: none;
64
+ color: $white;
63
65
  &.icon-search {
64
66
  z-index: 2;
65
67
  pointer-events: all;
@@ -354,7 +354,7 @@ export default {
354
354
  email: '',
355
355
  phone: '',
356
356
  suburb: null,
357
- country: null
357
+ country: 'Australia'
358
358
  },
359
359
  expectedItemsQuantity: null,
360
360
  description: '',
@@ -11,9 +11,9 @@
11
11
  <div>Products Total: <b>{{ option.productsTotal | price(currency) }}</b></div>
12
12
  <div>Prints Total: <b>{{ option.printsTotal | price(currency) }}</b></div>
13
13
  <div>Shipping Total: <b>{{ option.shippingTotal | price(currency) }}</b></div>
14
- <div>Total ex {{ taxName }}: <b>{{ option.total | price(currency) }}</b></div>
15
- <div>{{ taxName }}: <b>{{ optionGst(option) | price(currency) }}</b></div>
16
- <div>Total inc {{ taxName }}: <b>{{ option.total | tax(gstTax) | price(currency) }}</b></div>
14
+ <div>Total ex GST: <b>{{ option.total | price(currency) }}</b></div>
15
+ <div>GST: <b>{{ optionGst(option) | price(currency) }}</b></div>
16
+ <div>Total inc GST: <b>{{ option.total | tax(gstTax) | price(currency) }}</b></div>
17
17
  </div>
18
18
  </div>
19
19
  </template>
@@ -40,8 +40,7 @@ export default {
40
40
  },
41
41
  computed: {
42
42
  ...mapGetters([
43
- 'gstTax',
44
- 'taxName'
43
+ 'gstTax'
45
44
  ])
46
45
  },
47
46
  methods: {
@@ -96,10 +96,10 @@ async function googleShoppingFeed(axios, config, availableStores) {
96
96
  }
97
97
  if (product.volume) {
98
98
  if (product.volume.length) {
99
- info['g:shipping_length'] = { _text: `${parseInt(product.volume.length * (sp.multipackQty || 1))} cm` };
99
+ info['g:shipping_length'] = { _text: `${parseInt(product.volume.length)} cm` };
100
100
  }
101
101
  if (product.volume.width) {
102
- info['g:shipping_width'] = { _text: `${parseInt(product.volume.width * (sp.multipackQty || 1))} cm` };
102
+ info['g:shipping_width'] = { _text: `${parseInt(product.volume.width)} cm` };
103
103
  }
104
104
  if (product.volume.height) {
105
105
  info['g:shipping_height'] = { _text: `${parseInt(product.volume.height * (sp.multipackQty || 1))} cm` };
@@ -34,10 +34,7 @@ const metaInfo = {
34
34
  }
35
35
  },
36
36
  head() {
37
- const hasQueryParams = Object
38
- .keys(this.$route.query || {})
39
- .filter(key => !['color', 'store'].includes(`${key || ''}`.toLowerCase()))
40
- .length > 0;
37
+ const hasQueryParams = Object.keys(this.$route.query || {}).length > 0;
41
38
 
42
39
  const { short_text: shortText, image, meta = {} } = this.routeInfo || {};
43
40
  const pageItemMeta = this.pageItem?.meta || {};
@@ -22,7 +22,7 @@ const productsPrice = {
22
22
  };
23
23
  },
24
24
  computed: {
25
- ...mapGetters(['pricingSettings', 'shop', 'country']),
25
+ ...mapGetters(['pricingSettings', 'shop']),
26
26
  printsPricing() {
27
27
  const pricing = {};
28
28
  if (this.productPricing) {
@@ -72,8 +72,7 @@ const productsPrice = {
72
72
  const playload = {
73
73
  products: this.calcProducts,
74
74
  postcode: this.postcode,
75
- screenPrint: this.screenPrint,
76
- country: this.country?._id
75
+ screenPrint: this.screenPrint
77
76
  };
78
77
  this.productPricing = await api.calculateProductPrice(playload, this.shop._id);
79
78
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lancom/shared",
3
- "version": "0.0.266",
3
+ "version": "0.0.267",
4
4
  "description": "lancom common scripts",
5
5
  "author": "e.tokovenko <e.tokovenko@gmail.com>",
6
6
  "repository": {
package/store/cart.js CHANGED
@@ -148,9 +148,9 @@ export const actions = {
148
148
  await api.saveCart(payload, shop._id);
149
149
  commit('setEntities', entities);
150
150
  },
151
- async calculateCartPrice({ state: { suburb, entities, coupon, cartPricing }, commit }, { shop, country }) {
151
+ async calculateCartPrice({ state: { suburb, entities, coupon, cartPricing }, commit }, { shop }) {
152
152
  const selectedSuppliersWithRates = cartPricing?.shipping?.suppliersWithRates;
153
- const payload = generateCalculatePriceData(entities, suburb, null, coupon, selectedSuppliersWithRates, country);
153
+ const payload = generateCalculatePriceData(entities, suburb, null, coupon, selectedSuppliersWithRates);
154
154
  try {
155
155
  commit('setCartPricingCalculating', true);
156
156
  const response = await api.calculateProductPrice(payload, shop._id);
@@ -179,7 +179,7 @@ export const actions = {
179
179
  clearCart({ commit }) {
180
180
  commit('clearCart');
181
181
  },
182
- async selectRate({ state: { cartPricing, entities, suburb, coupon }, commit }, { supplier, rate, shop, country }) {
182
+ async selectRate({ state: { cartPricing, entities, suburb, coupon }, commit }, { supplier, rate, shop }) {
183
183
  const suppliersWithRates = cartPricing.shipping.suppliersWithRates
184
184
  .map(supplierWithRates => ({
185
185
  ...(
@@ -190,7 +190,7 @@ export const actions = {
190
190
  })
191
191
  : supplierWithRates)
192
192
  }));
193
- const payload = generateCalculatePriceData(entities, suburb, suppliersWithRates, coupon, null, country);
193
+ const payload = generateCalculatePriceData(entities, suburb, suppliersWithRates, coupon);
194
194
  try {
195
195
  commit('setCartPricingCalculating', true);
196
196
  const response = await api.calculateProductPrice(payload, shop._id);
@@ -245,7 +245,7 @@ export const mutations = {
245
245
  }
246
246
  };
247
247
 
248
- function generateCalculatePriceData(entities, suburb, suppliersWithRates, coupon, selectedSuppliersWithRates, country) {
248
+ function generateCalculatePriceData(entities, suburb, suppliersWithRates, coupon, selectedSuppliersWithRates) {
249
249
  const getSimpleObj = i => i && ({ _id: i._id, name: i.name });
250
250
  return {
251
251
  entities: entities.map(({ _id, guid, prints, simpleProducts, product }) => ({
@@ -285,7 +285,6 @@ function generateCalculatePriceData(entities, suburb, suppliersWithRates, coupon
285
285
  address: suburb ? [suburb.locality, suburb.state, suburb.postcode].filter(i => !!i).join(', ') : null,
286
286
  coupon,
287
287
  suppliersWithRates,
288
- selectedSuppliersWithRates,
289
- country: country?._id
288
+ selectedSuppliersWithRates
290
289
  };
291
290
  }
package/store/index.js CHANGED
@@ -35,7 +35,6 @@ export const getters = {
35
35
  pricingSettings: ({ pricing }) => pricing || {},
36
36
  orderSettings: ({ orderInfo }) => orderInfo || {},
37
37
  gstTax: ({ pricing }) => pricing?.gstTax || 0,
38
- taxName: ({ pricing }) => pricing?.taxName || 'GST',
39
38
  displayPricingWithTax: ({ pricing }) => !!pricing?.displayPricingWithTax,
40
39
  screenPrintsPrices: ({ pricing }) => pricing?.screenPrintsPrices || {},
41
40
  depositInfo: ({ depositInfo }) => depositInfo || {}
@@ -56,15 +55,14 @@ export const actions = {
56
55
  commit('setCountry', settings.country);
57
56
  commit('setCurrency', settings.currency);
58
57
 
59
- const countrySettings = (shop.countries || []).find(c => c.country?._id === settings.country?._id) || { settings: [] };
60
-
61
58
  if (process.env.PINPAYMENT_PUBLISHABLE_API_KEY) {
62
59
  commit('setPayment', {
63
60
  type: 'pinpayment',
64
61
  clientKey: process.env.PINPAYMENT_PUBLISHABLE_API_KEY
65
62
  });
66
63
  } else {
67
- const countrySetting = (countrySettings?.settings || []).find(s => !!s.settings.app.STRIPE_PUBLIC_KEY);
64
+ const countrySettings = (shop.countries || []).find(c => c.country?._id === settings.country?._id) || { settings: [] };
65
+ const countrySetting = countrySettings.settings.find(s => !!s.settings.app.STRIPE_PUBLIC_KEY);
68
66
  if (countrySetting) {
69
67
  commit('setPayment', {
70
68
  type: 'stripe',
@@ -73,13 +71,6 @@ export const actions = {
73
71
  }
74
72
  }
75
73
 
76
-
77
- const pricingSetting = (countrySettings?.settings || []).find(s => !!s.settings.pricing);
78
- commit('setPricing', {
79
- ...shop.settings.pricing,
80
- ...(pricingSetting?.settings?.pricing || {})
81
- });
82
-
83
74
  // }
84
75
  try {
85
76
  if (req.headers.cookie) {
@@ -108,7 +99,7 @@ export const actions = {
108
99
  commit('cart/setCoupon', coupon);
109
100
  } catch (e) {}
110
101
  }
111
- dispatch('cart/calculateCartPrice', { shop, country });
102
+ dispatch('cart/calculateCartPrice', { shop });
112
103
  }
113
104
  }
114
105
  const closedNotification = localStorage.getItem(CLOSED_NOTIFICATION);
@@ -130,17 +121,15 @@ export const mutations = {
130
121
  setPayment(state, payment) {
131
122
  state.payment = payment;
132
123
  },
133
- setPricing(state, pricing) {
134
- state.pricing = pricing;
135
- },
136
124
  setCountry(state, country) {
137
125
  state.country = country;
138
126
  },
139
127
  setCurrency(state, currency) {
140
128
  state.currency = currency;
141
129
  },
142
- setSettings(state, { contacts, notificationBar, discountPopup, order, depositInfo }) {
130
+ setSettings(state, { contacts, pricing, notificationBar, discountPopup, order, depositInfo }) {
143
131
  state.contacts = contacts;
132
+ state.pricing = pricing;
144
133
  state.orderInfo = order;
145
134
  state.notificationBar = notificationBar;
146
135
  state.discountPopup = discountPopup;
package/store/product.js CHANGED
@@ -67,6 +67,7 @@ export const getters = {
67
67
  hasLayers: ({ template }) => (template.layers || []).length > 0,
68
68
  visibleSteps: ({ template }) => template.visibleSteps,
69
69
  simpleProducts: ({ template }) => template.simpleProducts || [],
70
+ editableColorSimpleProducts: ({ template, editableColor }) => (template.simpleProducts || []).filter(sp => sp.color._id === editableColor._id),
70
71
  usedSimpleProducts: ({ template }) => (template.simpleProducts || []).filter(p => p.amount > 0),
71
72
  usedSimpleProductsQuantity: ({ template }) => (template.simpleProducts || []).filter(p => p.amount > 0).reduce((sum, { amount }) => sum + amount, 0),
72
73
  usedBigSizeSimpleProductsQuantity: (state, { usedSimpleProducts }) => filterBigSize(usedSimpleProducts).reduce((sum, { amount }) => sum + amount, 0),
@@ -160,7 +161,6 @@ export const actions = {
160
161
  commit('setSelectedPrintArea', { printArea: first._id, size: first.printSize });
161
162
  }
162
163
  } catch (e) {
163
- console.log(e);
164
164
  const { status, data } = e?.response || {};
165
165
  const statusCode = status || 500;
166
166
  commit('setLoadError', {
@@ -200,10 +200,10 @@ export const actions = {
200
200
  async updatePriceIncludeGST({ commit }, value) {
201
201
  commit('setPriceIncludeGST', value);
202
202
  },
203
- async calculateProductPrice({ state: { template, product, isPrintPricing }, commit, getters }, { shop, country }) {
203
+ async calculateProductPrice({ state: { template, product, isPrintPricing }, commit, getters }, shop) {
204
204
  commit('setCalculatingPrice', true);
205
205
  const entities = getProductsForCalculatePricing(product, getters.usedSimpleProducts, template.layers, isPrintPricing, true);
206
- const response = await api.calculateProductPrice({ entities, country: country?._id }, shop._id);
206
+ const response = await api.calculateProductPrice({ entities }, shop._id);
207
207
  commit('setProductPricing', response);
208
208
  commit('setCalculatingPrice', false);
209
209
  },
@@ -410,6 +410,12 @@ export const mutations = {
410
410
  Vue.set(state.template.simpleProducts, index, simpleProduct);
411
411
  }
412
412
  },
413
+ clearSimpleProductsAmount(state) {
414
+ state.template.simpleProducts.forEach((simpleProduct, index) => {
415
+ Vue.set(simpleProduct, 'amount', 0);
416
+ Vue.set(state.template.simpleProducts, index, simpleProduct);
417
+ })
418
+ },
413
419
  setProductPricing(state, price) {
414
420
  state.productPricing = price;
415
421
  },