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

[Bug]: canAddToCart not working correctly #1416

Open
1 task done
bensinca opened this issue Feb 6, 2023 · 0 comments
Open
1 task done

[Bug]: canAddToCart not working correctly #1416

bensinca opened this issue Feb 6, 2023 · 0 comments
Labels
bug Something isn't working triage-needed Issues that need to be checked

Comments

@bensinca
Copy link
Contributor

bensinca commented Feb 6, 2023

Expected Behavior

File in reference

It should check if product?.stock_status is 'IN_STOCK' or 'OUT_OF_STOCK'

Actual Behavior

The const inStock = product?.stock_status || ''; will return true regardless.

Possible Solution

Instead: const inStock = product.stock_status === 'IN_STOCK' ? true : false;

Steps to reproduce

Set a product out of stock.
Navigate to it.

What version of Magento 2 integration are you using?

1.1.0

What version of Node.js are you using?

16.18

What browser (and version) are you using?

Chrome. Safari

What operating system (and version) are you using?

macOS

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@bensinca bensinca added bug Something isn't working triage-needed Issues that need to be checked labels Feb 6, 2023
bensinca added a commit to bensinca/magento2 that referenced this issue Feb 6, 2023
Check if `stock_status` is 'IN_STOCK' or 'OUT_OF_STOCK'. 

vuestorefront#1416
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage-needed Issues that need to be checked
Projects
None yet
Development

No branches or pull requests

1 participant