fix: Hide Attribute filters if 'Hide Variants' is enabled in E Commerce Settings

- Hide Attribute filters if 'Hide Variants' is enabled in E Commerce Settings
- Consider 'Hide Variants' in ProductQuery Engine
- Added docstrings
- Remove `get_e_commerce_settings`, redundant
This commit is contained in:
marination
2021-02-19 15:56:52 +05:30
parent 2a3f5da6af
commit 333d08f459
6 changed files with 70 additions and 68 deletions

View File

@@ -136,15 +136,3 @@ def get_item_attributes(item_code):
return attributes
def get_html_for_items(items):
html = []
for item in items:
html.append(frappe.render_template('erpnext/www/all-products/item_row.html', {
'item': item
}))
return html
def get_e_commerce_settings():
doc = frappe.get_cached_doc('E Commerce Settings')
doc.products_per_page = doc.products_per_page or 20
return doc