rerobe-js-orm 4.1.7 → 4.1.8
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.
|
@@ -248,7 +248,11 @@ class ReRobeProductHelpers {
|
|
|
248
248
|
}
|
|
249
249
|
const baseTitle = parts.join(' ');
|
|
250
250
|
// For non-'Vintage' brands, append "by ${brand.trim()}"
|
|
251
|
-
const titleWithBrand = !brand.
|
|
251
|
+
const titleWithBrand = !(brand.toLowerCase().trim().includes('vintage') ||
|
|
252
|
+
brand.toLowerCase().trim().includes('unknown') ||
|
|
253
|
+
brand.toLowerCase().trim().includes('none'))
|
|
254
|
+
? `${brand.trim()} - ${baseTitle}`
|
|
255
|
+
: baseTitle;
|
|
252
256
|
// Add size to the end of the title if it's available
|
|
253
257
|
return size && size.trim() !== ''
|
|
254
258
|
? `${titleWithBrand}, Size ${standardSize ? standardSize.trim() : size.trim()}`
|
|
@@ -264,11 +268,12 @@ class ReRobeProductHelpers {
|
|
|
264
268
|
}
|
|
265
269
|
static autoCreateMetaDescription(productObj) {
|
|
266
270
|
var _a;
|
|
267
|
-
const { color, productType, productStyle, condition, size, standardSize, brand, sizeComment, materialComposition } = productObj;
|
|
271
|
+
const { color, productType, productStyle, condition, size, standardSize, brand, sizeComment, materialComposition, gender, } = productObj;
|
|
268
272
|
const materials = this.materialCompJoinedString(materialComposition);
|
|
269
273
|
const fit = ((_a = options_1.sizeCommentOptions.find((option) => option.value === sizeComment)) === null || _a === void 0 ? void 0 : _a.label) || '';
|
|
270
274
|
const joinedProductStyle = productStyle.join(', ');
|
|
271
275
|
const elements = [
|
|
276
|
+
gender && `Primary segment: ${gender}`,
|
|
272
277
|
brand && `Brand: ${brand}`,
|
|
273
278
|
size && `Size: ${standardSize ? standardSize : size}`,
|
|
274
279
|
color && `Color: ${color}`,
|
|
@@ -278,9 +283,8 @@ class ReRobeProductHelpers {
|
|
|
278
283
|
materials && `Material: ${materials}`,
|
|
279
284
|
fit && `Fit: ${fit}`,
|
|
280
285
|
].filter(Boolean); // Removes any falsey values
|
|
281
|
-
const baseDescription = elements.join(', ')
|
|
282
|
-
|
|
283
|
-
return baseDescription + ellipsis;
|
|
286
|
+
const baseDescription = elements.join(', ');
|
|
287
|
+
return baseDescription;
|
|
284
288
|
}
|
|
285
289
|
static autoCreateFullSwedishDescriptionForTraderaHTML(productDescription, merchantName = 'våra') {
|
|
286
290
|
return `
|
|
@@ -700,6 +704,7 @@ class ReRobeProductHelpers {
|
|
|
700
704
|
color: productObj.color || 'various',
|
|
701
705
|
size: productObj.standardSize || 'unknown',
|
|
702
706
|
material: this.materialCompJoinedString(productObj.materialComposition),
|
|
707
|
+
identifier_exists: 'no',
|
|
703
708
|
};
|
|
704
709
|
}
|
|
705
710
|
}
|
package/lib/helpers/Utilities.js
CHANGED
package/lib/models/Product.js
CHANGED
|
@@ -492,7 +492,11 @@ class Product extends Base_1.default {
|
|
|
492
492
|
}
|
|
493
493
|
const baseTitle = parts.join(' ');
|
|
494
494
|
// For non-'Vintage' brands, append "by ${brand.trim()}"
|
|
495
|
-
const titleWithBrand = !brand.
|
|
495
|
+
const titleWithBrand = !(brand.toLowerCase().trim().includes('vintage') ||
|
|
496
|
+
brand.toLowerCase().trim().includes('unknown') ||
|
|
497
|
+
brand.toLowerCase().trim().includes('none'))
|
|
498
|
+
? `${brand.trim()} - ${baseTitle}`
|
|
499
|
+
: baseTitle;
|
|
496
500
|
// Add size to the end of the title if it's available
|
|
497
501
|
return size && size.trim() !== ''
|
|
498
502
|
? `${titleWithBrand}, Size ${standardSize ? standardSize.trim() : size.trim()}`
|
|
@@ -600,12 +604,13 @@ class Product extends Base_1.default {
|
|
|
600
604
|
}
|
|
601
605
|
autoCreateMetaDescription() {
|
|
602
606
|
var _a;
|
|
603
|
-
const { color, productType, productStyle, condition, size, brand, standardSize } = this.filterAttributes;
|
|
607
|
+
const { color, productType, productStyle, condition, size, brand, standardSize, gender } = this.filterAttributes;
|
|
604
608
|
const { sizeComment } = this.consignmentAttributes;
|
|
605
609
|
const materials = this.materialCompJoinedString();
|
|
606
610
|
const fit = ((_a = options_1.sizeCommentOptions.find((option) => option.value === sizeComment)) === null || _a === void 0 ? void 0 : _a.label) || '';
|
|
607
611
|
const joinedProductStyle = productStyle.join(', ');
|
|
608
612
|
const elements = [
|
|
613
|
+
gender && `Primary segment: ${gender}`,
|
|
609
614
|
brand && `Brand: ${brand}`,
|
|
610
615
|
size && `Size: ${standardSize ? standardSize : size}`,
|
|
611
616
|
color && `Color: ${color}`,
|
|
@@ -615,9 +620,8 @@ class Product extends Base_1.default {
|
|
|
615
620
|
materials && `Material: ${materials}`,
|
|
616
621
|
fit && `Fit: ${fit}`,
|
|
617
622
|
].filter(Boolean); // Removes any falsey values
|
|
618
|
-
const baseDescription = elements.join(', ')
|
|
619
|
-
|
|
620
|
-
return baseDescription + ellipsis;
|
|
623
|
+
const baseDescription = elements.join(', ');
|
|
624
|
+
return baseDescription;
|
|
621
625
|
}
|
|
622
626
|
generateSchemaForTypesense(name = 'prod_products_20220503') {
|
|
623
627
|
return {
|