Skip to content

fix(inventory): BACK-786 Fallback to the default backorder message ID when backorder message ID is null - #2708

Merged
agchan12 merged 1 commit into
masterfrom
BACK-786
Jul 20, 2026
Merged

fix(inventory): BACK-786 Fallback to the default backorder message ID when backorder message ID is null#2708
agchan12 merged 1 commit into
masterfrom
BACK-786

Conversation

@agchan12

@agchan12 agchan12 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

What?

  • Remove null guard from simple/complex and picklist products.
    • backorder_message_ids from products can be null. When they are null it means they are the current default. We still need to display the backorder message when the ID is null.

Requirements

  • CHANGELOG.md entry added (required for code changes only)

Tickets / Documentation

Add links to any relevant tickets and documentation.

Screenshots (if appropriate)

Before

Setup
Product 103 is set to use the default backorder message 1
Backorder message is set to display in the PDP

BACK-786-before.mov

Explanation
On the PDP, the backorder message does not display because of the null guard if the backorder message is null

After

Setup
Product 103 is set to use the default backorder message 1
Backorder message is set to display in the PDP

BACK-786-after.mov

Explanation
On the PDP, the backorder message does display when the backorder message is set null

ping @animesh1987 @bigcommerce/team-trac


Note

Low Risk
Localized PDP/picklist display logic with no auth or checkout impact; behavior change only affects when backorder message text appears.

Overview
PDP backorder copy now resolves through a shared findByBackorderMessageIdOrDefault helper instead of requiring a non-null backorder_message_id.

When a product (or picklist-linked product) has backorder_message_id null—meaning “use the store default”—or points at a deleted message, the theme shows the message marked is_default in backorderMessages. The main PDP backorder text (updateBackorderMessage) and picklist backorder suffixes (lookupBackorderMessage) both use this path; earlier null guards that skipped lookup entirely are removed so default messaging can appear. If the default record exists but its message text is empty, nothing is shown (unchanged empty-state behavior).

Unit coverage was added for PDP and picklist fallback, dangling IDs, and blank defaults.

Reviewed by Cursor Bugbot for commit bdca36a. Bugbot is set up for automated code reviews on this repo. Configure here.

@agchan12
agchan12 marked this pull request as ready for review July 20, 2026 11:43
@agchan12
agchan12 requested a review from a team as a code owner July 20, 2026 11:43
@animesh1987

Copy link
Copy Markdown

cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 57cabaa. Configure here.

Comment thread assets/js/theme/common/picklist-backorder.js Outdated
@agchan12
agchan12 force-pushed the BACK-786 branch 2 times, most recently from 82d7e39 to b62a589 Compare July 20, 2026 11:56
@agchan12
agchan12 force-pushed the BACK-786 branch 3 times, most recently from 8d76c35 to ccda8db Compare July 20, 2026 12:03
@agchan12
agchan12 merged commit bad0ba2 into master Jul 20, 2026
9 checks passed
@agchan12
agchan12 deleted the BACK-786 branch July 20, 2026 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants