@lancom/shared 0.0.441 → 0.0.443

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.
@@ -323,6 +323,12 @@ export default {
323
323
  removeProduct(id) {
324
324
  return _delete(`admin/products/${id}`);
325
325
  },
326
+ importProductJson(productData) {
327
+ return _post('admin/products/import-json', productData);
328
+ },
329
+ importProductImagesJson(productId, images) {
330
+ return _post(`admin/products/${productId}/import-images-json`, { images });
331
+ },
326
332
  fetchProductsKits(params) {
327
333
  return _get('admin/products-kit', params);
328
334
  },
@@ -49,6 +49,9 @@ export default {
49
49
  },
50
50
  isNotValidPrintsBigSizeQuantity() {
51
51
  return this.simpleProductsQuantity ? ((this.bigSizeSimpleProductsQuantity / this.simpleProductsQuantity * 100) > 50) : false;
52
+ },
53
+ hasClearanceProduct() {
54
+ return this.entities.some(entity => entity.product?.isClearance || entity.simpleProducts?.some(sp => sp.pricing?.some(p => p?.clearance)));
52
55
  }
53
56
  },
54
57
  watch: {
@@ -18,8 +18,17 @@
18
18
  color: $error;
19
19
  font-size: 13px;
20
20
  }
21
+ &__clearance-checkbox {
22
+ padding-bottom: 10px;
23
+ }
24
+ &__clearance-text {
25
+ font-size: 14px;
26
+ font-weight: 500;
27
+ line-height: 20px;
28
+ margin-left: 10px;
29
+ }
21
30
  // &__total-info {
22
31
  // position: sticky;
23
32
  // top: 130px;
24
33
  // }
25
- }
34
+ }
@@ -41,9 +41,18 @@
41
41
  <div class="Cart__quantity-errors">
42
42
  <cart-quantity-errors />
43
43
  </div>
44
+
45
+ <div
46
+ v-if="hasClearanceProduct"
47
+ class="Cart__clearance-checkbox mt-10">
48
+ <checkbox v-model="clearanceAccepted">
49
+ <span class="Cart__clearance-text">Confirm clearance products are non-returnable.</span>
50
+ </checkbox>
51
+ </div>
52
+
44
53
  <div class="mt-10">
45
54
  <btn
46
- :btn-disabled="isNotValidShipping || isNotValidQuantity || cartPricingError || cartPricingCalculating"
55
+ :btn-disabled="isCheckoutDisabled"
47
56
  :btn-block="true"
48
57
  :to="'/checkout/order'"
49
58
  btn-class="green"
@@ -82,6 +91,7 @@ import { price } from '@lancom/shared/assets/js/utils/filters';
82
91
  import CartMixin from '@lancom/shared/components/checkout/cart/cart.mixin';
83
92
  import CartPriceInfo from '@lancom/shared/components/checkout/cart/cart_price_info/cart-price-info';
84
93
  import CartShipping from '@lancom/shared/components/checkout/cart/cart_shipping/cart-shipping';
94
+ import Checkbox from '@lancom/shared/components/common/checkbox';
85
95
 
86
96
  export default {
87
97
  name: 'CheckoutCart',
@@ -91,15 +101,21 @@ export default {
91
101
  CartPriceInfo,
92
102
  CartQuantityErrors,
93
103
  CouponSelect,
94
- CartShipping
104
+ CartShipping,
105
+ Checkbox
95
106
  },
96
107
  filters: { price },
97
108
  mixins: [CartMixin],
109
+ data() {
110
+ return {
111
+ clearanceAccepted: false
112
+ };
113
+ },
98
114
  computed: {
99
115
  ...mapGetters(['MESSAGES', 'SETTINGS', 'currency', 'country']),
100
- ...mapGetters('cart', ['isEmpty','cartPricingError', 'cartPricing', 'cartPricingCalculating', 'entities', 'entitiesWithoutFreeProducts']),
116
+ ...mapGetters('cart', ['isEmpty', 'cartPricingError', 'cartPricing', 'cartPricingCalculating', 'entities', 'entitiesWithoutFreeProducts']),
101
117
  productsEntities() {
102
- return this.entitiesWithoutFreeProducts.filter(e => !e.productsKit)
118
+ return this.entitiesWithoutFreeProducts.filter(e => !e.productsKit);
103
119
  },
104
120
  productsKitsEntities() {
105
121
  const entities = this.entitiesWithoutFreeProducts.filter(e => !!e.productsKit);
@@ -126,6 +142,9 @@ export default {
126
142
  this.setCoupon(coupon);
127
143
  this.calculateCartPrice({ shop: this.shop, country: this.country, currency: this.currency });
128
144
  }
145
+ },
146
+ isCheckoutDisabled() {
147
+ return this.isNotValidShipping || this.isNotValidQuantity || this.cartPricingError || this.cartPricingCalculating || (this.hasClearanceProduct && !this.clearanceAccepted);
129
148
  }
130
149
  },
131
150
  methods: {
@@ -54,6 +54,10 @@ export default {
54
54
  const { totalPriceWithoutTax = 0 } = this.cartEntityPricing;
55
55
  return totalPriceWithoutTax;
56
56
  },
57
+ totalPriceWithTax() {
58
+ const { totalPrice = 0 } = this.cartEntityPricing;
59
+ return totalPrice;
60
+ },
57
61
  printsTotalPrice() {
58
62
  const { prints = {} } = this.cartEntityPricing;
59
63
  return prints.totalPriceWithoutTax || 0;
@@ -57,6 +57,10 @@
57
57
  text-align: right;
58
58
  margin-top: 24px;
59
59
  }
60
+ &__subtotal2 {
61
+ text-align: right;
62
+ margin-top: 5px;
63
+ }
60
64
  &__item {
61
65
  border-bottom: 1px solid #F4F4F4;
62
66
  &:first-child {
@@ -71,4 +75,4 @@
71
75
  padding: 16px;
72
76
  margin-top: 16px;
73
77
  }
74
- }
78
+ }
@@ -83,6 +83,9 @@
83
83
  <div class="CartEntity__subtotal lc_title">
84
84
  Subtotal: {{ totalPrice | price(currency) }}
85
85
  </div>
86
+ <div class="CartEntity__subtotal2 lc_title">
87
+ Subtotal inc. {{ taxName }}: {{ totalPriceWithTax | price(currency) }}
88
+ </div>
86
89
  <i
87
90
  v-if="editable"
88
91
  class="icon-delete CartEntity__remove"
@@ -92,6 +95,7 @@
92
95
  </template>
93
96
 
94
97
  <script>
98
+ import { mapGetters } from 'vuex';
95
99
  import { price } from '@lancom/shared/assets/js/utils/filters';
96
100
  import CartEntityPrints from './cart_entity_prints/cart-entity-prints';
97
101
  import CartCouponFreeProducts from './cart_coupon_free_products/cart-coupon-free-products';
@@ -110,7 +114,10 @@ export default {
110
114
  },
111
115
  mixins: [
112
116
  CartEntity
113
- ]
117
+ ],
118
+ computed: {
119
+ ...mapGetters(['taxName'])
120
+ }
114
121
  };
115
122
  </script>
116
123
 
@@ -67,7 +67,7 @@ export default {
67
67
  },
68
68
  additionalInfo() {
69
69
  return this.displayAddress.additionalInfo;
70
- },
70
+ },
71
71
  purchaseOrderNumber() {
72
72
  return this.invoice?.purchaseOrderNumber || this.order.purchaseOrderNumber;
73
73
  },
@@ -98,7 +98,7 @@ export default {
98
98
  return tax(this.model.total, this.gstTax) - this.model.total;
99
99
  },
100
100
  taxName() {
101
- return this.settings?.pricing?.taxName || 'GST'
101
+ return this.settings?.pricing?.taxName || 'GST';
102
102
  },
103
103
  paymentCard() {
104
104
  if (this.model.charge?.card) {
@@ -8,7 +8,7 @@
8
8
  :class="{ selected: editableColor === color }"
9
9
  @click="toggleSelection(color)">
10
10
  <i
11
- v-if="isClearanceColor(color)"
11
+ v-if="product.isClearance || isClearanceColor(color)"
12
12
  v-tooltip="'Clearance'"
13
13
  class="icon-percent"></i>
14
14
  <product-color-image
@@ -56,7 +56,13 @@
56
56
  font-weight: 600;
57
57
  color: $grey_1;
58
58
  text-align: center;
59
- background-color: white;
59
+ }
60
+ &--selected {
61
+ color: white !important;
62
+ background-color: $green !important;
63
+ .CategoryCard__name {
64
+ color: white !important;
65
+ }
60
66
  }
61
67
 
62
68
  @media (max-width: $bp-extra-small-max) {
@@ -1,23 +1,26 @@
1
1
  <template>
2
2
  <div class="ChildrenCategories__wrapper">
3
3
  <div
4
- v-for="category in childrenCategories"
5
- :key="category._id"
6
- class="CategoryCard">
4
+ v-for="cat in childrenCategories"
5
+ :key="cat._id"
6
+ class="CategoryCard"
7
+ :class="{
8
+ 'CategoryCard--selected': category && category._id === cat._id
9
+ }">
7
10
  <a
8
- :href="generateProductsLink($route, { category }, true)"
11
+ :href="generateProductsLink($route, { category: cat }, true)"
9
12
  class="CategoryCard__link">
10
13
  <span
11
14
  v-if="visibleImages"
12
15
  class="CategoryCard__image-wrapper">
13
16
  <img
14
- v-if="category.image"
15
- :src="category.image.medium"
16
- :alt="category.name"
17
+ v-if="cat.image"
18
+ :src="cat.image.medium"
19
+ :alt="cat.name"
17
20
  class="CategoryCard__image" />
18
21
  </span>
19
22
  <span class="CategoryCard__name">
20
- {{ category.name }}
23
+ {{ cat.name }}
21
24
  </span>
22
25
  </a>
23
26
  </div>
@@ -37,7 +40,7 @@ export default {
37
40
  }
38
41
  },
39
42
  computed: {
40
- ...mapGetters('products', ['childrenCategories'])
43
+ ...mapGetters('products', ['childrenCategories', 'category'])
41
44
  },
42
45
  methods: {
43
46
  generateProductsLink
@@ -21,16 +21,13 @@
21
21
  &:last-child {
22
22
  border-bottom: none;
23
23
  margin-bottom: 0px;
24
+ padding-bottom: 0px;
24
25
  }
25
26
  ::v-deep {
26
27
  a {
27
28
  color: $gray_main;
28
- font-size: 13px;
29
29
  text-decoration: none;
30
30
  }
31
- a:hover {
32
- font-weight: bold;
33
- }
34
31
  }
35
32
  &-all {
36
33
  border-top: 1px solid $gray_main;
@@ -70,4 +67,4 @@
70
67
  }
71
68
  }
72
69
  }
73
- }
70
+ }
@@ -1,3 +1,58 @@
1
- .ProductListProduct__link {
1
+ @import "@/assets/scss/variables";
2
+
3
+ .ProductsAutocompleteItem {
4
+ &__wrapper {
2
5
  display: block;
3
- }
6
+ }
7
+ &__link {
8
+ display: flex;
9
+ align-items: center;
10
+ gap: 12px;
11
+ text-decoration: none;
12
+ color: $gray_main;
13
+ &:hover {
14
+ .ProductsAutocompleteItem__name {
15
+ font-weight: 600;
16
+ }
17
+ }
18
+ }
19
+ &__image {
20
+ flex-shrink: 0;
21
+ width: 50px;
22
+ height: 50px;
23
+ display: flex;
24
+ align-items: center;
25
+ justify-content: center;
26
+ background-color: $white;
27
+ border: 1px solid $medium_gray;
28
+ border-radius: 4px;
29
+ overflow: hidden;
30
+ img {
31
+ max-width: 100%;
32
+ max-height: 100%;
33
+ object-fit: contain;
34
+ display: block;
35
+ }
36
+ }
37
+ &__info {
38
+ flex: 1;
39
+ min-width: 0;
40
+ display: flex;
41
+ flex-direction: column;
42
+ gap: 4px;
43
+ }
44
+ &__sku {
45
+ font-size: 11px;
46
+ color: $grey_1;
47
+ font-weight: 500;
48
+ text-transform: uppercase;
49
+ margin-top: 3px;
50
+ }
51
+ &__name {
52
+ font-size: 17px;
53
+ color: $gray_main;
54
+ overflow: hidden;
55
+ text-overflow: ellipsis;
56
+ white-space: nowrap;
57
+ }
58
+ }
@@ -1,9 +1,19 @@
1
1
  <template>
2
- <div @click="$emit('select', product)">
2
+ <div class="ProductsAutocompleteItem__wrapper" @click="$emit('select', product)">
3
3
  <a
4
4
  :href="productLink"
5
- class="ProductListProduct__link">
6
- {{ product.SKU }} - {{ product.name }}
5
+ class="ProductsAutocompleteItem__link">
6
+ <div
7
+ v-if="productСover"
8
+ class="ProductsAutocompleteItem__image">
9
+ <img
10
+ :src="productСover"
11
+ :alt="product.name" />
12
+ </div>
13
+ <div class="ProductsAutocompleteItem__info">
14
+ <div class="ProductsAutocompleteItem__name">{{ product.name }}</div>
15
+ <div class="ProductsAutocompleteItem__sku">{{ product.SKU }}</div>
16
+ </div>
7
17
  </a>
8
18
  </div>
9
19
  </template>
@@ -102,7 +102,7 @@ async function googleShoppingFeed(axios, config, availableStores, country, isEdi
102
102
  info['g:gtin'] = { _text: sp.gtin || '' };
103
103
  }
104
104
 
105
- if (sp.clearancePrice > 0) {
105
+ if (sp.clearancePrice > 0 || product.isClearance) {
106
106
  info['g:sale_price'] = { _text: `${(sp.clearancePrice)} ${sp.currencyCode || 'AUD'}` };
107
107
  }
108
108
 
@@ -179,8 +179,9 @@ async function googleShoppingFeed(axios, config, availableStores, country, isEdi
179
179
  }
180
180
  }
181
181
 
182
- if (product.feedLifestyleImage) {
183
- info['g:lifestyle_image_link'] = { _text: staticLink(product.feedLifestyleImage, config) };
182
+ const feedLifestyleImage = product.feedLifestyleImage || filterImagesByType('model')[0];
183
+ if (feedLifestyleImage) {
184
+ info['g:lifestyle_image_link'] = { _text: staticLink(feedLifestyleImage, config) };
184
185
  }
185
186
 
186
187
  if (product.feedAgeGroup) {
@@ -11,7 +11,6 @@ export default {
11
11
  async fetch() {
12
12
  await this.loadProducts();
13
13
 
14
- console.log('fetchChildrenCategories: ', this.page, this.currentCategory);
15
14
  if (this.page === 1) {
16
15
  await this.fetchChildrenCategories(this.currentCategory);
17
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lancom/shared",
3
- "version": "0.0.441",
3
+ "version": "0.0.443",
4
4
  "description": "lancom common scripts",
5
5
  "author": "e.tokovenko <e.tokovenko@gmail.com>",
6
6
  "repository": {