@scayle/storefront-core 7.41.0 → 7.41.1
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/CHANGELOG.md +6 -0
- package/LICENSE +1 -1
- package/dist/helpers/productHelpers.cjs +2 -2
- package/dist/helpers/productHelpers.mjs +2 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/LICENSE
CHANGED
|
@@ -171,8 +171,8 @@ const getLatestCategory = categories => {
|
|
|
171
171
|
exports.getLatestCategory = getLatestCategory;
|
|
172
172
|
const getProductAndSiblingsColors = (product, colorAttributeName = "colorDetail") => {
|
|
173
173
|
const productColor = (0, _backbone.getFirstAttributeValue)(product.attributes, colorAttributeName);
|
|
174
|
-
const siblingsColors = product.siblings
|
|
175
|
-
return [productColor, ...
|
|
174
|
+
const siblingsColors = (product.siblings ?? []).filter(sibling => sibling.isActive).map(sibling => (0, _backbone.getFirstAttributeValue)(sibling.attributes, colorAttributeName));
|
|
175
|
+
return [productColor, ...siblingsColors].filter(color => !!color);
|
|
176
176
|
};
|
|
177
177
|
exports.getProductAndSiblingsColors = getProductAndSiblingsColors;
|
|
178
178
|
const getVariantCrosssellingValues = variants => {
|
|
@@ -151,10 +151,10 @@ export const getProductAndSiblingsColors = (product, colorAttributeName = "color
|
|
|
151
151
|
product.attributes,
|
|
152
152
|
colorAttributeName
|
|
153
153
|
);
|
|
154
|
-
const siblingsColors = product.siblings
|
|
154
|
+
const siblingsColors = (product.siblings ?? []).filter((sibling) => sibling.isActive).map(
|
|
155
155
|
(sibling) => getFirstAttributeValue(sibling.attributes, colorAttributeName)
|
|
156
156
|
);
|
|
157
|
-
return [productColor, ...siblingsColors
|
|
157
|
+
return [productColor, ...siblingsColors].filter(
|
|
158
158
|
(color) => !!color
|
|
159
159
|
);
|
|
160
160
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scayle/storefront-core",
|
|
3
|
-
"version": "7.41.
|
|
3
|
+
"version": "7.41.1",
|
|
4
4
|
"description": "Collection of essential utilities to work with the Storefront API",
|
|
5
5
|
"author": "SCAYLE Commerce Engine",
|
|
6
6
|
"license": "MIT",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@scayle/eslint-config-storefront": "3.2.6",
|
|
73
73
|
"@types/crypto-js": "4.2.2",
|
|
74
|
-
"@types/node": "20.11.
|
|
74
|
+
"@types/node": "20.11.19",
|
|
75
75
|
"@types/webpack-env": "1.18.4",
|
|
76
76
|
"@vitest/coverage-v8": "1.2.2",
|
|
77
77
|
"dprint": "0.45.0",
|