@lancom/shared 0.0.358 → 0.0.360
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/mixins/product-view.js +12 -5
- package/package.json +1 -1
package/mixins/product-view.js
CHANGED
|
@@ -265,10 +265,11 @@ export default (IS_PRODUCT_PRESET_PRINT_PRICING, isEditor = false) => ({
|
|
|
265
265
|
const spMaxPrice = (sp.pricing || []).reduce((price, pricing) => Math.max(price, pricing.price), 0);
|
|
266
266
|
const maxPrice = this.printsPrice ? spMaxPrice + this.printsPrice : spMaxPrice;
|
|
267
267
|
const availability = sp.quantityStock > 0 ? 'InStock' : 'OutOfStock';
|
|
268
|
+
const name = `${this.product.name} | ${sp.size?.shortName || ''} ${sp.color?.name || ''}`;
|
|
268
269
|
|
|
269
270
|
const offer = {
|
|
270
271
|
'@type': 'Offer',
|
|
271
|
-
name
|
|
272
|
+
name,
|
|
272
273
|
url,
|
|
273
274
|
availability: `https://schema.org/${availability}`,
|
|
274
275
|
price: +tax(maxPrice, this.gstTax).toFixed(2),
|
|
@@ -308,7 +309,7 @@ export default (IS_PRODUCT_PRESET_PRINT_PRICING, isEditor = false) => ({
|
|
|
308
309
|
image,
|
|
309
310
|
...galleryImages.map(i => i.large).filter(i => !!i && i !== image)
|
|
310
311
|
],
|
|
311
|
-
"name":
|
|
312
|
+
"name": name,
|
|
312
313
|
"description": description,
|
|
313
314
|
"color": sp.color?.name,
|
|
314
315
|
"size": sp.size?.shortName,
|
|
@@ -330,6 +331,14 @@ export default (IS_PRODUCT_PRESET_PRINT_PRICING, isEditor = false) => ({
|
|
|
330
331
|
// schema.gtin = SKU;
|
|
331
332
|
}
|
|
332
333
|
|
|
334
|
+
if (this.$store.state.shop?.returnPolicySchema) {
|
|
335
|
+
productSchema.hasMerchantReturnPolicy = this.$store.state.shop?.returnPolicySchema;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
if (this.$store.state.shop?.shippingPolicySchema) {
|
|
339
|
+
productSchema.shippingDetails = this.$store.state.shop?.shippingPolicySchema;
|
|
340
|
+
}
|
|
341
|
+
|
|
333
342
|
if (aggregateRating?.count > 0) {
|
|
334
343
|
productSchema.aggregateRating = {
|
|
335
344
|
'@type': 'AggregateRating',
|
|
@@ -402,9 +411,7 @@ export default (IS_PRODUCT_PRESET_PRINT_PRICING, isEditor = false) => ({
|
|
|
402
411
|
return [
|
|
403
412
|
productSchema,
|
|
404
413
|
breadcrumbSchema,
|
|
405
|
-
mainEntity.length > 0 ? faqSchema : null
|
|
406
|
-
this.$store.state.shop?.shippingPolicySchema,
|
|
407
|
-
this.$store.state.shop?.returnPolicySchema
|
|
414
|
+
mainEntity.length > 0 ? faqSchema : null
|
|
408
415
|
].filter(s => !!s);
|
|
409
416
|
}
|
|
410
417
|
});
|