Developer forum

Forum » CMS - Standard features » Out of stock - visible but not "addable" to cart

Out of stock - visible but not "addable" to cart

Nuno Aguiar
Reply
Hi,

We have a client qhen we need to still show products if stock is 0, but just not add it to the cart. How can I control this?

We tried blocking the addToCart link based on a custom checkbox field but the order history and forced link allowed it. The Management Center option to not whow a product if added to 0 is not an option also.

Will custom development be the only way out?

Best Regards,
Nuno


Replies

 
Juriaan Pinkse
Reply

Hi Nuno,

You could probably write some custom code which checks the stock level in the shopping cart and removes the products if stock is 0 (or whatever value you set) using the Notification Subscriber "BeforeRenderingNewStep".

Here you can use something like "Order.Orderlines.Remove" if stock level is 0.
 

Hope this helps.

Beste Regards,
Juriaan 
 

 

You must be logged in to post in the forum