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 17, 2024
1 parent b25b270 commit 92c021a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix GH build action & added package version and short commit hash to artifact names in GitHub Actions workflow for improved traceability and uniqueness. ([#2494](https://github.com/bigcommerce/cornerstone/pull/2494))
- Bump stencil-utils to 6.18.0 ([#2493](https://github.com/bigcommerce/cornerstone/pull/2493))
- Bump other GH actions to fix warnings related to old versions. ([#2495](https://github.com/bigcommerce/cornerstone/pull/2495))
- 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
9 changes: 4 additions & 5 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 92c021a

Please sign in to comment.