Skip to content

Commit

Permalink
fix(storefront): STRF-12475 Use utils.api.cart.postFormData when upda…
Browse files Browse the repository at this point in the history
…ting variants in cart
  • Loading branch information
jordanarldt committed Dec 26, 2024
1 parent 253dd17 commit e9fbe7d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Bump other GH actions to fix warnings related to old versions [#2495](https://github.com/bigcommerce/cornerstone/pull/2495)
- Add a section to display the payment promotion widget in the drop-down of the cart preview [#2523](https://github.com/bigcommerce/cornerstone/pull/2523)
- Add support Node 20 [#2519](https://github.com/bigcommerce/cornerstone/pull/2519)
- Use fetch when updating variants in cart ([#2521](https://github.com/bigcommerce/cornerstone/pull/2521))

## 6.15.0 (10-18-2024)
- Cornerstone changes to support inc/ex tax price lists on PDP [#2486](https://github.com/bigcommerce/cornerstone/pull/2486)
Expand Down
12 changes: 12 additions & 0 deletions assets/js/theme/cart.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,18 @@ export default class Cart extends PageManager {
this.$modal.one(ModalEvents.opened, optionChangeHandler);
}

const modalForm = this.$modal.find('form');
const refreshContent = () => this.refreshContent();
async function onSubmit(event) {
event.preventDefault();
utils.api.cart.postFormData(new FormData(this), () => {
modal.close();
refreshContent();
});
}

modalForm.on('submit', onSubmit);

this.productDetails = new CartItemDetails(this.$modal, context);

this.bindGiftWrappingForm();
Expand Down
7 changes: 4 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"author": "BigCommerce",
"license": "MIT",
"dependencies": {
"@bigcommerce/stencil-utils": "6.18.0",
"@bigcommerce/stencil-utils": "6.19.0",
"core-js": "^3.9.0",
"creditcards": "^4.2.0",
"easyzoom": "^2.5.3",
Expand Down

0 comments on commit e9fbe7d

Please sign in to comment.