Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SFCC-79: Changed in_stock behavior #46

Merged
merged 3 commits into from
Aug 3, 2023

Conversation

ede-somogyi-algolia
Copy link
Contributor

@ede-somogyi-algolia ede-somogyi-algolia commented Aug 2, 2023

The in_stock property now exports a boolean indicating whether the actual number of products in stock (ATS or available to sell) is higher than the Algolia_InStockThreshold custom site preference, as originally intended.

The previous logic was flawed in that it compared the site preference to product.availabilityModel.availability, which returns a number between 0 and 1, and as such doesn't represent the number of products in stock, thus the comparison always returning false.

@ede-somogyi-algolia ede-somogyi-algolia marked this pull request as ready for review August 3, 2023 17:12
@ede-somogyi-algolia ede-somogyi-algolia changed the title Changed in_stock behavior (subject to change) SFCC-79: Changed in_stock behavior Aug 3, 2023
@ede-somogyi-algolia ede-somogyi-algolia merged commit d4df89a into develop Aug 3, 2023
@ede-somogyi-algolia ede-somogyi-algolia deleted the fix/20230719-in-stock-change branch August 3, 2023 17:20
@ede-somogyi-algolia ede-somogyi-algolia mentioned this pull request Aug 7, 2023
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