@lancom/shared 0.0.362 → 0.0.364

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.
@@ -140,7 +140,7 @@ export function generateProductsLink($route, data, skipParams = false) {
140
140
  }
141
141
 
142
142
  Object.keys({ ...(($route && $route.query) || {}), ...data }).forEach(key => {
143
- const rootKeys = ['text', 'sort', 'page', 'category', 'type', 'brand', 'minimumQty', 'productionTime'];
143
+ const rootKeys = ['text', 'sort', 'page', 'category', 'type', 'brand', 'minimumQty', 'productionTime', 'srsltid'];
144
144
  if (!rootKeys.includes(key)) {
145
145
  let items = ($route && $route.query[key]) ? $route.query[key].split(',') : [];
146
146
  items = (data[key] ? (items.includes(data[key]) ? items.filter(c => c !== data[key]) : [...items, data[key]]) : items).join(',');
@@ -10,6 +10,11 @@ export default async function ({ store, route, redirect, error }) {
10
10
  const routeInfo = await store.dispatch('page/fetchRouteInfo', data);
11
11
  if (routeInfo?.type === 'redirect' && routeInfo.redirectTo) {
12
12
  redirect(301, route.fullPath.replace(route.path, routeInfo.redirectTo));
13
+ } else if (routeInfo?.type === 'deleted') {
14
+ error({
15
+ statusCode: 410,
16
+ message: 'Page has been deleted'
17
+ });
13
18
  }
14
19
  } else {
15
20
  const data = {
@@ -295,10 +295,10 @@ export default (IS_PRODUCT_PRESET_PRINT_PRICING, isEditor = false) => ({
295
295
  '@type': 'http://schema.org/QuantitativeValue',
296
296
  value: this.product.sameDayDispatch ? 1 : 0
297
297
  };
298
- if (sp.quantityStock > 0) {
299
- offer.shippingDetails = { "@id": "#shipping_policy" };
300
- offer.hasMerchantReturnPolicy = { "@id": "#return_policy" };
301
- }
298
+ // if (sp.quantityStock > 0) {
299
+ offer.shippingDetails = { "@id": "#shipping_policy" };
300
+ offer.hasMerchantReturnPolicy = { "@id": "#return_policy" };
301
+ // }
302
302
  }
303
303
 
304
304
  const galleryImages = this.product.images?.filter(i => !(i.types || []).includes('designer') && i.color === sp.color?._id) || [];
@@ -333,14 +333,6 @@ export default (IS_PRODUCT_PRESET_PRINT_PRICING, isEditor = false) => ({
333
333
  // schema.gtin = SKU;
334
334
  }
335
335
 
336
- if (this.$store.state.shop?.returnPolicySchema) {
337
- productSchema.hasMerchantReturnPolicy = this.$store.state.shop?.returnPolicySchema;
338
- }
339
-
340
- if (this.$store.state.shop?.shippingPolicySchema) {
341
- productSchema.shippingDetails = this.$store.state.shop?.shippingPolicySchema;
342
- }
343
-
344
336
  if (aggregateRating?.count > 0) {
345
337
  productSchema.aggregateRating = {
346
338
  '@type': 'AggregateRating',
@@ -413,7 +405,9 @@ export default (IS_PRODUCT_PRESET_PRINT_PRICING, isEditor = false) => ({
413
405
  return [
414
406
  productSchema,
415
407
  breadcrumbSchema,
416
- mainEntity.length > 0 ? faqSchema : null
408
+ mainEntity.length > 0 ? faqSchema : null,
409
+ this.$store.state.shop?.returnPolicySchema,
410
+ this.$store.state.shop?.shippingPolicySchema
417
411
  ].filter(s => !!s);
418
412
  }
419
413
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lancom/shared",
3
- "version": "0.0.362",
3
+ "version": "0.0.364",
4
4
  "description": "lancom common scripts",
5
5
  "author": "e.tokovenko <e.tokovenko@gmail.com>",
6
6
  "repository": {