@lancom/shared 0.0.383 → 0.0.385
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 +12 -0
- package/assets/js/api/index.js +11 -1
- package/assets/js/utils/scroll.js +11 -0
- package/components/checkout/cart/cart.mixin.js +5 -1
- package/components/checkout/cart/cart.vue +32 -19
- package/components/checkout/cart/cart_entity/cart-entity.mixin.js +4 -0
- package/components/checkout/cart/cart_entity/cart-entity.vue +2 -0
- package/components/checkout/cart/cart_entity/cart_entity_color_simple_products/cart-entity-color-simple-products.vue +2 -0
- package/components/checkout/cart/cart_price_info/cart-price-info.vue +8 -53
- package/components/checkout/cart/cart_pricing/cart-pricing.scss +11 -3
- package/components/checkout/cart/cart_pricing/cart-pricing.vue +6 -2
- package/components/checkout/cart/cart_products_kit_entity/cart-products-kit-entity.scss +24 -0
- package/components/checkout/cart/cart_products_kit_entity/cart-products-kit-entity.vue +66 -0
- package/components/checkout/cart/cart_shipments_pricing/cart-shipments-pricing.scss +3 -0
- package/components/checkout/cart/cart_shipments_pricing/cart-shipments-pricing.vue +12 -2
- package/components/checkout/cart/cart_shipping/cart-shipping.scss +43 -0
- package/components/checkout/cart/cart_shipping/cart-shipping.vue +126 -0
- package/components/checkout/order/address-form/address-form.vue +5 -0
- package/components/checkout/order/order-billing-information/order-billing-information.vue +1 -0
- package/components/checkout/order/order-payment-information/order-payment-information.vue +9 -0
- package/components/common/number_input/number-input.scss +69 -0
- package/components/common/number_input/number-input.vue +97 -0
- package/components/common/payment/payment_card/applepay/applepay.scss +8 -0
- package/components/common/payment/payment_card/applepay/applepay.vue +16 -0
- package/components/common/payment/payment_card/payment-card.vue +7 -0
- package/components/common/postcode_select/postcode-select.scss +6 -0
- package/components/common/postcode_select/postcode-select.vue +16 -6
- package/components/common/pricing_discounts_table/pricing-discounts-table.vue +12 -2
- package/components/customer/customer_coupons/customer-coupons.scss +33 -0
- package/components/customer/customer_coupons/customer-coupons.vue +103 -0
- package/components/customer/customer_coupons/customer_coupon_apply/customer-coupon-apply.scss +1 -0
- package/components/customer/customer_coupons/customer_coupon_apply/customer-coupon-apply.vue +51 -0
- package/components/customer/customer_coupons/customer_coupon_prints/customer-coupon-prints.scss +1 -0
- package/components/customer/customer_coupons/customer_coupon_prints/customer-coupon-prints.vue +33 -0
- package/components/customer/customer_coupons/customer_coupon_prints/customer_coupon_print/customer-coupon-print.scss +19 -0
- package/components/customer/customer_coupons/customer_coupon_prints/customer_coupon_print/customer-coupon-print.vue +82 -0
- package/components/customer/customer_coupons/customer_coupon_products/customer-coupon-products.scss +1 -0
- package/components/customer/customer_coupons/customer_coupon_products/customer-coupon-products.vue +33 -0
- package/components/customer/customer_coupons/customer_coupon_products/customer_coupon_product/customer-coupon-product.scss +17 -0
- package/components/customer/customer_coupons/customer_coupon_products/customer_coupon_product/customer-coupon-product.vue +52 -0
- package/components/customer/customer_navigation_menu/customer-navigation-menu.vue +72 -0
- package/components/customer/customer_orders/customer-orders.scss +26 -12
- package/components/customer/customer_orders/customer-orders.vue +64 -33
- package/components/customer/customer_orders/customer_order_reorder/customer-order-reorder.scss +1 -0
- package/components/customer/customer_orders/customer_order_reorder/customer-order-reorder.vue +55 -0
- package/components/customer/customer_orders/customer_order_trackings/customer-order-trackings.scss +8 -0
- package/components/customer/customer_orders/customer_order_trackings/customer-order-trackings.vue +38 -0
- package/components/editor/editor.vue +4 -12
- package/components/editor/mobile_editor_product_details/mobile-editor-product-details.vue +2 -10
- package/components/products_kit/products_kit/products-kit.scss +54 -0
- package/components/products_kit/products_kit/products-kit.vue +47 -0
- package/components/products_kit/products_kit/products_kit_cart/products-kit-cart.scss +32 -0
- package/components/products_kit/products_kit/products_kit_cart/products-kit-cart.vue +132 -0
- package/components/products_kit/products_kit/products_kit_cart/products_kit_cart_options/products-kit-cart-options.scss +15 -0
- package/components/products_kit/products_kit/products_kit_cart/products_kit_cart_options/products-kit-cart-options.vue +31 -0
- package/components/products_kit/products_kit/products_kit_cart/products_kit_cart_options/products_kit_cart_option/products-kit-cart-option.scss +41 -0
- package/components/products_kit/products_kit/products_kit_cart/products_kit_cart_options/products_kit_cart_option/products-kit-cart-option.vue +89 -0
- package/components/products_kit/products_kit/products_kit_options/products-kit-options.scss +9 -0
- package/components/products_kit/products_kit/products_kit_options/products-kit-options.vue +32 -0
- package/components/products_kit/products_kit/products_kit_options/products_kit_option/products-kit-option.scss +1 -0
- package/components/products_kit/products_kit/products_kit_options/products_kit_option/products-kit-option.vue +36 -0
- package/components/products_kit/products_kit/products_kit_options/products_kit_option/products_kit_option_color/products-kit-option-color.scss +1 -0
- package/components/products_kit/products_kit/products_kit_options/products_kit_option/products_kit_option_color/products-kit-option-color.vue +88 -0
- package/components/products_kit/products_kit/products_kit_options/products_kit_option/products_kit_option_products/products-kit-option-products.scss +7 -0
- package/components/products_kit/products_kit/products_kit_options/products_kit_option/products_kit_option_products/products-kit-option-products.vue +36 -0
- package/components/products_kit/products_kit/products_kit_options/products_kit_option/products_kit_option_products/products_kit_option_product/products-kit-option-product.scss +20 -0
- package/components/products_kit/products_kit/products_kit_options/products_kit_option/products_kit_option_products/products_kit_option_product/products-kit-option-product.vue +127 -0
- package/components/products_kit/products_kit/products_kit_options/products_kit_option/products_kit_option_size/products-kit-option-size.scss +1 -0
- package/components/products_kit/products_kit/products_kit_options/products_kit_option/products_kit_option_size/products-kit-option-size.vue +87 -0
- package/components/products_kit/products_kits_list/products-kits-list.scss +68 -0
- package/components/products_kit/products_kits_list/products-kits-list.vue +50 -0
- package/components/products_kit/products_kits_list/products_kits_list_item/products-kits-list-item.scss +84 -0
- package/components/products_kit/products_kits_list/products_kits_list_item/products-kits-list-item.vue +52 -0
- package/components/quotes/quote_view/quote-view.vue +1 -0
- package/components/quotes/quote_view/quote_option_view/quote-option-view.vue +4 -0
- package/components/quotes/quote_view/quote_product_color_simple_products/quote-product-color-simple-products.vue +9 -2
- package/components/quotes/quote_view/quote_product_color_simple_products/quote_product_color_simple_product/quote-product-color-simple-product.scss +54 -1
- package/components/quotes/quote_view/quote_product_color_simple_products/quote_product_color_simple_product/quote-product-color-simple-product.vue +83 -5
- package/components/quotes/quote_view/quote_view_product/quote-view-product.scss +7 -0
- package/components/quotes/quote_view/quote_view_product/quote-view-product.vue +33 -11
- package/feeds/google-shopping.js +10 -4
- package/mixins/product-preview.js +6 -0
- package/package.json +1 -1
- package/pages/checkout/order.vue +13 -4
- package/pages/contact.vue +54 -0
- package/pages/customer/coupons.vue +39 -0
- package/pages/customer/orders.vue +39 -0
- package/pages/customer/settings.vue +4 -2
- package/pages/products-kit/_alias.vue +103 -0
- package/pages/products-kit/index.vue +59 -0
- package/routes/index.js +21 -1
- package/store/cart.js +2 -2
- package/store/productsKit.js +175 -0
- package/pages/customer/orders/index.vue +0 -29
|
@@ -63,7 +63,13 @@
|
|
|
63
63
|
:entity="product"
|
|
64
64
|
:group="group"
|
|
65
65
|
:default-preview="groupedProducts.size === 1"
|
|
66
|
+
@change="onChangeColorSimpleProduct()"
|
|
66
67
|
class="QuoteViewProduct__item" />
|
|
68
|
+
<div
|
|
69
|
+
v-if="!isValidTotalQty"
|
|
70
|
+
class="QuoteViewProduct__qty-warning">
|
|
71
|
+
Total Qty Should Be: <b>{{ product.totalAmount }}</b>
|
|
72
|
+
</div>
|
|
67
73
|
</div>
|
|
68
74
|
<div
|
|
69
75
|
v-if="hasPrints"
|
|
@@ -103,12 +109,18 @@ export default {
|
|
|
103
109
|
type: Object,
|
|
104
110
|
required: true
|
|
105
111
|
},
|
|
112
|
+
pricing: {
|
|
113
|
+
type: Object
|
|
114
|
+
},
|
|
106
115
|
withDivider: {
|
|
107
116
|
type: Boolean,
|
|
108
117
|
default: true
|
|
109
118
|
}
|
|
110
119
|
},
|
|
111
120
|
computed: {
|
|
121
|
+
isValidTotalQty() {
|
|
122
|
+
return this.product.totalAmount > 0 && this.product.totalAmount === this.amount;
|
|
123
|
+
},
|
|
112
124
|
productLink() {
|
|
113
125
|
return this.product.product ? generateProductLink(this.product.product) : null;
|
|
114
126
|
},
|
|
@@ -128,17 +140,27 @@ export default {
|
|
|
128
140
|
return [...groupSimpleProducts(this.product, !this.product.isCustom, true)].filter(([, g]) => g.amount > 0);
|
|
129
141
|
},
|
|
130
142
|
totalPrice() {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
const
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
143
|
+
if (this.pricing) {
|
|
144
|
+
return this.pricing?.products[this.product._id]?.totalPriceWithoutTax;
|
|
145
|
+
} else {
|
|
146
|
+
const printsTotal = (this.product.prints || []).reduce((total, print) => {
|
|
147
|
+
const isMultiplePrint = (print.products || []).length > 0;
|
|
148
|
+
const printProducts = print.products || [];
|
|
149
|
+
const isMultiplePrintMainProduct = printProducts.indexOf(this.product.guid) === 0 || printProducts.indexOf(this.product._id) === 0;
|
|
150
|
+
const isFreeSetup = print.freeSetupOver >= 0 && this.amount > print.freeSetupOver;
|
|
151
|
+
const printCost = print.costType === 'setup only' ? 0 : print.printCost;
|
|
152
|
+
const setupCost = (isMultiplePrint && !isMultiplePrintMainProduct) ? 0 : (print.costType === 'item cost only' || isFreeSetup) ? 0 : print.setupCost;
|
|
153
|
+
return total + this.amount * printCost + setupCost;
|
|
154
|
+
}, 0);
|
|
155
|
+
const productsTotal = this.simpleProducts.reduce((total, { amount = 0, productCost = 0 }) => total + amount * productCost, 0);
|
|
156
|
+
return this.amount > 0 ? (printsTotal + productsTotal) : 0;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
methods: {
|
|
161
|
+
onChangeColorSimpleProduct() {
|
|
162
|
+
console.log('onChangeColorSimpleProduct2:change...');
|
|
163
|
+
this.$emit('change');
|
|
142
164
|
}
|
|
143
165
|
}
|
|
144
166
|
};
|
package/feeds/google-shopping.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
async function googleLocalShoppingFeed(axios, config, availableStores, country) {
|
|
2
|
-
const result = await googleShoppingFeed(axios, config, availableStores, country);
|
|
2
|
+
const result = await googleShoppingFeed(axios, config, availableStores, country, false, { allowSameDayDelivery: true });
|
|
3
3
|
|
|
4
4
|
const fields = [
|
|
5
5
|
'g:availability',
|
|
@@ -8,10 +8,11 @@ async function googleLocalShoppingFeed(axios, config, availableStores, country)
|
|
|
8
8
|
'g:pickup_sla',
|
|
9
9
|
'g:price',
|
|
10
10
|
'g:quantity',
|
|
11
|
-
'g:store_code'
|
|
11
|
+
'g:store_code',
|
|
12
|
+
'g:local_shipping_label'
|
|
12
13
|
];
|
|
13
14
|
result.rss.channel.item = result.rss.channel.item
|
|
14
|
-
.map(i => fields.reduce((item, field) => ({ ...item, [field]: i[field] }), {}));
|
|
15
|
+
.map(i => fields.reduce((item, field) => i[field] ? ({ ...item, [field]: i[field] }) : item, {}));
|
|
15
16
|
return result;
|
|
16
17
|
}
|
|
17
18
|
|
|
@@ -19,7 +20,8 @@ const COUNTRIES_SIZE_SYSTEMS = {
|
|
|
19
20
|
GB: 'UK'
|
|
20
21
|
};
|
|
21
22
|
|
|
22
|
-
async function googleShoppingFeed(axios, config, availableStores, country, isEditor) {
|
|
23
|
+
async function googleShoppingFeed(axios, config, availableStores, country, isEditor, params) {
|
|
24
|
+
const { allowSameDayDelivery } = params || {};
|
|
23
25
|
const { data } = await axios.get(`${config.LOCAL_API_URL}/feed/products?host=${config.HOST_NAME}&country=${country || ''}`);
|
|
24
26
|
const spliceFirstImage = images => (images || []).splice(0, 1)[0];
|
|
25
27
|
const getImages = images => (images || []).length > 0 ? images : null;
|
|
@@ -127,6 +129,10 @@ async function googleShoppingFeed(axios, config, availableStores, country, isEdi
|
|
|
127
129
|
info['g:shipping_label'] = product.country;
|
|
128
130
|
}
|
|
129
131
|
|
|
132
|
+
if (allowSameDayDelivery && product.sameDayDelivery) {
|
|
133
|
+
info['g:local_shipping_label'] = { _text: 'sameday' };
|
|
134
|
+
}
|
|
135
|
+
|
|
130
136
|
const productHighlight = `${product.feedProductHighlight || ''}`
|
|
131
137
|
.trim()
|
|
132
138
|
.split(/\n+/g)
|
package/package.json
CHANGED
package/pages/checkout/order.vue
CHANGED
|
@@ -3,10 +3,19 @@
|
|
|
3
3
|
:data-aos="aosFadeRight"
|
|
4
4
|
class="CheckoutOrderPage__wrapper">
|
|
5
5
|
<order>
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
<template #after-steps>
|
|
7
|
+
<div class="CheckoutOrderPage__pricing">
|
|
8
|
+
<btn
|
|
9
|
+
btn-class="black"
|
|
10
|
+
btn-label="EDIT CART"
|
|
11
|
+
:btn-block="true"
|
|
12
|
+
to="/checkout/cart" />
|
|
13
|
+
<cart-price-info
|
|
14
|
+
class="mt-10"
|
|
15
|
+
:disabled-rates="true"
|
|
16
|
+
@loaded="loadedPricing($event)" />
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
10
19
|
</order>
|
|
11
20
|
</div>
|
|
12
21
|
</template>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ContactPage__wrapper">
|
|
3
|
+
<div class="content-inner">
|
|
4
|
+
<breadcrumbs :items="breadcrumbs" />
|
|
5
|
+
<div class="row">
|
|
6
|
+
<div class="col-sm-5 col-12">
|
|
7
|
+
<contact-us />
|
|
8
|
+
</div>
|
|
9
|
+
<div class="col-sm-7 col-12">
|
|
10
|
+
<iframe
|
|
11
|
+
v-if="contacts.googleMapIframeSrc"
|
|
12
|
+
:src="contacts.googleMapIframeSrc"
|
|
13
|
+
width="100%"
|
|
14
|
+
height="100%"
|
|
15
|
+
style="border:0;"
|
|
16
|
+
loading="lazy">
|
|
17
|
+
</iframe>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script>
|
|
25
|
+
import { mapGetters } from 'vuex';
|
|
26
|
+
import metaInfo from '@lancom/shared/mixins/meta-info';
|
|
27
|
+
|
|
28
|
+
export default {
|
|
29
|
+
name: 'ContactPage',
|
|
30
|
+
components: {
|
|
31
|
+
Breadcrumbs: () => import('@lancom/shared/components/common/breadcrumbs/breadcrumbs'),
|
|
32
|
+
ContactUs: () => import('@lancom/shared/components/asides/contact_us/contact-us')
|
|
33
|
+
},
|
|
34
|
+
mixins: [metaInfo],
|
|
35
|
+
data() {
|
|
36
|
+
return {
|
|
37
|
+
breadcrumbs: [{
|
|
38
|
+
text: 'Contact'
|
|
39
|
+
}]
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
computed: {
|
|
43
|
+
...mapGetters(['contacts'])
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<style lang="scss" scoped>
|
|
49
|
+
.ContactPage{
|
|
50
|
+
&__wrapper {
|
|
51
|
+
padding: 30px 0;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
</style>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:data-aos="aosFadeRight"
|
|
4
|
+
class="CustomerCouponsPage__wrapper">
|
|
5
|
+
<customer-menu active-menu-item="coupons" />
|
|
6
|
+
<customer-coupons :customer="user" />
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
import { mapGetters } from 'vuex';
|
|
12
|
+
import metaInfo from '@lancom/shared/mixins/meta-info';
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
name: 'CustomerCouponsPage',
|
|
16
|
+
components: {
|
|
17
|
+
CustomerCoupons: () => import('@lancom/shared/components/customer/customer_coupons/customer-coupons'),
|
|
18
|
+
CustomerMenu: () => import('@lancom/shared/components/customer/customer_navigation_menu/customer-navigation-menu')
|
|
19
|
+
},
|
|
20
|
+
mixins: [metaInfo],
|
|
21
|
+
computed: {
|
|
22
|
+
...mapGetters('auth', ['user'])
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<style lang="scss" scoped>
|
|
28
|
+
@import "@/assets/scss/variables";
|
|
29
|
+
|
|
30
|
+
.CustomerCouponsPage {
|
|
31
|
+
&__wrapper {
|
|
32
|
+
margin: 50px auto;
|
|
33
|
+
width: 1100px;
|
|
34
|
+
@media (max-width: $bp-extra-small-max) {
|
|
35
|
+
width: auto;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
</style>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:data-aos="aosFadeRight"
|
|
4
|
+
class="CustomerOrdersPage__wrapper">
|
|
5
|
+
<customer-navigation-menu active-menu-item="orders" />
|
|
6
|
+
<customer-orders :customer="user" />
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
import { mapGetters } from 'vuex';
|
|
12
|
+
import metaInfo from '@lancom/shared/mixins/meta-info';
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
name: 'CustomerOrdersPage',
|
|
16
|
+
components: {
|
|
17
|
+
CustomerOrders: () => import('@lancom/shared/components/customer/customer_orders/customer-orders'),
|
|
18
|
+
CustomerNavigationMenu: () => import('@lancom/shared/components/customer/customer_navigation_menu/customer-navigation-menu')
|
|
19
|
+
},
|
|
20
|
+
mixins: [metaInfo],
|
|
21
|
+
computed: {
|
|
22
|
+
...mapGetters('auth', ['user'])
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<style lang="scss" scoped>
|
|
28
|
+
@import "@/assets/scss/variables";
|
|
29
|
+
|
|
30
|
+
.CustomerOrdersPage {
|
|
31
|
+
&__wrapper {
|
|
32
|
+
margin: 50px auto;
|
|
33
|
+
width: 1100px;
|
|
34
|
+
@media (max-width: $bp-extra-small-max) {
|
|
35
|
+
width: auto;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
</style>
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
<div
|
|
3
3
|
:data-aos="aosFadeRight"
|
|
4
4
|
class="CustomerSettingsPage__wrapper">
|
|
5
|
+
<customer-navigation-menu active-menu-item="settings" />
|
|
5
6
|
<customer-settings />
|
|
6
7
|
</div>
|
|
7
8
|
</template>
|
|
@@ -12,6 +13,7 @@ import metaInfo from '@lancom/shared/mixins/meta-info';
|
|
|
12
13
|
export default {
|
|
13
14
|
name: 'CustomerCreatePage',
|
|
14
15
|
components: {
|
|
16
|
+
CustomerNavigationMenu: () => import('@lancom/shared/components/customer/customer_navigation_menu/customer-navigation-menu'),
|
|
15
17
|
CustomerSettings: () => import('@lancom/shared/components/pages/customer/settings/settings')
|
|
16
18
|
},
|
|
17
19
|
mixins: [metaInfo]
|
|
@@ -23,8 +25,8 @@ export default {
|
|
|
23
25
|
|
|
24
26
|
.CustomerSettingsPage {
|
|
25
27
|
&__wrapper {
|
|
26
|
-
margin:
|
|
27
|
-
width:
|
|
28
|
+
margin: 50px auto;
|
|
29
|
+
width: 1100px;
|
|
28
30
|
@media (max-width: $bp-extra-small-max) {
|
|
29
31
|
width: auto;
|
|
30
32
|
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ProductsKitPage__wrapper">
|
|
3
|
+
<breadcrumbs :items="breadcrumbs" />
|
|
4
|
+
<transition name="from-right-to-left" appear>
|
|
5
|
+
<products-kit :products-kit="productsKit" />
|
|
6
|
+
</transition>
|
|
7
|
+
<transition
|
|
8
|
+
v-if="hasProductsKitsList"
|
|
9
|
+
name="from-left-to-right"
|
|
10
|
+
appear>
|
|
11
|
+
<div class="content-inner">
|
|
12
|
+
<h2 class="lc_h2 lc_black ProductsKitPage__list-title">
|
|
13
|
+
You might also like
|
|
14
|
+
</h2>
|
|
15
|
+
<products-kits-list
|
|
16
|
+
class="ProductsKitPage__list"
|
|
17
|
+
:productsKits="productsKitsList" />
|
|
18
|
+
</div>
|
|
19
|
+
</transition>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
<script>
|
|
23
|
+
import metaInfo from '@lancom/shared/mixins/meta-info';
|
|
24
|
+
|
|
25
|
+
export default {
|
|
26
|
+
name: 'ProductsKitPage',
|
|
27
|
+
components: {
|
|
28
|
+
Breadcrumbs: () => import('@lancom/shared/components/common/breadcrumbs/breadcrumbs'),
|
|
29
|
+
ProductsKit: () => import('@lancom/shared/components/products_kit/products_kit/products-kit'),
|
|
30
|
+
ProductsKitsList: () => import('@lancom/shared/components/products_kit/products_kits_list/products-kits-list')
|
|
31
|
+
},
|
|
32
|
+
mixins: [metaInfo],
|
|
33
|
+
async asyncData({ params, store, error, redirect }) {
|
|
34
|
+
console.log('asyncData: ', 1);
|
|
35
|
+
try {
|
|
36
|
+
const { shop, country, currency } = store.getters;
|
|
37
|
+
const data = {
|
|
38
|
+
shop: shop._id,
|
|
39
|
+
alias: params.alias,
|
|
40
|
+
country: country?._id,
|
|
41
|
+
currency: currency?._id
|
|
42
|
+
};
|
|
43
|
+
await store.dispatch('productsKit/fetchProductsKit', data);
|
|
44
|
+
} catch (e) {
|
|
45
|
+
console.log(e);
|
|
46
|
+
}
|
|
47
|
+
const productsKit = store.getters['productsKit/productsKit'];
|
|
48
|
+
const loadError = store.getters['productsKit/loadError'];
|
|
49
|
+
|
|
50
|
+
// console.log('loadError: ', loadError);
|
|
51
|
+
if (loadError?.redirectLink) {
|
|
52
|
+
return redirect(301, loadError?.redirectLink);
|
|
53
|
+
} else if (loadError) {
|
|
54
|
+
error(loadError);
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
productsKit
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
data() {
|
|
61
|
+
return {
|
|
62
|
+
productsKit: null,
|
|
63
|
+
productsKits: []
|
|
64
|
+
};
|
|
65
|
+
},
|
|
66
|
+
computed: {
|
|
67
|
+
hasProductsKitsList() {
|
|
68
|
+
return this.productsKitsList.length > 0;
|
|
69
|
+
},
|
|
70
|
+
productsKitsList() {
|
|
71
|
+
return this.productsKits.filter(i => i.alias !== this.productsKit.alias).slice(0, 3);
|
|
72
|
+
},
|
|
73
|
+
breadcrumbs() {
|
|
74
|
+
const item = this.productsKit ? { text: this.productsKit.name } : null;
|
|
75
|
+
return [{
|
|
76
|
+
to: '/products-kits',
|
|
77
|
+
text: 'Products Kits'
|
|
78
|
+
}, item].filter(i => !!i);
|
|
79
|
+
},
|
|
80
|
+
pageItemType() {
|
|
81
|
+
return 'products-kits';
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
getRoute() {
|
|
85
|
+
return '/shop/:shop/products-kits/:alias';
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
</script>
|
|
89
|
+
|
|
90
|
+
<style lang="scss" scoped>
|
|
91
|
+
.ProductsKitPage{
|
|
92
|
+
&__wrapper {
|
|
93
|
+
margin-top: 30px;
|
|
94
|
+
}
|
|
95
|
+
&__list-title {
|
|
96
|
+
margin-top: 20px;
|
|
97
|
+
text-align: center;
|
|
98
|
+
}
|
|
99
|
+
&__list {
|
|
100
|
+
padding: 20px 0;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
</style>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ProductsKitsPage__wrapper view-transition">
|
|
3
|
+
<div class="content-inner">
|
|
4
|
+
<breadcrumbs :items="breadcrumbs" />
|
|
5
|
+
<products-kits-list
|
|
6
|
+
class="ProductsKitsPage__list"
|
|
7
|
+
:products-kits="productsKits"
|
|
8
|
+
:count="count"
|
|
9
|
+
:page="page"
|
|
10
|
+
:per-page="perPage" />
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
import metaInfo from '@lancom/shared/mixins/meta-info';
|
|
17
|
+
import api from '@lancom/shared/assets/js/api';
|
|
18
|
+
|
|
19
|
+
const KITS_PER_PAGE = 18;
|
|
20
|
+
|
|
21
|
+
export default {
|
|
22
|
+
name: 'ProductPage',
|
|
23
|
+
components: {
|
|
24
|
+
Breadcrumbs: () => import('@lancom/shared/components/common/breadcrumbs/breadcrumbs'),
|
|
25
|
+
ProductsKitsList: () => import('@lancom/shared/components/products_kit/products_kits_list/products-kits-list')
|
|
26
|
+
},
|
|
27
|
+
mixins: [metaInfo],
|
|
28
|
+
async asyncData({ store, params, query }) {
|
|
29
|
+
const { _id } = store.getters.shop;
|
|
30
|
+
const kitsQuery = { ...params, ...query, limit: KITS_PER_PAGE };
|
|
31
|
+
const { productsKits, count, page, perPage } = await api.fetchProductsKits(_id, kitsQuery);
|
|
32
|
+
return { productsKits, count, page, perPage };
|
|
33
|
+
},
|
|
34
|
+
data() {
|
|
35
|
+
return {
|
|
36
|
+
productsKits: [],
|
|
37
|
+
count: null,
|
|
38
|
+
page: null,
|
|
39
|
+
perPage: null,
|
|
40
|
+
breadcrumbs: [{
|
|
41
|
+
text: 'Products Kits'
|
|
42
|
+
}]
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
computed: {
|
|
46
|
+
pageItemType() {
|
|
47
|
+
return 'products-kits';
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<style lang="scss" scoped>
|
|
54
|
+
.ProductsKitsPage {
|
|
55
|
+
&__wrapper {
|
|
56
|
+
padding: 30px 0;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
</style>
|
package/routes/index.js
CHANGED
|
@@ -112,8 +112,13 @@ module.exports = function(routes, resolve) {
|
|
|
112
112
|
}, {
|
|
113
113
|
name: 'customer-orders',
|
|
114
114
|
path: '/customer/orders',
|
|
115
|
-
component: resolve('@lancom/shared/pages/customer/orders
|
|
115
|
+
component: resolve('@lancom/shared/pages/customer/orders.vue'),
|
|
116
116
|
chunkName: 'pages/customer/orders'
|
|
117
|
+
}, {
|
|
118
|
+
name: 'customer-coupons',
|
|
119
|
+
path: '/customer/coupons',
|
|
120
|
+
component: resolve('@lancom/shared/pages/customer/coupons.vue'),
|
|
121
|
+
chunkName: 'pages/customer/coupons'
|
|
117
122
|
}, {
|
|
118
123
|
name: 'customer-recovery',
|
|
119
124
|
path: '/customer/recovery',
|
|
@@ -164,5 +169,20 @@ module.exports = function(routes, resolve) {
|
|
|
164
169
|
path: '/news/tag/:tag',
|
|
165
170
|
component: resolve('@lancom/shared/pages/news/tag/_tag.vue'),
|
|
166
171
|
chunkName: 'pages/news/tag'
|
|
172
|
+
}, {
|
|
173
|
+
name: 'products-kits',
|
|
174
|
+
path: '/products-kits',
|
|
175
|
+
component: resolve('@lancom/shared/pages/products-kit/index.vue'),
|
|
176
|
+
chunkName: 'pages/products-kits'
|
|
177
|
+
}, {
|
|
178
|
+
name: 'products-kit-view',
|
|
179
|
+
path: '/products-kit/:alias',
|
|
180
|
+
component: resolve('@lancom/shared/pages/products-kit/_alias.vue'),
|
|
181
|
+
chunkName: 'pages/products-kit/products-kit-view'
|
|
182
|
+
}, {
|
|
183
|
+
name: 'contact',
|
|
184
|
+
path: '/contact',
|
|
185
|
+
component: resolve('@lancom/shared/pages/contact.vue'),
|
|
186
|
+
chunkName: 'pages/contact'
|
|
167
187
|
}];
|
|
168
188
|
}
|
package/store/cart.js
CHANGED
|
@@ -4,7 +4,7 @@ import gtm from '@lancom/shared/assets/js/utils/gtm';
|
|
|
4
4
|
import { getPrintTypeSizePricing } from '@lancom/shared/assets/js/utils/prints';
|
|
5
5
|
import { filterBigSize } from '@lancom/shared/assets/js/utils/product';
|
|
6
6
|
|
|
7
|
-
const SUPPLIERS_WITH_RATES_KEY = 'suppliers-with-
|
|
7
|
+
const SUPPLIERS_WITH_RATES_KEY = 'suppliers-with-rates';
|
|
8
8
|
|
|
9
9
|
export const state = () => ({
|
|
10
10
|
id: null,
|
|
@@ -134,7 +134,7 @@ export const actions = {
|
|
|
134
134
|
const cartEntities = state.id ? (await api.fetchCartById(shop._id, state.id, params)).entities : state.entities;
|
|
135
135
|
entities = entities.map(e => {
|
|
136
136
|
const entitiy = cartEntities.find(e2 => isSamePrints(e, e2) && e2?.product?._id === e?.product?._id);
|
|
137
|
-
if (entitiy) {
|
|
137
|
+
if (!e.productsKit && entitiy) {
|
|
138
138
|
e.simpleProducts.forEach(sp => {
|
|
139
139
|
const simpleProduct = entitiy.simpleProducts.find(sp2 => sp2.SKU === sp.SKU);
|
|
140
140
|
if (!simpleProduct) {
|