TRAC-362: add optional requestOptions to itemAdd and handleItemAdd for locale-aware cart requests#240
Merged
bc-yevhenii-buliuk merged 1 commit intomasterfrom Apr 7, 2026
Merged
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
78d0b4f to
5986b03
Compare
chanceaclark
approved these changes
Apr 2, 2026
funivan
approved these changes
Apr 2, 2026
funivan
left a comment
There was a problem hiding this comment.
could you check all calls related to remoteRequest. Thanks.
jairo-bc
approved these changes
Apr 3, 2026
…dd for locale-aware cart requests
5986b03 to
52b6ef6
Compare
Contributor
|
🎉 This PR is included in version 6.22.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Jira: TRAC-362
What/Why?
This PR adds optional requestOptions param to
itemAdd()andhandleItemAdd()for multi-lang supportBigCommerce supports multi-language via URL subfolder locales (e.g.
/es,/fr). When a shopper is on site.com/es, AJAX requests must include the /es prefix so the server returns translated content.itemAdd()andhandleItemAdd()previously ignored the third argument, making it impossible to pass baseUrl from the theme. As a result, the add-to-cart request was sent to/remote/v1/cart/addinstead of/es/remote/v1/cart/add, and the cart modal displayed untranslated content.Rollout/Rollback
revert the PR
Testing
TRAC_362_fix_testing_on_Integration.mov
add-es-product-to-cart.mov
Note
Low Risk
Low risk: small, backward-compatible signature change that only threads an optional
baseUrlthrough the existing request options for add-to-cart; main risk is inadvertent behavior change if callers relied on the ignored third argument.Overview
Enables locale-aware add-to-cart requests by adding an optional
requestOptionsparameter tocart.itemAdd()andcart.handleItemAdd()and forwardingrequestOptions.baseUrlinto the underlying/cart/addremote request.Updates unit tests to assert
baseUrlis passed through when provided and that calls withoutrequestOptionsremain backward compatible.Reviewed by Cursor Bugbot for commit 52b6ef6. Bugbot is set up for automated code reviews on this repo. Configure here.