diff --git a/CHANGELOG.md b/CHANGELOG.md index b5170b7e69..743fb6a7f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - add ssrAppId to avoid second meta render on csr - @gibkigonzo (#4203) - take control over default broswer behavior and use saved category page size to load prev products - @gibkigonzo (#4201) - update getCurrentCartHash after add/remove coupon - @gibkigonzo (#4220) +- update replaceNumberToString, so it will change ONLY numbers to string - @gibkigonzo (#4217) ## [1.11.2] - 2020.03.10 diff --git a/core/modules/cart/helpers/productChecksum.ts b/core/modules/cart/helpers/productChecksum.ts index 21c27ae3a1..4798da845f 100644 --- a/core/modules/cart/helpers/productChecksum.ts +++ b/core/modules/cart/helpers/productChecksum.ts @@ -6,10 +6,11 @@ import cloneDeep from 'lodash-es/cloneDeep'; const replaceNumberToString = obj => { Object.keys(obj).forEach(key => { - if (typeof obj[key] === 'object') { + if (obj[key] !== null && typeof obj[key] === 'object') { return replaceNumberToString(obj[key]); + } else if (typeof obj[key] === 'number') { + obj[key] = String(obj[key]); } - obj[key] = String(obj[key]); }); return obj; }