rerobe-js-orm 4.1.4 → 4.1.6

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.
@@ -230,7 +230,7 @@ class ReRobeProductHelpers {
230
230
  }, '');
231
231
  }
232
232
  static autoCreateMetaDataTitle(productObj) {
233
- const { color, productType, productStyle, brand, size } = productObj;
233
+ const { color, productType, productStyle, brand, size, standardSize } = productObj;
234
234
  // Singularize the product type
235
235
  const singularProductType = (0, Utilities_1.singularizeProductType)(productType);
236
236
  // Function to build the title
@@ -250,7 +250,9 @@ class ReRobeProductHelpers {
250
250
  // For non-'Vintage' brands, append "by ${brand.trim()}"
251
251
  const titleWithBrand = !brand.includes('Vintage') ? `${baseTitle} by ${brand.trim()}` : baseTitle;
252
252
  // Add size to the end of the title if it's available
253
- return size && size.trim() !== '' ? `${titleWithBrand}, Size ${size.trim()}` : titleWithBrand;
253
+ return size && size.trim() !== ''
254
+ ? `${titleWithBrand}, Size ${standardSize ? standardSize.trim() : size.trim()}`
255
+ : titleWithBrand;
254
256
  };
255
257
  // Generate the result
256
258
  let result = buildTitle(true);
@@ -675,7 +677,7 @@ class ReRobeProductHelpers {
675
677
  return 'unisex';
676
678
  }
677
679
  };
678
- return Object.assign(Object.assign(Object.assign({ id: productObj.handle, title: productObj.metaDataTitle || productObj.title, description: productObj.metaDataDescription || productObj.description || '', link: `${primaryDomain}/products/${productObj.handle}`, image_link: productObj.imageUrls && productObj.imageUrls.length > 0 ? productObj.imageUrls[0] : '', price: `${Number(productObj.price).toFixed(2)} ${currency}` }, (productObj.costPerItem && {
680
+ return Object.assign(Object.assign(Object.assign({ id: productObj.handle, title: productObj.metaDataTitle || productObj.title, description: productObj.description || '', link: `${primaryDomain}/products/${productObj.handle}`, image_link: productObj.imageUrls && productObj.imageUrls.length > 0 ? productObj.imageUrls[0] : '', price: `${Number(productObj.price).toFixed(2)} ${currency}` }, (productObj.costPerItem && {
679
681
  cost_of_goods_sold: `${Number(productObj.costPerItem).toFixed(2)} ${currency}`,
680
682
  })), (productObj.isOnSale === 'yes' &&
681
683
  productObj.salePrice &&
@@ -474,7 +474,7 @@ class Product extends Base_1.default {
474
474
  return this.utilities.capitalizeString(result).trim();
475
475
  }
476
476
  autoCreateMetaDataTitle() {
477
- const { color, productType, productStyle, brand, size } = this.filterAttributes;
477
+ const { color, productType, productStyle, brand, size, standardSize } = this.filterAttributes;
478
478
  // Singularize the product type
479
479
  const singularProductType = this.utilities.singularizeProductType(productType);
480
480
  // Function to build the title
@@ -494,7 +494,9 @@ class Product extends Base_1.default {
494
494
  // For non-'Vintage' brands, append "by ${brand.trim()}"
495
495
  const titleWithBrand = !brand.includes('Vintage') ? `${baseTitle} by ${brand.trim()}` : baseTitle;
496
496
  // Add size to the end of the title if it's available
497
- return size && size.trim() !== '' ? `${titleWithBrand}, Size ${size.trim()}` : titleWithBrand;
497
+ return size && size.trim() !== ''
498
+ ? `${titleWithBrand}, Size ${standardSize ? standardSize.trim() : size.trim()}`
499
+ : titleWithBrand;
498
500
  };
499
501
  // Generate the result
500
502
  let result = buildTitle(true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerobe-js-orm",
3
- "version": "4.1.4",
3
+ "version": "4.1.6",
4
4
  "description": "ReRobe's Javascript ORM Framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",