Rank: Member
Groups: Authorized User, Developers Joined: 11/12/2018(UTC) Posts: 25
Thanks: 1 times Was thanked: 4 time(s) in 3 post(s)
|
AbleCommerce 9.0.6. I must be missing something simple. I am testing using the demo store. Under Configure > Store > General, I have Enable Inventory Management checked, and Display Inventory set to Yes. The various messages are left at their defaults. For a product, under Inventory Control I have Inventory set to Track Product, and "Allow product to be purchased if out-of-stock" is checked. When I view the product details, no inventory information is shown (see attached image). (If I uncheck "Allow product to be purchased if out-of-stock", the Add to Cart button is hidden and the Out of Stock message is shown). No Inv.PNG (363kb) downloaded 3 time(s).
|
|
|
|
Rank: Member
Groups: Authorized User, Developers Joined: 11/12/2018(UTC) Posts: 25
Thanks: 1 times Was thanked: 4 time(s) in 3 post(s)
|
I think I figured it out. The image in the previous post was when the quantity on hand for the product was zero. My goal is to allow a product to be ordered if it is out of stock, but also show the stock status message(s) if it is out of stock. To accomplish that, I had to make the following changes in Code\BuyProductDialog\PrepareProductDialogDataAttribute.cs. Line 208/209: Change Code:if (store.Settings.EnableInventory && store.Settings.InventoryDisplayDetails
&& (product.InventoryMode != InventoryMode.None) && (!product.AllowBackorder))
to Code:if (store.Settings.EnableInventory && store.Settings.InventoryDisplayDetails
&& (product.InventoryMode != InventoryMode.None))
Line 217: Change Code:if ((inv.InventoryMode == InventoryMode.None) || (inv.AllowBackorder)) return;
to Code:if (inv.InventoryMode == InventoryMode.None) return;
Edited by user Wednesday, September 14, 2022 3:49:30 PM(UTC)
| Reason: additional details
|
|
|
|
Rank: Advanced Member
Groups: System, Administrators, Developers, Registered, HelpDesk Joined: 10/29/2018(UTC) Posts: 472
Thanks: 4 times Was thanked: 34 time(s) in 33 post(s)
|
Thanks for posting your code changes Jay. As you found out, this is how the inventory feature works. The 'Allow product to be purchased if out of stock' option disables the inventory message. |
Thanks for your support!
Katie Secure eCommerce Software and Hosting |
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The AbleCommerce Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close