Highlights
Throw error on invalid promotions
Warning
Breaking change
This release updates the promotion application logic to throw when applying an invalid promotion code. This change improves the experience for developers building storefronts by allowing them to handle invalid discount codes directly from the API response, rather than checking cart promotions after the API request.
The backend will respond with a 400 and a message like so:
The promotion code HELLOWORLD is invalid
Add support for logical operators on Index
This release introduces support for logical operators on Index queries, such as:
const { data: products } = await query.index({
entity: "product",
filters: {
$and: [
{ status: "published" },
{
$or: [
{ brand: { name: { $ilike: "%adidas%" } } }
]
}
]
}
})
In addition to this, this release also fixes a regression related to indexing custom module entities.
Resolve issue with promotion calculations in a tax-inclusive context
This release resolves an issue with the calculation of adjustments in a tax-inclusive calculation context.
When calculating the applicableTotal
(the maximum amount a promotion can apply to an item), it was incorrectly based on the line item’s subtotal (excluding tax), while the promotion value was based on the total (including tax), causing incorrect adjustment calculations.
Bugs
- fix(core-flows): guest customer updates email to another guest account by @fPolic in #13037
- fix(create-medusa-app): Don't allow dot in project name by @olivermrbl in #13042
- fix(promotion): check currency when computing actions for promotions by @riqwan in #13084
- fix(core-flows): refresh payment collection by @carlos-r-l-rodrigues in #13103
- chore(ui): sync Figma resources by @fPolic in #13088
- fix(pricing): Calculate prices with multiple rule values by @olivermrbl in #13079
- fix(dashboard): variants disappearing when removing an option on product creation by @willbouch in #13150
- fix(workflow-engine-inmemory): fix cron job schedule by @carlos-r-l-rodrigues in #13151
- fix(index): logical operators by @carlos-r-l-rodrigues in #13137
- fix(dashboard,promotion): Fix regression on applying percentage promotions by @riqwan in #13161
- fix: Allow getting the token from the SDK client by @sradevski in #13164
- fix(types): remove order_id in apis that do not handle it by @willbouch in #13185
- fix(tax): Use correct rule reference for shipping by @olivermrbl in #13195
Documentation
- docs: update order promotion link details by @shahednasser in #13023
- docs: fix vale lint errors by @shahednasser in #13024
- chore(docs): Updated UI Reference (automated) by @github-actions[bot] in #13026
- docs: fix to OAS generator following Zod update + generate API reference by @shahednasser in #13030
- docs: fix bug in layout change when using some chrome extensions by @shahednasser in #13031
- docs: document UI route breadcrumbs by @shahednasser in #13035
- docs: fix passing linkable for inverse read-only links by @shahednasser in #13041
- docs: add section on customer account deletion by @shahednasser in #13048
- docs: add how-to guides for retrieving cart and order totals by @shahednasser in #13044
- docs: improvements and additions to admin customization chapters by @shahednasser in #13049
- docs: document checks examples + migrations naming convention by @shahednasser in #13052
- docs: document auto-generated types by @shahednasser in #13050
- docs: added examples to DatePicker component by @shahednasser in #13054
- docs: general updates to documentation pages by @shahednasser in #13055
- docs: migration guide from v1 to v2 by @shahednasser in #12597
- docs: open AI assistant based on search query by @shahednasser in #13063
- docs: handle recaptcha loading before submitting AI assistant queries by @shahednasser in #13065
- Fix spelling error in documentation by @benwrk in #13061
- docs: document debugging workflows by @shahednasser in #13087
- docs: improved workflows integration tests guide by @shahednasser in #13090
- docs: document JSON properties by @shahednasser in #13099
- docs: add link to manage metadata section in OAS and API reference by @shahednasser in #13102
- docs: improve instructions to install Medusa UI in standalone projects by @shahednasser in #13104
- docs: add links to technical guides in user guides by @shahednasser in #13108
- docs: update list of resources in module containers + conventions on loaders by @shahednasser in #13107
- docs: add more totals to retrieve cart and totals guides by @shahednasser in #13110
- docs: updates to nested workflow docs by @shahednasser in #13117
- docs: fix search not opening sometimes by @shahednasser in #13118
- docs: fix code block titles not showing in UI docs by @shahednasser in #13119
- docs: added guide on sending invite user emails + updates to reset password guide by @shahednasser in #13122
- docs: add buffer example in workflows + tip for type error in admin global variables by @shahednasser in #13124
- docs: document the fetchStream method of the JS SDK by @shahednasser in #13125
- docs: change from detecting version to since tag by @shahednasser in #13127
- docs: general updates to documentation pages by @shahednasser in #13128
- feat: Add MCP instructions for Claude Code by @aldo-roman in #13134
- docs: generate invoice tutorial by @shahednasser in #13077
- Update page.mdx by @concaveinc in #13180
- docs: integrate reo.dev by @shahednasser in #13192
Chores
- chore(docs): Update version in documentation (automated) by @github-actions[bot] in #13025
- chore(docs): Generated References (automated) by @github-actions[bot] in #13027
- chore: fix example in createProductsWorkflow TSDocs by @shahednasser in #13112
- chore: add links to package.json by @shahednasser in #13100
- chore: use since instead of version tag in TSDocs by @shahednasser in #13126
- chore(dashboard): add missing US states by @fPolic in #13094
- chore: add willbouch to teams.yml by @willbouch in #13141
- chore(core-flows): throw error on invalid promo code by @willbouch in #13140
- chore(util): avoid promotion value precision limit by @carlos-r-l-rodrigues in #13145
- chore(core-flows): import zod by @carlos-r-l-rodrigues in #13197
Other Changes
- fix(dashboard): correct overflow in a few settings edit forms by @SteelRazor47 in #11982
- fix: createCustomerGroupsStep rollback, delete created customer groups… by @jbrigbyjs in #13056
- This fixes the discount_ calculation logic and promotion tax inclusiveness calculation by @scherddel in #12960
- feat: added pacific franc currency by @tehaulp in #13086
- fix(types,utils,promotion): Move from total to original_total to resolve edge case for adjustments calculation by @scherddel in #13106
- fix(utils):Fix on precision for high quantities for items when promotion is applied by @scherddel in #13131
- Made in operator work as In insted of equal logic by @mikkel-lindstrom in #13078
New Contributors
- @jbrigbyjs made their first contribution in #13056
- @benwrk made their first contribution in #13061
- @tehaulp made their first contribution in #13086
- @willbouch made their first contribution in #13141
- @mikkel-lindstrom made their first contribution in #13078
- @concaveinc made their first contribution in #13180
Full Changelog: v2.8.8...v2.9.0