@lancom/shared 0.0.261 → 0.0.263
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 +11 -11
- package/assets/js/constants/country.js +1 -1
- package/assets/scss/ui_kit/_forms.scss +2 -2
- package/assets/scss/ui_kit/_tooltip.scss +1 -3
- package/assets/scss/variables/_theme.scss +3 -3
- package/components/asides/contact_us/contact-us.vue +6 -0
- package/components/checkout/cart/cart.mixin.js +5 -5
- package/components/checkout/cart/cart_price_info/cart-price-info.vue +2 -2
- package/components/checkout/cart/cart_shipments_pricing/cart-shipments-pricing.vue +2 -2
- package/components/checkout/order/address-form/address-form.vue +3 -4
- package/components/checkout/order/order-shipping-method/order-shipping-method.vue +2 -2
- package/components/checkout/order/order.vue +1 -1
- package/components/common/contacts-phone.vue +46 -0
- package/components/common/payment/payment_card/pinpayment/pinpayment.vue +5 -34
- package/components/common/postcode_select/postcode-select.vue +1 -5
- package/components/common/products_total_pricing/products-total-pricing.vue +1 -5
- package/components/design/approve_design_header/approve-design-header.vue +1 -1
- package/components/editor/editor.vue +2 -8
- package/components/editor/editor_pricing/editor-pricing.vue +2 -2
- package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_prints/editor-pricing-details-prints.vue +7 -8
- package/components/editor/editor_pricing/editor_pricing_details/editor_pricing_details_products/editor-pricing-details-products.vue +5 -13
- package/components/editor/editor_product_details/editor-product-details.scss +0 -6
- package/components/editor/editor_product_details/editor-product-details.vue +2 -12
- package/components/faq/faq.vue +2 -2
- package/components/modals/order_modal/order-modal.vue +3 -17
- package/components/order/order_price/order-price.vue +3 -5
- package/components/order/order_prints_groups/order-prints-groups.vue +1 -3
- package/components/order/order_products_groups/order-products-groups.vue +1 -3
- package/components/order/order_refund_view/order-refund-view.vue +3 -5
- package/components/order/order_setup_groups/order-setup-groups.vue +2 -4
- package/components/order/order_sku_groups/order-sku-groups.vue +1 -3
- package/components/order/order_view/order-view.vue +6 -10
- package/components/pricing/pricing_digital_printing/pricing-digital-printing.vue +1 -3
- package/components/pricing/pricing_example/pricing-example.vue +3 -3
- package/components/pricing/pricing_how_we_calculate/pricing-how-we-calculate.vue +2 -7
- package/components/pricing/pricing_products_calculator/pricing_product_calculator/pricing-product-calculator.vue +2 -2
- package/components/pricing/pricing_screen_printing/pricing-screen-printing.vue +1 -3
- package/components/product/product_price_range/product-price-range.vue +5 -6
- package/components/product/product_prints_price_info/product-prints-price-info.vue +2 -2
- package/components/products/products_autocomplete/products-autocomplete.scss +12 -10
- package/components/quotes/quote_request/quote-request.vue +12 -5
- package/components/quotes/quote_view/quote_option_view/quote-option-view.vue +4 -5
- package/components/subscribe/subscribe.vue +10 -1
- package/feeds/google-shopping.js +47 -3
- package/mixins/meta-info.js +1 -4
- package/mixins/products-price.js +2 -3
- package/package.json +1 -1
- package/plugins/cache-headers.js +5 -1
- package/store/cart.js +6 -7
- package/store/index.js +5 -16
- package/store/product.js +2 -3
package/feeds/google-shopping.js
CHANGED
|
@@ -65,14 +65,13 @@ async function googleShoppingFeed(axios, config, availableStores) {
|
|
|
65
65
|
'g:additional_image_link': images.map(i => ({ _text: i })),
|
|
66
66
|
'g:price': { _text: `${(sp.price || 0)} AUD` },
|
|
67
67
|
'g:availability': { _text: sp.quantityStock > 0 ? 'in_stock' : 'out_of_stock' },
|
|
68
|
-
'g:google_product_category': { _text: 2047 },
|
|
69
|
-
'g:product_type': { _text: `Home > Products > ${product.productType.name}`, },
|
|
68
|
+
'g:google_product_category': { _text: product.feedGoogleProductCategory || 2047 },
|
|
69
|
+
'g:product_type': { _text: product.feedProductType || `Home > Products > ${product.productType.name}`, },
|
|
70
70
|
'g:is_bundle': { _text: product.prePrint ? 'yes' : 'no' },
|
|
71
71
|
'g:identifier_exists': sp.gtin ? 'yes' : 'no',
|
|
72
72
|
'g:product_weight': { _text: `${product.weight} kg` },
|
|
73
73
|
'g:shipping_weight': { _text: `${((product.weight || 0) + (product.weight || 0) * 0.05).toFixed(3)} kg` },
|
|
74
74
|
'g:quantity': { _text: sp.quantityStock },
|
|
75
|
-
|
|
76
75
|
};
|
|
77
76
|
|
|
78
77
|
if (sp.gtin) {
|
|
@@ -101,6 +100,51 @@ async function googleShoppingFeed(axios, config, availableStores) {
|
|
|
101
100
|
info['g:shipping_height'] = { _text: `${product.volume.height} cm` };
|
|
102
101
|
}
|
|
103
102
|
}
|
|
103
|
+
|
|
104
|
+
const productHighlight = `${product.feedProductHighlight || ''}`
|
|
105
|
+
.trim()
|
|
106
|
+
.split(/\n+/g)
|
|
107
|
+
.map(highlight => `${highlight || ''}`.trim())
|
|
108
|
+
.filter(highlight => !!highlight);
|
|
109
|
+
if (productHighlight.length > 0) {
|
|
110
|
+
info['g:product_highlight'] = productHighlight.map(highlight => ({ _text: highlight }));
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if ((product.feedProductDetails || []).length > 0) {
|
|
114
|
+
info['g:product_detail'] = product.feedProductDetails.map(productDetail => {
|
|
115
|
+
const detail = {
|
|
116
|
+
'g:attribute_name': { _text: productDetail.attributeName },
|
|
117
|
+
'g:attribute_value': { _text: productDetail.attributeValue },
|
|
118
|
+
}
|
|
119
|
+
if (productDetail.sectionName) {
|
|
120
|
+
detail['g:section_name'] = productDetail.sectionName;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return detail;
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if ((product.feedCertifications || []).length > 0) {
|
|
128
|
+
info['g:certification'] = product.feedCertifications.map(certification => {
|
|
129
|
+
const detail = {
|
|
130
|
+
'g:certification_authority': { _text: certification.certificationAuthority },
|
|
131
|
+
'g:certification_name': { _text: certification.certificationName },
|
|
132
|
+
'g:certification_code': { _text: certification.certificationCode },
|
|
133
|
+
}
|
|
134
|
+
return detail;
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
for (let label = 0; label <= 4; label++) {
|
|
139
|
+
if (product[`feedCustomLabel${label}`]) {
|
|
140
|
+
info[`custom_label_${label}`] = { _text: product[`feedCustomLabel${label}`] };
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
if (product.feedLifestyleImage) {
|
|
145
|
+
info['g:lifestyle_image_link'] = { _text: product.feedLifestyleImage };
|
|
146
|
+
}
|
|
147
|
+
|
|
104
148
|
return info;
|
|
105
149
|
})
|
|
106
150
|
];
|
package/mixins/meta-info.js
CHANGED
|
@@ -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 || {};
|
package/mixins/products-price.js
CHANGED
|
@@ -22,7 +22,7 @@ const productsPrice = {
|
|
|
22
22
|
};
|
|
23
23
|
},
|
|
24
24
|
computed: {
|
|
25
|
-
...mapGetters(['pricingSettings', 'shop'
|
|
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
package/plugins/cache-headers.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
module.exports = function (req, res, next) {
|
|
2
2
|
if (!/auth\=/.test(req.headers?.cookie || '')) {
|
|
3
|
-
const
|
|
3
|
+
const routes = [
|
|
4
|
+
/^\/quotes\//,
|
|
5
|
+
/\.xml$/
|
|
6
|
+
];
|
|
7
|
+
const value = routes.some(route => route.test(`${req.url}`)) ? 'no-cache' : `max-age=${31536000}`;
|
|
4
8
|
res.setHeader('Cache-Control', value);
|
|
5
9
|
} else {
|
|
6
10
|
res.setHeader('Cache-Control', 'no-cache');
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
@@ -160,7 +160,6 @@ export const actions = {
|
|
|
160
160
|
commit('setSelectedPrintArea', { printArea: first._id, size: first.printSize });
|
|
161
161
|
}
|
|
162
162
|
} catch (e) {
|
|
163
|
-
console.log(e);
|
|
164
163
|
const { status, data } = e?.response || {};
|
|
165
164
|
const statusCode = status || 500;
|
|
166
165
|
commit('setLoadError', {
|
|
@@ -200,10 +199,10 @@ export const actions = {
|
|
|
200
199
|
async updatePriceIncludeGST({ commit }, value) {
|
|
201
200
|
commit('setPriceIncludeGST', value);
|
|
202
201
|
},
|
|
203
|
-
async calculateProductPrice({ state: { template, product, isPrintPricing }, commit, getters },
|
|
202
|
+
async calculateProductPrice({ state: { template, product, isPrintPricing }, commit, getters }, shop) {
|
|
204
203
|
commit('setCalculatingPrice', true);
|
|
205
204
|
const entities = getProductsForCalculatePricing(product, getters.usedSimpleProducts, template.layers, isPrintPricing, true);
|
|
206
|
-
const response = await api.calculateProductPrice({ entities
|
|
205
|
+
const response = await api.calculateProductPrice({ entities }, shop._id);
|
|
207
206
|
commit('setProductPricing', response);
|
|
208
207
|
commit('setCalculatingPrice', false);
|
|
209
208
|
},
|