Skip to Content
Menu
This question has been flagged
1 Reply
1837 Views

Hi, @all
If a guest wants to put a product for rental in the shopping cart, he gets the following error message:

"The given product does not exist therefore it cannot be added to cart."

When the product is an "Sale Product" works fine.

It is works as designed?
Greetings fro Germany

Avatar
Discard
Best Answer

Hi,

To be able to add a product to cart, three conditions need to be met product is active, can be sold is active and published to website. You can't add a product is not set as can be sold even if it's a rental product. 

Here you are the code of checking product:

def _is_add_to_cart_allowed(self):
self.ensure_one()
return self.user_has_groups('base.group_system') or (self.active and self.sale_ok and self.website_published)
Avatar
Discard
Related Posts Replies Views Activity
3
Nov 24
2943
5
Nov 24
7438
2
Oct 24
2879
4
Oct 24
1859
2
Oct 24
3996