Add to Wishlist - adding product with no stock

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
Hace 13 años
I need to know if there is a way to add an item to the wishlist that is out of stock. I have set it up so that if a user clicks on a product that is out of stock it will tell them it is out of stock and ask them if they want to add it to their wishlist... then when I get it back in stock I can look through the wishlists and email those customers and tell them it is back in stock.

Right now the wishlist works exacltly like the cart, and I like the cart - I don't want to be able to add out of stock items to the cart - but I DO want to be able to add them to the wishlist.

Thanks!
Hace 13 años
I know that there is a setting in the administration section to make it so you can add products to the cart if it is out of stock, but you can't do that for the wishlist alone (as far as I know).

So, I edited the ShoppingCartManager.cs file in Nop.BusinessLogic/Orders like so...

Around line 684 is -


if (!productVariant.AllowOutOfStockOrders)
{
     If (productVariant.StockQuantity < quantity)
     {
          ... //do stuff
     }
}


I wrapped the second if statement here in another if statement -


if (shoppingCartType == ShoppingCartTypeEnum.ShoppingCart)
{
     ... //stock quantity error if statement
}


This now allows me to add out of stock items to the wishlist while not allowing them to be added to the cart.

I didn't think it would be so easy before I posted this question.

Just in case anyone else wanted to do the same thing...

Does anyone know of any negative reprocussions that could happen with this change?

Thanks
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.