@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
package/assets/js/api/admin.js
CHANGED
|
@@ -317,6 +317,18 @@ export default {
|
|
|
317
317
|
removeProduct(id) {
|
|
318
318
|
return _delete(`admin/products/${id}`);
|
|
319
319
|
},
|
|
320
|
+
fetchProductsKits(params) {
|
|
321
|
+
return _get('admin/products-kit', params);
|
|
322
|
+
},
|
|
323
|
+
fetchProductsKitById(id) {
|
|
324
|
+
return _get(`admin/products-kit/${id}`);
|
|
325
|
+
},
|
|
326
|
+
saveProductsKit(productsKit) {
|
|
327
|
+
return productsKit._id ? _put(`admin/products-kit/${productsKit._id}`, productsKit) : _post('admin/products-kit', productsKit);
|
|
328
|
+
},
|
|
329
|
+
removeProductsKit(id) {
|
|
330
|
+
return _delete(`admin/products-kit/${id}`);
|
|
331
|
+
},
|
|
320
332
|
fetchSimpleProducts(params) {
|
|
321
333
|
return _get('admin/simple-products', params);
|
|
322
334
|
},
|
package/assets/js/api/index.js
CHANGED
|
@@ -38,6 +38,9 @@ const api = {
|
|
|
38
38
|
fetchCustomerOrders(customer, shop) {
|
|
39
39
|
return _get(`shop/${shop}/customer/${customer._id}/orders`);
|
|
40
40
|
},
|
|
41
|
+
fetchCustomerCoupons(customer, shop) {
|
|
42
|
+
return _get(`shop/${shop}/customer/${customer._id}/coupons`);
|
|
43
|
+
},
|
|
41
44
|
searchProducts(shop, text, save) {
|
|
42
45
|
return _get(`shop/${shop}/products/search`, { text, save });
|
|
43
46
|
},
|
|
@@ -65,6 +68,12 @@ const api = {
|
|
|
65
68
|
fetchBanners(shop, params) {
|
|
66
69
|
return _get(`shop/${shop}/banners`, params);
|
|
67
70
|
},
|
|
71
|
+
fetchProductsKits(shop, params) {
|
|
72
|
+
return _get(`shop/${shop}/products-kit`, params);
|
|
73
|
+
},
|
|
74
|
+
fetchProductsKit(shop, alias, preview = false) {
|
|
75
|
+
return _get(`shop/${shop}/products-kit/${alias}?preview=${preview}`);
|
|
76
|
+
},
|
|
68
77
|
fetchNews(shop, params) {
|
|
69
78
|
return _get(`shop/${shop}/news`, params);
|
|
70
79
|
},
|
|
@@ -78,7 +87,8 @@ const api = {
|
|
|
78
87
|
return _get(`shop/${shop}/news-tag/${alias}`);
|
|
79
88
|
},
|
|
80
89
|
async fetchProductDetails(shop, alias, params) {
|
|
81
|
-
|
|
90
|
+
const url = shop ? `shop/${shop}/products/${alias}/simple-products` : `products/${alias}/simple-products`;
|
|
91
|
+
return unminifySimpleProducts(await _get(url, params));
|
|
82
92
|
},
|
|
83
93
|
fetchRelatedProducts(shop, alias, params) {
|
|
84
94
|
return _get(`shop/${shop}/products/${alias}/related-products`, params);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function scrollToElement(elementId, offset = 100) {
|
|
2
|
+
const element = document.getElementById(elementId);
|
|
3
|
+
if (element) {
|
|
4
|
+
const elementPosition = element.getBoundingClientRect().top;
|
|
5
|
+
const offsetPosition = elementPosition + window.scrollY - offset;
|
|
6
|
+
window.scrollTo({
|
|
7
|
+
top: offsetPosition,
|
|
8
|
+
behavior: 'smooth'
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -28,11 +28,15 @@ export default {
|
|
|
28
28
|
'quantities',
|
|
29
29
|
'notValidProductsQuantities',
|
|
30
30
|
'notValidStockQuantities',
|
|
31
|
-
'notValidPrintsQuantities'
|
|
31
|
+
'notValidPrintsQuantities',
|
|
32
|
+
'notValidProductsPickup'
|
|
32
33
|
]),
|
|
33
34
|
isNotValidQuantity() {
|
|
34
35
|
return this.isNotValidProductsQuantity || this.isNotValidStockQuantity || this.isNotValidPrintsQuantity || this.isNotValidPrintsBigSizeQuantity;
|
|
35
36
|
},
|
|
37
|
+
isNotValidShipping() {
|
|
38
|
+
return (this.needToPickup && this.notValidProductsPickup.length > 0) || !this.suburb;
|
|
39
|
+
},
|
|
36
40
|
isNotValidProductsQuantity() {
|
|
37
41
|
return this.notValidProductsQuantities.length > 0;
|
|
38
42
|
},
|
|
@@ -4,8 +4,14 @@
|
|
|
4
4
|
v-if="!isEmpty"
|
|
5
5
|
class="row">
|
|
6
6
|
<div class="col-es-12 col-8">
|
|
7
|
+
<cart-products-kit-entity
|
|
8
|
+
v-for="entity in productsKitsEntities"
|
|
9
|
+
:key="entity.productsKitGuid"
|
|
10
|
+
:products-kit-entity="entity"
|
|
11
|
+
class="Cart__entity"
|
|
12
|
+
@remove="removeSimpleProducts" />
|
|
7
13
|
<cart-entity
|
|
8
|
-
v-for="entity in
|
|
14
|
+
v-for="entity in productsEntities"
|
|
9
15
|
:key="entity._id"
|
|
10
16
|
:entity="entity"
|
|
11
17
|
class="Cart__entity"
|
|
@@ -20,16 +26,13 @@
|
|
|
20
26
|
:btn-block="true"
|
|
21
27
|
@onclick="removeAllSimpleProducts" />
|
|
22
28
|
<div class="Cart__total-container">
|
|
29
|
+
<cart-shipping
|
|
30
|
+
class="mb-10"
|
|
31
|
+
@suburb="handleSuburbChange" />
|
|
23
32
|
<cart-price-info @loaded="loadedPricing($event)" />
|
|
24
33
|
</div>
|
|
25
34
|
<div class="Cart__postcode-container">
|
|
26
|
-
|
|
27
|
-
:suburb="suburb"
|
|
28
|
-
:labelless="true"
|
|
29
|
-
:only-postcode="onlyPostcode"
|
|
30
|
-
:placeholder="postcodeLabel"
|
|
31
|
-
:label-text="postcodeInfoLabel"
|
|
32
|
-
@select="handleSuburbChange" />
|
|
35
|
+
|
|
33
36
|
</div>
|
|
34
37
|
<div class="Cart__coupon-container">
|
|
35
38
|
<coupon-select
|
|
@@ -42,7 +45,7 @@
|
|
|
42
45
|
</div>
|
|
43
46
|
<div class="mt-10">
|
|
44
47
|
<btn
|
|
45
|
-
:btn-disabled="isNotValidQuantity || cartPricingError || cartPricingCalculating"
|
|
48
|
+
:btn-disabled="isNotValidShipping || isNotValidQuantity || cartPricingError || cartPricingCalculating"
|
|
46
49
|
:btn-block="true"
|
|
47
50
|
:to="'/checkout/order'"
|
|
48
51
|
btn-class="green"
|
|
@@ -73,36 +76,46 @@
|
|
|
73
76
|
<script>
|
|
74
77
|
import { mapGetters, mapMutations } from 'vuex';
|
|
75
78
|
import gtm from '@lancom/shared/assets/js/utils/gtm';
|
|
76
|
-
import PostcodeSelect from '@lancom/shared/components/common/postcode_select/postcode-select';
|
|
77
79
|
import CouponSelect from '@lancom/shared/components/common/coupon_select/coupon-select';
|
|
78
80
|
import CartQuantityErrors from '@lancom/shared/components/checkout/cart/cart_quantity_errors/cart-quantity-errors';
|
|
79
81
|
import CartEntity from '@lancom/shared/components/checkout/cart/cart_entity/cart-entity';
|
|
82
|
+
import CartProductsKitEntity from '@lancom/shared/components/checkout/cart/cart_products_kit_entity/cart-products-kit-entity';
|
|
80
83
|
import { price } from '@lancom/shared/assets/js/utils/filters';
|
|
81
84
|
import CartMixin from '@lancom/shared/components/checkout/cart/cart.mixin';
|
|
82
85
|
import CartPriceInfo from '@lancom/shared/components/checkout/cart/cart_price_info/cart-price-info';
|
|
86
|
+
import CartShipping from '@lancom/shared/components/checkout/cart/cart_shipping/cart-shipping';
|
|
83
87
|
|
|
84
88
|
export default {
|
|
85
89
|
name: 'CheckoutCart',
|
|
86
90
|
components: {
|
|
87
91
|
CartEntity,
|
|
92
|
+
CartProductsKitEntity,
|
|
88
93
|
CartPriceInfo,
|
|
89
94
|
CartQuantityErrors,
|
|
90
|
-
|
|
91
|
-
|
|
95
|
+
CouponSelect,
|
|
96
|
+
CartShipping
|
|
92
97
|
},
|
|
93
98
|
filters: { price },
|
|
94
99
|
mixins: [CartMixin],
|
|
95
100
|
computed: {
|
|
96
101
|
...mapGetters(['MESSAGES', 'SETTINGS', 'currency', 'country']),
|
|
97
102
|
...mapGetters('cart', ['isEmpty','cartPricingError', 'cartPricing', 'cartPricingCalculating', 'entities']),
|
|
98
|
-
|
|
99
|
-
return
|
|
100
|
-
},
|
|
101
|
-
postcodeLabel() {
|
|
102
|
-
return this.onlyPostcode ? 'Postcode' : (this.MESSAGES.CART_POSTCODE || 'Postcode');
|
|
103
|
+
productsEntities() {
|
|
104
|
+
return this.entities.filter(e => !e.productsKit)
|
|
103
105
|
},
|
|
104
|
-
|
|
105
|
-
|
|
106
|
+
productsKitsEntities() {
|
|
107
|
+
const entities = this.entities.filter(e => !!e.productsKit);
|
|
108
|
+
const groupedEntities = entities.reduce((acc, entity) => {
|
|
109
|
+
const { productsKitGuid, productsKit } = entity;
|
|
110
|
+
if (!acc[productsKitGuid]) {
|
|
111
|
+
acc[productsKitGuid] = { entities: [], productsKit, productsKitGuid };
|
|
112
|
+
}
|
|
113
|
+
acc[productsKitGuid].entities.push(entity);
|
|
114
|
+
return acc;
|
|
115
|
+
}, {});
|
|
116
|
+
const productsKitsEntities = Object.values(groupedEntities);
|
|
117
|
+
console.log('productsKitsEntities: ', productsKitsEntities);
|
|
118
|
+
return productsKitsEntities;
|
|
106
119
|
},
|
|
107
120
|
couponLabel() {
|
|
108
121
|
return (this.MESSAGES.CART_COUPON || 'Coupon code').trim();
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
v-for="[groupKey, group] in groupedSimpleProducts"
|
|
47
47
|
:key="groupKey"
|
|
48
48
|
:entity="entity"
|
|
49
|
+
:editable="editable"
|
|
49
50
|
:group="group"
|
|
50
51
|
:default-preview="false"
|
|
51
52
|
:display-unit-price="!isSameUnitPrices"
|
|
@@ -66,6 +67,7 @@
|
|
|
66
67
|
Subtotal: {{ totalPrice | price(currency) }}
|
|
67
68
|
</div>
|
|
68
69
|
<i
|
|
70
|
+
v-if="editable"
|
|
69
71
|
class="icon-delete CartEntity__remove"
|
|
70
72
|
@click="removeSimpleProducts(entity.simpleProducts)"></i>
|
|
71
73
|
</div>
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
</div>
|
|
35
35
|
</div>
|
|
36
36
|
<i
|
|
37
|
+
v-if="editable"
|
|
37
38
|
class="icon-delete CartEntityColorSimpleProducts__remove"
|
|
38
39
|
@click="remove"></i>
|
|
39
40
|
</div>
|
|
@@ -58,6 +59,7 @@
|
|
|
58
59
|
:key="simpleProduct._id"
|
|
59
60
|
:simple-product="simpleProduct"
|
|
60
61
|
:entity="entity"
|
|
62
|
+
:editable="editable"
|
|
61
63
|
:display-unit-price="displayUnitPrice"
|
|
62
64
|
@change="onChangeQty" />
|
|
63
65
|
</div>
|
|
@@ -3,37 +3,14 @@
|
|
|
3
3
|
<slot name="cart-pricing" v-bind="{ cartPricing, itemsLabel }">
|
|
4
4
|
<cart-pricing
|
|
5
5
|
v-if="cartPricing && cartPricing.amount"
|
|
6
|
-
:pricing="cartPricing"
|
|
6
|
+
:pricing="cartPricing"
|
|
7
|
+
:disabled-rates="disabledRates" />
|
|
7
8
|
</slot>
|
|
8
9
|
<div
|
|
9
10
|
v-if="cartPricingError"
|
|
10
11
|
class="CartPriceInfo__error">
|
|
11
12
|
{{ cartPricingError }}
|
|
12
13
|
</div>
|
|
13
|
-
<div>
|
|
14
|
-
<div class="mt-20 mb-20">
|
|
15
|
-
<checkbox
|
|
16
|
-
v-model="wantsToPickup"
|
|
17
|
-
:dark="true"
|
|
18
|
-
@change="calculatePrice()">
|
|
19
|
-
<div class="ml-10 CartPriceInfo__pickup-label">
|
|
20
|
-
{{ contacts.warehousePickupInfo ? `Pickup from ${contacts.warehousePickupInfo}` : 'Wants to pickup' }}
|
|
21
|
-
</div>
|
|
22
|
-
</checkbox>
|
|
23
|
-
</div>
|
|
24
|
-
<div
|
|
25
|
-
v-if="hasNotValidProductsPickup"
|
|
26
|
-
class="CartPriceInfo__pickup-errors">
|
|
27
|
-
<div>Not all items in cart are available for pickup. Some items are available for delivery only</div>
|
|
28
|
-
<ul>
|
|
29
|
-
<li
|
|
30
|
-
v-for="product in notValidProductsPickup"
|
|
31
|
-
:key="product._id">
|
|
32
|
-
<b>{{ product.name }}. {{ product.size ? product.size.shortName : '' }}</b> order quantity: {{ product.amount }}. Available {{ product.warehouseQuantityStock }}
|
|
33
|
-
</li>
|
|
34
|
-
</ul>
|
|
35
|
-
</div>
|
|
36
|
-
</div>
|
|
37
14
|
</div>
|
|
38
15
|
</template>
|
|
39
16
|
|
|
@@ -43,7 +20,7 @@ import debounce from 'lodash.debounce';
|
|
|
43
20
|
import CartPricing from '@lancom/shared/components/checkout/cart/cart_pricing/cart-pricing';
|
|
44
21
|
import { price } from '@lancom/shared/assets/js/utils/filters';
|
|
45
22
|
|
|
46
|
-
const { mapActions
|
|
23
|
+
const { mapActions } = createNamespacedHelpers('cart');
|
|
47
24
|
|
|
48
25
|
export default {
|
|
49
26
|
name: 'LancomCartPriceInfo',
|
|
@@ -55,11 +32,14 @@ export default {
|
|
|
55
32
|
itemsLabel: {
|
|
56
33
|
type: String,
|
|
57
34
|
default: 'Tee'
|
|
35
|
+
},
|
|
36
|
+
disabledRates: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: false
|
|
58
39
|
}
|
|
59
40
|
},
|
|
60
41
|
data() {
|
|
61
42
|
return {
|
|
62
|
-
visiblePickupError: null,
|
|
63
43
|
price: null,
|
|
64
44
|
calculatePriceWithDebounce: debounce(this.calculatePrice, 500)
|
|
65
45
|
};
|
|
@@ -67,31 +47,10 @@ export default {
|
|
|
67
47
|
computed: {
|
|
68
48
|
...mapGetters(['shop', 'country', 'currency', 'contacts']),
|
|
69
49
|
...mapGetters('cart', [
|
|
70
|
-
'notValidProductsPickup',
|
|
71
|
-
'needToPickup',
|
|
72
|
-
'needToPickupWithoutErrors',
|
|
73
50
|
'entities',
|
|
74
51
|
'cartPricing',
|
|
75
52
|
'cartPricingError'
|
|
76
|
-
])
|
|
77
|
-
hasNotValidProductsPickup() {
|
|
78
|
-
return this.notValidProductsPickup.length > 0;
|
|
79
|
-
},
|
|
80
|
-
wantsToPickup: {
|
|
81
|
-
get() {
|
|
82
|
-
return this.needToPickup;
|
|
83
|
-
},
|
|
84
|
-
set(needToPickup) {
|
|
85
|
-
if (needToPickup && this.hasNotValidProductsPickup) {
|
|
86
|
-
this.visiblePickupError = true;
|
|
87
|
-
} else {
|
|
88
|
-
// if (needToPickup) {
|
|
89
|
-
// this.setSuburb(null);
|
|
90
|
-
// }
|
|
91
|
-
this.setNeedToPickup(needToPickup);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
53
|
+
])
|
|
95
54
|
},
|
|
96
55
|
watch: {
|
|
97
56
|
entities() {
|
|
@@ -103,10 +62,6 @@ export default {
|
|
|
103
62
|
this.$emit('loaded', this.cartPricing);
|
|
104
63
|
},
|
|
105
64
|
methods: {
|
|
106
|
-
...mapMutations([
|
|
107
|
-
'setSuburb',
|
|
108
|
-
'setNeedToPickup'
|
|
109
|
-
]),
|
|
110
65
|
...mapActions([
|
|
111
66
|
'calculateCartPrice'
|
|
112
67
|
]),
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
.CartPricing {
|
|
4
4
|
&__wrapper {
|
|
5
5
|
border: 2px solid $gray;
|
|
6
|
-
padding: 28px 20px;
|
|
6
|
+
padding: 0px 20px 28px 20px;
|
|
7
7
|
@media (max-width: $bp-small-max) {
|
|
8
|
-
padding: 15px 10px;
|
|
8
|
+
padding: 0px 10px 15px 10px;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
@media (max-width: $bp-small-max) {
|
|
12
12
|
.lc_h3 {
|
|
13
|
-
font-size:
|
|
13
|
+
font-size: 16px;
|
|
14
14
|
}
|
|
15
15
|
.lc_body-large {
|
|
16
16
|
font-size: 14px;
|
|
@@ -20,6 +20,14 @@
|
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
+
&__header {
|
|
24
|
+
padding: 10px;
|
|
25
|
+
background-color: $gray;
|
|
26
|
+
margin: 0 -20px;
|
|
27
|
+
@media (max-width: $bp-small-max) {
|
|
28
|
+
margin: 0 -10px;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
23
31
|
&__info {
|
|
24
32
|
padding: 11px;
|
|
25
33
|
display: flex;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="CartPricing__wrapper">
|
|
3
|
-
<div class="
|
|
3
|
+
<div class="lc_h4 lc_uppercase lc_black CartPricing__header">
|
|
4
4
|
Order summary
|
|
5
5
|
</div>
|
|
6
6
|
<div class="CartPricing__info">
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
{{ pricing.products.totalPriceWithoutTax | price(currency) }}
|
|
28
28
|
</div>
|
|
29
29
|
</div>
|
|
30
|
-
<cart-shipments-pricing />
|
|
30
|
+
<cart-shipments-pricing :disabled-rates="disabledRates" />
|
|
31
31
|
<div class="CartPricing__info">
|
|
32
32
|
<div class="lc_body-large lc_gray-main">
|
|
33
33
|
Total Delivery:
|
|
@@ -90,6 +90,10 @@ export default {
|
|
|
90
90
|
type: Object,
|
|
91
91
|
required: true
|
|
92
92
|
},
|
|
93
|
+
disabledRates: {
|
|
94
|
+
type: Boolean,
|
|
95
|
+
default: false
|
|
96
|
+
},
|
|
93
97
|
itemsLabel: {
|
|
94
98
|
type: String,
|
|
95
99
|
default: 'Tee'
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
@import "@/assets/scss/variables";
|
|
2
|
+
|
|
3
|
+
.CartProductsKitEntity {
|
|
4
|
+
&__wrapper {
|
|
5
|
+
padding: 10px;
|
|
6
|
+
border: 1px solid $black;
|
|
7
|
+
margin-bottom: 10px;
|
|
8
|
+
position: relative;
|
|
9
|
+
@media (max-width: $bp-small-max) {
|
|
10
|
+
padding: 15px;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
&__link {
|
|
14
|
+
color: $black;
|
|
15
|
+
}
|
|
16
|
+
&__head {
|
|
17
|
+
display: flex;
|
|
18
|
+
justify-content: space-between;
|
|
19
|
+
margin-bottom: 10px;
|
|
20
|
+
}
|
|
21
|
+
&__remove {
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="CartProductsKitEntity__wrapper">
|
|
3
|
+
<div class="CartProductsKitEntity__info">
|
|
4
|
+
<div class="CartProductsKitEntity__head">
|
|
5
|
+
<div>
|
|
6
|
+
<div class="lc_title">
|
|
7
|
+
<a
|
|
8
|
+
class="CartProductsKitEntity__link"
|
|
9
|
+
:href="productsKitLink">
|
|
10
|
+
{{ productsKitEntity.productsKit.name }}
|
|
11
|
+
</a>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
<div>
|
|
15
|
+
<i
|
|
16
|
+
class="icon-delete CartProductsKitEntity__remove"
|
|
17
|
+
@click="removeSimpleProducts"></i>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
<cart-entity
|
|
21
|
+
v-for="entity in productsKitEntity.entities"
|
|
22
|
+
:key="entity._id"
|
|
23
|
+
:entity="entity"
|
|
24
|
+
:editable="false"
|
|
25
|
+
class="CartProductsKitEntity__entity" />
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script>
|
|
31
|
+
import CartEntity from './../cart_entity/cart-entity';
|
|
32
|
+
|
|
33
|
+
export default {
|
|
34
|
+
name: 'CartProductsKitEntity',
|
|
35
|
+
components: {
|
|
36
|
+
CartEntity
|
|
37
|
+
},
|
|
38
|
+
props: {
|
|
39
|
+
productsKitEntity: {
|
|
40
|
+
type: Object,
|
|
41
|
+
required: true
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
computed: {
|
|
45
|
+
productsKitLink() {
|
|
46
|
+
return `/products-kit/${this.productsKitEntity.productsKit.alias}`;
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
methods: {
|
|
50
|
+
removeSimpleProducts() {
|
|
51
|
+
const simpleProducts = this.productsKitEntity.entities
|
|
52
|
+
.reduce((list, entity) => {
|
|
53
|
+
return [
|
|
54
|
+
...list,
|
|
55
|
+
...(entity.simpleProducts || [])
|
|
56
|
+
]
|
|
57
|
+
}, []);
|
|
58
|
+
this.$emit('remove', simpleProducts);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
</script>
|
|
63
|
+
|
|
64
|
+
<style lang="scss" scoped>
|
|
65
|
+
@import 'cart-products-kit-entity.scss';
|
|
66
|
+
</style>
|
|
@@ -15,7 +15,11 @@
|
|
|
15
15
|
class="CartShipmentsPricing__supplier">
|
|
16
16
|
<div class="CartShipmentsPricing__supplier-info">
|
|
17
17
|
<div class="CartShipmentsPricing__supplier-brands">
|
|
18
|
-
<div
|
|
18
|
+
<div
|
|
19
|
+
:class="{
|
|
20
|
+
'CartShipmentsPricing__supplier-info--disabled': disabledRates
|
|
21
|
+
}"
|
|
22
|
+
@click="removeSupplierConfirm(supplier)">
|
|
19
23
|
<i class="icon-delete"></i>
|
|
20
24
|
</div>
|
|
21
25
|
<div>
|
|
@@ -31,7 +35,7 @@
|
|
|
31
35
|
:key="`rate-${i}`"
|
|
32
36
|
class="CartShipmentsPricing__rate"
|
|
33
37
|
:class="{
|
|
34
|
-
'CartShipmentsPricing__rate--disabled': rate.disabled
|
|
38
|
+
'CartShipmentsPricing__rate--disabled': disabledRates || rate.disabled
|
|
35
39
|
}"
|
|
36
40
|
@click="!rate.selected && selectRate({ supplier, rate, shop, country, currency })">
|
|
37
41
|
<div class="CartShipmentsPricing__rate-info">
|
|
@@ -76,6 +80,12 @@ export default {
|
|
|
76
80
|
}
|
|
77
81
|
},
|
|
78
82
|
mixins: [confirm],
|
|
83
|
+
props: {
|
|
84
|
+
disabledRates: {
|
|
85
|
+
type: Boolean,
|
|
86
|
+
default: false
|
|
87
|
+
}
|
|
88
|
+
},
|
|
79
89
|
computed: {
|
|
80
90
|
...mapGetters(['shop', 'country', 'currency']),
|
|
81
91
|
...mapGetters('cart', [
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
@import '@/assets/scss/variables';
|
|
2
|
+
|
|
3
|
+
.CartShipping {
|
|
4
|
+
&__wrapper {
|
|
5
|
+
border: 2px solid $gray;
|
|
6
|
+
padding: 0px 20px 20px 20px;
|
|
7
|
+
@media (max-width: $bp-small-max) {
|
|
8
|
+
padding: 0px 10px 15px 10px;
|
|
9
|
+
}
|
|
10
|
+
@media (max-width: $bp-small-max) {
|
|
11
|
+
.lc_h3 {
|
|
12
|
+
font-size: 16px;
|
|
13
|
+
}
|
|
14
|
+
.lc_body-large {
|
|
15
|
+
font-size: 14px;
|
|
16
|
+
}
|
|
17
|
+
.lc_title-large {
|
|
18
|
+
font-size: 16px;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
::v-deep {
|
|
22
|
+
.form-label {
|
|
23
|
+
font-size: 15px !important;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
&--warning {
|
|
27
|
+
border-color: $error;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
&__header {
|
|
31
|
+
padding: 10px;
|
|
32
|
+
background-color: $gray;
|
|
33
|
+
margin: 0 -20px;
|
|
34
|
+
@media (max-width: $bp-small-max) {
|
|
35
|
+
margin: 0 -10px;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
&__pickup-errors {
|
|
39
|
+
color: $error;
|
|
40
|
+
font-size: 13px;
|
|
41
|
+
line-height: 17px;
|
|
42
|
+
}
|
|
43
|
+
}
|