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:
marination 2021-08-24 13:52:46 +05:30
parent 80fbe16be8
commit 9aeb211142
6 changed files with 12 additions and 39 deletions

View File

@ -5,8 +5,6 @@
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"home_page_is_products",
"column_break_4",
"products_per_page",
"display_settings_section",
"hide_variants",
@ -59,13 +57,6 @@
"is_redisearch_loaded"
],
"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",
"fieldname": "products_per_page",
@ -84,10 +75,6 @@
"fieldtype": "Check",
"label": "Hide Variants"
},
{
"fieldname": "column_break_4",
"fieldtype": "Column Break"
},
{
"default": "0",
"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,
"issingle": 1,
"links": [],
"modified": "2021-07-15 16:50:50.087281",
"modified": "2021-08-24 13:40:15.294696",
"modified_by": "Administrator",
"module": "E-commerce",
"name": "E Commerce Settings",

View File

@ -17,11 +17,6 @@ class ECommerceSettings(Document):
self.is_redisearch_loaded = is_search_module_loaded()
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_attribute_filters()
self.validate_checkout()
@ -163,9 +158,3 @@ def check_shopping_cart_enabled():
def 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"

View File

@ -241,9 +241,6 @@ doc_events = {
("Sales Taxes and Charges Template", "Price List"): {
"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": {
"validate": "erpnext.regional.india.utils.validate_tax_category"
},

View File

@ -8,7 +8,7 @@ def execute():
frappe.reload_doc("portal", "doctype", "website_attribute")
products_settings_fields = [
"hide_variants", "home_page_is_products", "products_per_page",
"hide_variants", "products_per_page",
"enable_attribute_filters", "enable_field_filters"
]

View File

@ -811,7 +811,6 @@ body.product-page {
.cart-btn {
border: none;
background: var(--gray-100);
color: var(--gray-500);
box-shadow: none;
width: 24px;
height: 28px;

View File

@ -254,7 +254,8 @@ class Item(Document):
else:
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.update(changed)