Skip to content

Conversation

@sbellone
Copy link
Collaborator

@sbellone sbellone commented Oct 8, 2024

The demo currently require pricebooks, while it's not an attribute that we recommend by default.
Without it, it breaks with the following error:

Uncaught TypeError: data is undefined
    isSale productsPlugin.tsx:92
    ProductItem productsPlugin.tsx:152

This PR changes how the sale price is calculated, to make it work with the default attributes:

  • First it looks in pricebooks
  • Then using the promotionalPrice
  • Then directly using the price if no other attribute is present

SFCC-390

@sbellone sbellone requested a review from htuzel October 8, 2024 08:46
@sbellone sbellone self-assigned this Oct 8, 2024
@sbellone sbellone merged commit 7cb231b into develop Oct 14, 2024
2 checks passed
@sbellone sbellone deleted the fix/dont-break-without-pricebooks branch October 14, 2024 14:54
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