rerobe-js-orm 3.3.2 → 3.3.4
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/lib/models/Product.js +8 -3
- package/package.json +1 -1
package/lib/models/Product.js
CHANGED
|
@@ -510,14 +510,16 @@ class Product extends Base_1.default {
|
|
|
510
510
|
].filter(Boolean),
|
|
511
511
|
},
|
|
512
512
|
];
|
|
513
|
-
|
|
513
|
+
const sectionsHTML = [];
|
|
514
514
|
// Generate HTML for base attribute sections
|
|
515
515
|
baseAttributeSections.forEach((section) => {
|
|
516
516
|
const sectionHTML = section.attributes
|
|
517
517
|
.map((attribute) => (attribute ? `<li>${attribute}</li>` : ''))
|
|
518
518
|
.filter(Boolean) // Removes any falsey values
|
|
519
519
|
.join('\n');
|
|
520
|
-
|
|
520
|
+
if (sectionHTML) {
|
|
521
|
+
sectionsHTML.push(`<div><strong>${t(section.title)}</strong><ul>\n${sectionHTML}\n</ul></div>`);
|
|
522
|
+
}
|
|
521
523
|
});
|
|
522
524
|
// Generate HTML for additional sections
|
|
523
525
|
additionalSections.forEach((section) => {
|
|
@@ -526,9 +528,12 @@ class Product extends Base_1.default {
|
|
|
526
528
|
.map((attribute) => (attribute ? `<li>${t(attribute)}</li>` : ''))
|
|
527
529
|
.filter(Boolean) // Removes any falsey values
|
|
528
530
|
.join('\n');
|
|
529
|
-
|
|
531
|
+
if (sectionHTML) {
|
|
532
|
+
sectionsHTML.push(`<div><strong>${t(section.title)}</strong><ul>\n${sectionHTML}\n</ul></div>`);
|
|
533
|
+
}
|
|
530
534
|
}
|
|
531
535
|
});
|
|
536
|
+
const descriptionHTML = sectionsHTML.join('');
|
|
532
537
|
return t(this.attributes.description) + (descriptionHTML ? `\n${descriptionHTML}` : '');
|
|
533
538
|
}
|
|
534
539
|
autoCreateMetaDescription() {
|