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

Fix backorder check #90

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix backorder check #90

wants to merge 1 commit into from

Conversation

pratner-ch
Copy link

@pratner-ch pratner-ch commented Oct 31, 2022

Description

This addresses the following edge case:

  • Product has "Manage Stock" set to "No"
  • Product has backorders enabled (Magento hides this setting when Manage Stock is off).
  • Product has qty <= 0.

In this configuration, when Affirm is disabled for backordered items, the promotional message is hidden.
However, since stock management is off, the quantity of the product shouldn't matter, and the backorders setting on the product (that is hidden, with the implication of its uselessness) should also be ignored. The implication of this setting is that it's okay to order the product regardless of anything to do with stock status.

How To Reproduce

Steps to reproduce the behavior:

  1. Disable Affirm promos for backordered items.
  2. Go to any product.
  3. Open "Advanced inventory".
  4. Set Manage stock to "Yes", then enable backorders (either of the "Allow" options).
  5. Save the product.
  6. Go back to it and set Manage stock to "No". Watch the backorders setting disappear (while preserving its old value in the DB).
  7. Go to a PDP of the product and observe that the Affirm promo is missing.

Expected behavior

Affirm promo shows up on PDP.

Benefits

Users will not have to stumble through admin finding a hidden setting on the product that is implicitly false, even if the actual value in the database says otherwise.

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.

1 participant