Merge pull request #19870 from nextchamp-saqib/website-hotfix

fix: website showing disabled items in product list
This commit is contained in:
rohitwaghchaure
2019-12-16 15:25:07 +05:30
committed by GitHub

View File

@@ -302,6 +302,8 @@ def get_items(filters=None, search=None):
if isinstance(filters, dict):
filters = [['Item', fieldname, '=', value] for fieldname, value in filters.items()]
enabled_items_filter = get_conditions({ 'disabled': 0 }, 'and')
show_in_website_condition = ''
if products_settings.hide_variants:
show_in_website_condition = get_conditions({'show_in_website': 1 }, 'and')
@@ -337,7 +339,8 @@ def get_items(filters=None, search=None):
filter_condition = get_conditions(filters, 'and')
where_conditions = ' and '.join(
[condition for condition in [show_in_website_condition, search_condition, filter_condition] if condition]
[condition for condition in [enabled_items_filter, show_in_website_condition, \
search_condition, filter_condition] if condition]
)
left_joins = []