chore: Remove Home Page is Products
and Sider fixes
- Removed `Home Page is Products` checkbox in E Comm Settings. Can be manually set in Website Settings - Removed hooks trigger to reset home page as products - Sider: duplicate color attribute, shift `return` to next line, over-indentation
This commit is contained in:
parent
80fbe16be8
commit
9aeb211142
@ -5,8 +5,6 @@
|
|||||||
"editable_grid": 1,
|
"editable_grid": 1,
|
||||||
"engine": "InnoDB",
|
"engine": "InnoDB",
|
||||||
"field_order": [
|
"field_order": [
|
||||||
"home_page_is_products",
|
|
||||||
"column_break_4",
|
|
||||||
"products_per_page",
|
"products_per_page",
|
||||||
"display_settings_section",
|
"display_settings_section",
|
||||||
"hide_variants",
|
"hide_variants",
|
||||||
@ -59,13 +57,6 @@
|
|||||||
"is_redisearch_loaded"
|
"is_redisearch_loaded"
|
||||||
],
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
|
||||||
"default": "0",
|
|
||||||
"description": "If checked, the Home page will be the default Item Group for the website",
|
|
||||||
"fieldname": "home_page_is_products",
|
|
||||||
"fieldtype": "Check",
|
|
||||||
"label": "Home Page is Products"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"default": "6",
|
"default": "6",
|
||||||
"fieldname": "products_per_page",
|
"fieldname": "products_per_page",
|
||||||
@ -84,10 +75,6 @@
|
|||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"label": "Hide Variants"
|
"label": "Hide Variants"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"fieldname": "column_break_4",
|
|
||||||
"fieldtype": "Column Break"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"default": "0",
|
"default": "0",
|
||||||
"description": "The field filters will also work as categories in the <b>Shop by Category</b> page.",
|
"description": "The field filters will also work as categories in the <b>Shop by Category</b> page.",
|
||||||
@ -392,7 +379,7 @@
|
|||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2021-07-15 16:50:50.087281",
|
"modified": "2021-08-24 13:40:15.294696",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "E-commerce",
|
"module": "E-commerce",
|
||||||
"name": "E Commerce Settings",
|
"name": "E Commerce Settings",
|
||||||
|
@ -17,11 +17,6 @@ class ECommerceSettings(Document):
|
|||||||
self.is_redisearch_loaded = is_search_module_loaded()
|
self.is_redisearch_loaded = is_search_module_loaded()
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
if self.home_page_is_products:
|
|
||||||
frappe.db.set_value("Website Settings", None, "home_page", "products")
|
|
||||||
elif frappe.db.get_single_value("Website Settings", "home_page") == 'products':
|
|
||||||
frappe.db.set_value("Website Settings", None, "home_page", "home")
|
|
||||||
|
|
||||||
self.validate_field_filters()
|
self.validate_field_filters()
|
||||||
self.validate_attribute_filters()
|
self.validate_attribute_filters()
|
||||||
self.validate_checkout()
|
self.validate_checkout()
|
||||||
@ -163,9 +158,3 @@ def check_shopping_cart_enabled():
|
|||||||
|
|
||||||
def show_attachments():
|
def show_attachments():
|
||||||
return get_shopping_cart_settings().show_attachments
|
return get_shopping_cart_settings().show_attachments
|
||||||
|
|
||||||
def home_page_is_products(doc, method):
|
|
||||||
"""Called on saving Website Settings."""
|
|
||||||
home_page_is_products = cint(frappe.db.get_single_value("E Commerce Settings", "home_page_is_products"))
|
|
||||||
if home_page_is_products:
|
|
||||||
doc.home_page = "products"
|
|
@ -241,9 +241,6 @@ doc_events = {
|
|||||||
("Sales Taxes and Charges Template", "Price List"): {
|
("Sales Taxes and Charges Template", "Price List"): {
|
||||||
"on_update": "erpnext.e_commerce.doctype.e_commerce_settings.e_commerce_settings.validate_cart_settings"
|
"on_update": "erpnext.e_commerce.doctype.e_commerce_settings.e_commerce_settings.validate_cart_settings"
|
||||||
},
|
},
|
||||||
"Website Settings": {
|
|
||||||
"validate": "erpnext.e_commerce.doctype.e_commerce_settings.e_commerce_settings.home_page_is_products"
|
|
||||||
},
|
|
||||||
"Tax Category": {
|
"Tax Category": {
|
||||||
"validate": "erpnext.regional.india.utils.validate_tax_category"
|
"validate": "erpnext.regional.india.utils.validate_tax_category"
|
||||||
},
|
},
|
||||||
|
@ -8,7 +8,7 @@ def execute():
|
|||||||
frappe.reload_doc("portal", "doctype", "website_attribute")
|
frappe.reload_doc("portal", "doctype", "website_attribute")
|
||||||
|
|
||||||
products_settings_fields = [
|
products_settings_fields = [
|
||||||
"hide_variants", "home_page_is_products", "products_per_page",
|
"hide_variants", "products_per_page",
|
||||||
"enable_attribute_filters", "enable_field_filters"
|
"enable_attribute_filters", "enable_field_filters"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -811,7 +811,6 @@ body.product-page {
|
|||||||
.cart-btn {
|
.cart-btn {
|
||||||
border: none;
|
border: none;
|
||||||
background: var(--gray-100);
|
background: var(--gray-100);
|
||||||
color: var(--gray-500);
|
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
width: 24px;
|
width: 24px;
|
||||||
height: 28px;
|
height: 28px;
|
||||||
|
@ -254,7 +254,8 @@ class Item(Document):
|
|||||||
else:
|
else:
|
||||||
changed[field] = self.get(field)
|
changed[field] = self.get(field)
|
||||||
|
|
||||||
if not changed: return
|
if not changed:
|
||||||
|
return
|
||||||
|
|
||||||
web_item_doc = frappe.get_doc("Website Item", web_item)
|
web_item_doc = frappe.get_doc("Website Item", web_item)
|
||||||
web_item_doc.update(changed)
|
web_item_doc.update(changed)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user