From 24ba06c37b940b3b726c733bf5828ea283cdc128 Mon Sep 17 00:00:00 2001 From: marination Date: Tue, 8 Jun 2021 14:47:11 +0530 Subject: [PATCH] fix: Mixin import issue, search error handling, shop-by-category slideshow --- erpnext/e_commerce/website_item_indexing.py | 6 ++++-- erpnext/public/scss/shopping_cart.scss | 8 ++++---- erpnext/www/shop-by-category/index.py | 12 ++++++------ 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/erpnext/e_commerce/website_item_indexing.py b/erpnext/e_commerce/website_item_indexing.py index 73ab7408cc..18dac93ad3 100644 --- a/erpnext/e_commerce/website_item_indexing.py +++ b/erpnext/e_commerce/website_item_indexing.py @@ -60,7 +60,8 @@ def create_website_items_index(): idx_fields = frappe.db.get_single_value( 'E Commerce Settings', 'search_index_fields' - ).split(',') + ) + idx_fields = idx_fields.split(',') if idx_fields else [] if 'web_item_name' in idx_fields: idx_fields.remove('web_item_name') @@ -192,7 +193,8 @@ def get_fields_indexed(): fields_to_index = frappe.db.get_single_value( 'E Commerce Settings', 'search_index_fields' - ).split(',') + ) + fields_to_index = fields_to_index.split(',') if fields_to_index else [] mandatory_fields = ['name', 'web_item_name', 'route', 'thumbnail'] fields_to_index = fields_to_index + mandatory_fields diff --git a/erpnext/public/scss/shopping_cart.scss b/erpnext/public/scss/shopping_cart.scss index 7128c02b4e..48eb6dc540 100644 --- a/erpnext/public/scss/shopping_cart.scss +++ b/erpnext/public/scss/shopping_cart.scss @@ -486,7 +486,7 @@ body.product-page { font-weight: 500; display: none; - @include media-breakpoint-between(xs, md) { + @media (max-width: 992px) { display: unset !important; } } @@ -510,14 +510,14 @@ body.product-page { } .column-sm-view { - @include media-breakpoint-between(xs, md) { + @media (max-width: 992px) { display: none !important; } } .item-column { width: 50%; - @include media-breakpoint-between(xs, md) { + @media (max-width: 992px) { width: 70%; } } @@ -539,7 +539,7 @@ body.product-page { .totals { padding-right: 4rem; - @include media-breakpoint-between(xs, md) { + @media (max-width: 992px) { padding-right: 1rem; } } diff --git a/erpnext/www/shop-by-category/index.py b/erpnext/www/shop-by-category/index.py index 865a4c00ce..7dfbd76078 100644 --- a/erpnext/www/shop-by-category/index.py +++ b/erpnext/www/shop-by-category/index.py @@ -26,12 +26,12 @@ def get_slideshow(slideshow): slideshow = frappe.get_cached_doc("Website Slideshow", slideshow) slides = slideshow.get({"doctype": "Website Slideshow Item"}) for index, slide in enumerate(slides, start=1): - values[f"slide_{index + 1}_image"] = slide.image - values[f"slide_{index + 1}_title"] = slide.heading - values[f"slide_{index + 1}_subtitle"] = slide.description - values[f"slide_{index + 1}_theme"] = slide.get("theme") or "Light" - values[f"slide_{index + 1}_content_align"] = slide.get("content_align") or "Centre" - values[f"slide_{index + 1}_primary_action"] = slide.url + values[f"slide_{index}_image"] = slide.image + values[f"slide_{index}_title"] = slide.heading + values[f"slide_{index}_subtitle"] = slide.description + values[f"slide_{index}_theme"] = slide.get("theme") or "Light" + values[f"slide_{index}_content_align"] = slide.get("content_align") or "Centre" + values[f"slide_{index}_primary_action"] = slide.url return values