From fd0e8a4e2320ae65dfb058ad9d72cf55f8ec8304 Mon Sep 17 00:00:00 2001 From: prssanna Date: Wed, 10 Feb 2021 16:31:41 +0530 Subject: [PATCH] fix: also fetch item variants if hide variants is disabled --- erpnext/shopping_cart/product_query.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/erpnext/shopping_cart/product_query.py b/erpnext/shopping_cart/product_query.py index 8daf3d7dac..36d446ed0f 100644 --- a/erpnext/shopping_cart/product_query.py +++ b/erpnext/shopping_cart/product_query.py @@ -23,8 +23,10 @@ class ProductQuery: self.cart_settings = frappe.get_doc("Shopping Cart Settings") self.page_length = self.settings.products_per_page or 20 self.fields = ['name', 'item_name', 'item_code', 'website_image', 'variant_of', 'has_variants', 'item_group', 'image', 'web_long_description', 'description', 'route'] - self.filters = [['show_in_website', '=', 1]] - self.or_filters = [] + self.filters = [] + self.or_filters = [['show_in_website', '=', 1]] + if not self.settings.get('hide_variants'): + self.or_filters.append(['show_variant_in_website', '=', 1]) def query(self, attributes=None, fields=None, search_term=None, start=0): """Summary