diff --git a/erpnext/e_commerce/api.py b/erpnext/e_commerce/api.py index 4f83f08ae71..4c9f4a79c6a 100644 --- a/erpnext/e_commerce/api.py +++ b/erpnext/e_commerce/api.py @@ -5,8 +5,8 @@ import frappe from frappe.utils import cint -from erpnext.e_commerce.product_query import ProductQuery -from erpnext.e_commerce.filters import ProductFiltersBuilder +from erpnext.e_commerce.product_data_engine.query import ProductQuery +from erpnext.e_commerce.product_data_engine.filters import ProductFiltersBuilder from erpnext.setup.doctype.item_group.item_group import get_child_groups @frappe.whitelist(allow_guest=True) diff --git a/erpnext/e_commerce/doctype/e_commerce_settings/e_commerce_settings.py b/erpnext/e_commerce/doctype/e_commerce_settings/e_commerce_settings.py index ec989a6bbb4..1b5987376f9 100644 --- a/erpnext/e_commerce/doctype/e_commerce_settings/e_commerce_settings.py +++ b/erpnext/e_commerce/doctype/e_commerce_settings/e_commerce_settings.py @@ -7,7 +7,7 @@ from frappe.utils import cint, comma_and from frappe import _, msgprint from frappe.model.document import Document from frappe.utils import unique -from erpnext.e_commerce.website_item_indexing import create_website_items_index, ALLOWED_INDEXABLE_FIELDS_SET, is_search_module_loaded +from erpnext.e_commerce.redisearch import create_website_items_index, ALLOWED_INDEXABLE_FIELDS_SET, is_search_module_loaded class ShoppingCartSetupError(frappe.ValidationError): pass diff --git a/erpnext/e_commerce/doctype/website_item/website_item.py b/erpnext/e_commerce/doctype/website_item/website_item.py index 99c630b6fd8..42161269407 100644 --- a/erpnext/e_commerce/doctype/website_item/website_item.py +++ b/erpnext/e_commerce/doctype/website_item/website_item.py @@ -17,7 +17,7 @@ from erpnext.e_commerce.shopping_cart.cart import _set_price_list from erpnext.utilities.product import get_price # SEARCH -from erpnext.e_commerce.website_item_indexing import ( +from erpnext.e_commerce.redisearch import ( insert_item_to_index, update_index_for_item, delete_item_from_index diff --git a/erpnext/e_commerce/shopping_cart/search.py b/erpnext/e_commerce/legacy_search.py similarity index 99% rename from erpnext/e_commerce/shopping_cart/search.py rename to erpnext/e_commerce/legacy_search.py index 30656befd61..752c33e92ee 100644 --- a/erpnext/e_commerce/shopping_cart/search.py +++ b/erpnext/e_commerce/legacy_search.py @@ -6,6 +6,7 @@ from whoosh.fields import ID, KEYWORD, TEXT, Schema from whoosh.qparser import FieldsPlugin, MultifieldParser, WildcardPlugin from whoosh.query import Prefix +# TODO: Make obsolete INDEX_NAME = "products" class ProductSearch(FullTextSearch): diff --git a/erpnext/e_commerce/product_configurator/test_product_configurator.py b/erpnext/e_commerce/product_configurator/test_product_configurator.py index 960dc979ac3..2f5a24f0b53 100644 --- a/erpnext/e_commerce/product_configurator/test_product_configurator.py +++ b/erpnext/e_commerce/product_configurator/test_product_configurator.py @@ -4,7 +4,7 @@ import frappe from bs4 import BeautifulSoup import frappe, unittest from frappe.utils import get_html_for_route -from erpnext.e_commerce.product_query import ProductQuery +from erpnext.e_commerce.product_data_engine.query import ProductQuery from erpnext.e_commerce.doctype.website_item.website_item import make_website_item test_dependencies = ["Item"] diff --git a/erpnext/e_commerce/filters.py b/erpnext/e_commerce/product_data_engine/filters.py similarity index 99% rename from erpnext/e_commerce/filters.py rename to erpnext/e_commerce/product_data_engine/filters.py index 0d96a118e80..75137a7ea0e 100644 --- a/erpnext/e_commerce/filters.py +++ b/erpnext/e_commerce/product_data_engine/filters.py @@ -1,6 +1,5 @@ # Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt - import frappe from frappe import _dict from frappe.utils import floor diff --git a/erpnext/e_commerce/product_query.py b/erpnext/e_commerce/product_data_engine/query.py similarity index 99% rename from erpnext/e_commerce/product_query.py rename to erpnext/e_commerce/product_data_engine/query.py index 3db87ab8aa1..5c67272b968 100644 --- a/erpnext/e_commerce/product_query.py +++ b/erpnext/e_commerce/product_data_engine/query.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors +# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt import frappe diff --git a/erpnext/e_commerce/product_grid.js b/erpnext/e_commerce/product_ui/grid.js similarity index 100% rename from erpnext/e_commerce/product_grid.js rename to erpnext/e_commerce/product_ui/grid.js diff --git a/erpnext/e_commerce/product_list.js b/erpnext/e_commerce/product_ui/list.js similarity index 100% rename from erpnext/e_commerce/product_list.js rename to erpnext/e_commerce/product_ui/list.js diff --git a/erpnext/e_commerce/product_search.js b/erpnext/e_commerce/product_ui/search.js similarity index 97% rename from erpnext/e_commerce/product_search.js rename to erpnext/e_commerce/product_ui/search.js index ebe007624a0..b93c9759280 100644 --- a/erpnext/e_commerce/product_search.js +++ b/erpnext/e_commerce/product_ui/search.js @@ -49,7 +49,7 @@ erpnext.ProductSearch = class { // Fetch and populate product results frappe.call({ - method: "erpnext.templates.pages.product_search.search", + method: "erpnext.templates.pages.e_commerce.product_search.search", args: { query: query }, @@ -61,7 +61,7 @@ erpnext.ProductSearch = class { // Populate categories if (me.category_container) { frappe.call({ - method: "erpnext.templates.pages.product_search.get_category_suggestions", + method: "erpnext.templates.pages.e_commerce.product_search.get_category_suggestions", args: { query: query }, diff --git a/erpnext/e_commerce/product_view.js b/erpnext/e_commerce/product_ui/views.js similarity index 100% rename from erpnext/e_commerce/product_view.js rename to erpnext/e_commerce/product_ui/views.js diff --git a/erpnext/e_commerce/website_item_indexing.py b/erpnext/e_commerce/redisearch.py similarity index 100% rename from erpnext/e_commerce/website_item_indexing.py rename to erpnext/e_commerce/redisearch.py diff --git a/erpnext/public/build.json b/erpnext/public/build.json index 553082f61c5..569910dd9df 100644 --- a/erpnext/public/build.json +++ b/erpnext/public/build.json @@ -68,9 +68,9 @@ "public/js/hierarchy_chart/hierarchy_chart_mobile.js" ], "js/e-commerce.min.js": [ - "e_commerce/product_view.js", - "e_commerce/product_grid.js", - "e_commerce/product_list.js", - "e_commerce/product_search.js" + "e_commerce/product_ui/views.js", + "e_commerce/product_ui/grid.js", + "e_commerce/product_ui/list.js", + "e_commerce/product_ui/search.js" ] } diff --git a/erpnext/public/scss/shopping_cart.scss b/erpnext/public/scss/shopping_cart.scss index 57ee7cac7f8..4de16ca2f80 100644 --- a/erpnext/public/scss/shopping_cart.scss +++ b/erpnext/public/scss/shopping_cart.scss @@ -844,6 +844,14 @@ body.product-page { } } } + + .t-and-c-container { + padding: 1.5rem; + } + + .t-and-c-terms { + font-size: 14px; + } } .cart-empty.frappe-card { diff --git a/erpnext/setup/doctype/item_group/item_group.py b/erpnext/setup/doctype/item_group/item_group.py index a362c6e1fa6..f4b667ecc51 100644 --- a/erpnext/setup/doctype/item_group/item_group.py +++ b/erpnext/setup/doctype/item_group/item_group.py @@ -10,11 +10,7 @@ from frappe.utils.nestedset import NestedSet from frappe.website.utils import clear_cache from frappe.website.website_generator import WebsiteGenerator from six.moves.urllib.parse import quote - -from erpnext.e_commerce.filters import ProductFiltersBuilder -from erpnext.e_commerce.product_query import ProductQuery -from erpnext.utilities.product import get_qty_in_stock - +from erpnext.e_commerce.product_data_engine.filters import ProductFiltersBuilder class ItemGroup(NestedSet, WebsiteGenerator): nsm_parent_field = 'parent_item_group' diff --git a/erpnext/templates/pages/cart.html b/erpnext/templates/pages/cart.html index 05db77a699e..bb8ba3b24e0 100644 --- a/erpnext/templates/pages/cart.html +++ b/erpnext/templates/pages/cart.html @@ -21,8 +21,9 @@ {% if doc.items %}