Skip to content

Commit f1ca3af

Browse files
authored
Merge pull request #1387 from junedkazi/STRF-4575-fix-suggestive-cart
STRF-4575 Switch from quote item hash to id which is immutable
2 parents e2cbbe4 + 1b37af7 commit f1ca3af

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Draft
44
- Remove unnecessary API call to get cookie notification status [#1380](https://github.com/bigcommerce/cornerstone/pull/1380)
5+
- Cart switch from quote item hash to id which is immutable [#1387](https://github.com/bigcommerce/cornerstone/pull/1387)
6+
57

68
## 2.6.0 (2018-11-05)
79
- Add support for Card Management: List, Delete, Edit, Add and Default Payment Method [#1376](https://github.com/bigcommerce/cornerstone/pull/1376)

assets/js/theme/common/product-details.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ export default class ProductDetails {
380380
if (this.previewModal) {
381381
this.previewModal.open();
382382

383-
this.updateCartContent(this.previewModal, response.data.cart_item.hash);
383+
this.updateCartContent(this.previewModal, response.data.cart_item.id);
384384
} else {
385385
this.$overlay.show();
386386
// if no modal, redirect to the cart page
@@ -392,14 +392,14 @@ export default class ProductDetails {
392392
/**
393393
* Get cart contents
394394
*
395-
* @param {String} cartItemHash
395+
* @param {String} cartItemId
396396
* @param {Function} onComplete
397397
*/
398-
getCartContent(cartItemHash, onComplete) {
398+
getCartContent(cartItemId, onComplete) {
399399
const options = {
400400
template: 'cart/preview',
401401
params: {
402-
suggest: cartItemHash,
402+
suggest: cartItemId,
403403
},
404404
config: {
405405
cart: {
@@ -430,11 +430,11 @@ export default class ProductDetails {
430430
* Update cart content
431431
*
432432
* @param {Modal} modal
433-
* @param {String} cartItemHash
433+
* @param {String} cartItemId
434434
* @param {Function} onComplete
435435
*/
436-
updateCartContent(modal, cartItemHash, onComplete) {
437-
this.getCartContent(cartItemHash, (err, response) => {
436+
updateCartContent(modal, cartItemId, onComplete) {
437+
this.getCartContent(cartItemId, (err, response) => {
438438
if (err) {
439439
return;
440440
}

0 commit comments

Comments
 (0)