Product SKU should be always cast to string #3606
Labels
feature request
Requests for new features. Please be as specific as possible and provide proposal API if it you can
P2: Important
Priority mark - still high ;)
Milestone
What is the motivation for adding / enhancing this feature?
Sometimes the client SKU is in the form of an integer. On the VSF side, we keep them as a string. With synchronization enabled, this results in duplicate products (for vsf, this product is not in the cart). For security reasons, it seems necessary to cast both values on a string, i.e. instead of the selected condition in here:
https://github.com/DivanteLtd/vue-storefront/blob/master/core/modules/cart/store/actions.ts#L624
add this:
const serverItem = serverItems.find((itm) => { return itm.sku.toString() === clientItem.sku.toString() || itm.sku.indexOf(clientItem.sku + '-') === 0 /* bundle products */ })
Casting string to string will give a string, casting int to string also will give a stirng, and then
===
will work.(author: sszczepanski)
Can you complete this feature request by yourself?
Which Release Cycle state this refers to? Info for developer.
Pick one option.
develop
branch and create Pull Request2. Feature / Improvement
back todevelop
.release
branch and create Pull Request3. Stabilisation fix
back torelease
.hotfix
ormaster
branch and create Pull Request4. Hotfix
back tohotfix
.The text was updated successfully, but these errors were encountered: