feat: E-commerce Refactor

- Created "Website Item" to handle website related information
- Publishing Item new flow
- Created "E Commerce Settings"
- Removed Products Settings
This commit is contained in:
marination
2021-02-10 19:44:10 +05:30
parent c6a56a8f53
commit 939b0dd67d
27 changed files with 672 additions and 445 deletions

View File

@@ -8,8 +8,8 @@ import frappe
class ProductFiltersBuilder:
def __init__(self, item_group=None):
if not item_group or item_group == "Products Settings":
self.doc = frappe.get_doc("Products Settings")
if not item_group or item_group == "E Commerce Settings":
self.doc = frappe.get_doc("E Commerce Settings")
else:
self.doc = frappe.get_doc("Item Group", item_group)

View File

@@ -15,13 +15,13 @@ class ProductQuery:
filters (TYPE): Description
or_filters (list): Description
page_length (Int): Length of page for the query
settings (Document): Products Settings DocType
settings (Document): E Commerce Settings DocType
filters (list)
or_filters (list)
"""
def __init__(self):
self.settings = frappe.get_doc("Products Settings")
self.settings = frappe.get_doc("E Commerce Settings")
self.cart_settings = frappe.get_doc("Shopping Cart Settings")
self.page_length = self.settings.products_per_page or 20
self.fields = ['name', 'item_name', 'item_code', 'website_image', 'variant_of', 'has_variants',