Add to Cart Button Not Being Disabled Properly

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
Hi guys,

I have a product with the following values:



According to the little tooltips on the page above, my page should NOT be showing the 'Add to Cart Button', but instead a 'Notify me when available' button. Yet both buttons are displayed on this product's page...

I would like to not show the quantity input, nor the 'Add to Cart' button when the item is out of stock...

Shouldn't these settings prevent the 'Add to Cart' button from displaying? Am I missing something? Thanks in advance!
7 years ago
Hi, I think you can select Disable Buy Button in Low stock activity setting in product edit.
7 years ago
No. It works a bit other way. "Low stock activity" option is used only when some qty is added/reduced (e.g. a new order is placed). if qty is below "minimum stock qty" (after order placement), then button will be disabled.
7 years ago
Thanks for the info guys! I suppose that makes sense (that it works that way). However, we are in a situation where that behavior will not work so well for us. Is there anyway I can alter that behavior and have the button disabled whether or not an order (or other quantity-altering process) brings the stock levels below the 'Minimum Stock Quantity'?

We have many products in our catalog that will be set to '0' at some point due to our POS integration syncing our POS inventory levels with nopCommerce. Thus, it will not always be an order that reduces quantities from our inventory... I really don't want to have to manually disable the 'Add to Cart' button manually IF our integration sets the stock levels to '0', then have to manually enable it after restock the product :(

As usual, any help is greatly appreciated :) Thanks guys!
7 years ago
In this case it'll require some customization. There are two ways to go:

1. Just check "Minimum stock qty" and "Low stock activity" option when you're synchronizing with your POS system. And set "Disable buy button" based on result

or

2. Do the same in the "PrepareProductDetailsPageModel" method of ProductController and "PrepareProductOverviewModels" method of \Extensions\ControllerExtensions.cs. Set "DisableBuyButton" model property based on result of this check ("Minimum stock qty" and "Low stock activity" properties)
7 years ago
Thank you for the detailed instructions Andrei! I appreciate the assistance!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.