2019-03-19 11:48:32 +05:30
|
|
|
import frappe
|
2021-02-16 18:45:36 +05:30
|
|
|
from frappe.utils import cint
|
2021-02-25 13:56:38 +05:30
|
|
|
from erpnext.e_commerce.filters import ProductFiltersBuilder
|
2019-03-19 11:48:32 +05:30
|
|
|
|
2019-03-20 14:11:22 +05:30
|
|
|
sitemap = 1
|
|
|
|
|
2019-03-19 11:48:32 +05:30
|
|
|
def get_context(context):
|
2021-05-13 01:22:05 +05:30
|
|
|
# Add homepage as parent
|
|
|
|
context.parents = [{"name": frappe._("Home"), "route":"/"}]
|
|
|
|
|
|
|
|
filter_engine = ProductFiltersBuilder()
|
|
|
|
context.field_filters = filter_engine.get_field_filters()
|
|
|
|
context.attribute_filters = filter_engine.get_attribute_filters()
|
|
|
|
|
|
|
|
context.page_length = cint(frappe.db.get_single_value('E Commerce Settings', 'products_per_page'))or 20
|
2019-03-19 11:48:32 +05:30
|
|
|
|
2021-05-19 23:52:16 +05:30
|
|
|
context.no_cache = 1
|