2019-03-19 11:48:32 +05:30
|
|
|
import frappe
|
2021-02-16 18:45:36 +05:30
|
|
|
from frappe.utils import cint
|
2022-02-01 00:39:14 +05:30
|
|
|
|
2021-08-12 19:01:10 +05:30
|
|
|
from erpnext.e_commerce.product_data_engine.filters import ProductFiltersBuilder
|
2019-03-19 11:48:32 +05:30
|
|
|
|
2019-03-20 14:11:22 +05:30
|
|
|
sitemap = 1
|
|
|
|
|
2022-03-28 18:52:46 +05:30
|
|
|
|
2019-03-19 11:48:32 +05:30
|
|
|
def get_context(context):
|
2021-05-13 01:22:05 +05:30
|
|
|
# Add homepage as parent
|
2021-09-01 14:57:50 +05:30
|
|
|
context.body_class = "product-page"
|
2021-05-13 01:22:05 +05:30
|
|
|
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
|
2022-03-28 18:52:46 +05:30
|
|
|
)
|
2019-03-19 11:48:32 +05:30
|
|
|
|
2021-05-19 23:52:16 +05:30
|
|
|
context.no_cache = 1
|