Skip to content
This repository was archived by the owner on Jan 26, 2024. It is now read-only.

Commit 466e1ec

Browse files
author
Tomasz Kostuch
authored
Merge pull request #4273 from gibkigonzo/bugfix/omit-totals-for-product-comparision
omit totals for product comparision
2 parents 7a9d672 + 1a38d81 commit 466e1ec

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2626
- update replaceNumberToString, so it will change ONLY numbers to string - @gibkigonzo (#4217)
2727
- allow empty shipping methods in checkout - @gibkigozno (#4192)
2828
- configure products before price update - this is needed to have variant sku as product sku - @gibkigonzo (#4053)
29-
- omit stock when creating cart hash, it is not needed to compare products - @gibkigozno (#4235)
29+
- omit stock and totals when creating cart hash, it is not needed to compare products - @gibkigozno (#4235, #4273)
3030

3131
## [1.11.2] - 2020.03.10
3232

core/helpers/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,9 @@ export const serial = async promises => {
225225
// helper to calculate the hash of the shopping cart
226226
export const calcItemsHmac = (items = [], token) => {
227227
return sha3_224(JSON.stringify({
228-
items: items.map(item => omit(item, ['stock'])),
228+
// we need to omit those properties because they are loaded async and added to product data
229+
// and they are not needed to compare products
230+
items: items.map(item => omit(item, ['stock', 'totals'])),
229231
token: token
230232
}))
231233
}

0 commit comments

Comments
 (0)