-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Current behavior
Using Magento and setting manage_stock false for product leads to situation where product cannot be added to cart. This is because maxQuantity for product is checked from stock.qty and theres no logic for manage_stock attribute.
Expected behavior
If manage_stock is false no qty should be checked when adding product to cart or showing add to cart button
Steps to reproduce the issue
- Set product in Magento with manage stock false
- Go to product page
- Add to cart button is disabled
Repository
https://github.com/DivanteLtd/vue-storefront/blob/master/src/themes/default/pages/Product.vue#L411
Environment details
- Browser: Chrome 79.0.3945.88
- OS: Centos 8
- Node: v10.16.0
- Code Version: v1.11.0
Additional information
As the maxQuantity is also used for showing amount in frontend I did come up with easy fix with adding this logic
this.maxQuantity = res.manage_stock ? res.qty : ' '
This way !this.maxQuantity === false as whitespace in string is counted as truthy value. Maybe not correct solution but add to cart works with this and no weird info shown for customer in stock field just ( available).
Also I think this issue is not that critical as most of the folks are using stock from eCom but in case someone doesn't this is blocker.