brotherton-erpnext/erpnext/www/all-products/index.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
597 B
Python
Raw Normal View History

import frappe
from frappe.utils import cint
from erpnext.e_commerce.product_data_engine.filters import ProductFiltersBuilder
2019-03-20 08:41:22 +00:00
sitemap = 1
2022-03-28 13:22:46 +00:00
def get_context(context):
# Add homepage as parent
context.body_class = "product-page"
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 13:22:46 +00:00
)
context.no_cache = 1