@lancom/shared 0.0.357 → 0.0.359
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 +5 -4
- 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),
|
|
@@ -294,6 +295,8 @@ export default (IS_PRODUCT_PRESET_PRINT_PRICING, isEditor = false) => ({
|
|
|
294
295
|
'@type': 'http://schema.org/QuantitativeValue',
|
|
295
296
|
value: this.product.sameDayDispatch ? 1 : 0
|
|
296
297
|
};
|
|
298
|
+
offer.shippingDetails = { "@id": "#shipping_policy" };
|
|
299
|
+
offer.hasMerchantReturnPolicy = { "@id": "#return_policy" };
|
|
297
300
|
}
|
|
298
301
|
|
|
299
302
|
const galleryImages = this.product.images?.filter(i => !(i.types || []).includes('designer') && i.color === sp.color?._id) || [];
|
|
@@ -306,13 +309,11 @@ export default (IS_PRODUCT_PRESET_PRINT_PRICING, isEditor = false) => ({
|
|
|
306
309
|
image,
|
|
307
310
|
...galleryImages.map(i => i.large).filter(i => !!i && i !== image)
|
|
308
311
|
],
|
|
309
|
-
"name":
|
|
312
|
+
"name": name,
|
|
310
313
|
"description": description,
|
|
311
314
|
"color": sp.color?.name,
|
|
312
315
|
"size": sp.size?.shortName,
|
|
313
316
|
"offers": offer,
|
|
314
|
-
"shippingDetails": { "@id": "#shipping_policy" },
|
|
315
|
-
"hasMerchantReturnPolicy": { "@id": "#return_policy" }
|
|
316
317
|
};
|
|
317
318
|
})
|
|
318
319
|
};
|