Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
939b0dd
feat: E-commerce Refactor
marination Feb 10, 2021
eef9cf1
chore: Drive E-commerce via Website Item
marination Feb 16, 2021
025574d
chore: Removing Item's Website section & references
marination Feb 19, 2021
b38339c
fix: Sider and indexing (minor)
marination Feb 19, 2021
f1ce418
fix: Hide Attribute filters if 'Hide Variants' is enabled in E Commer…
marination Feb 19, 2021
37a246e
chore: Patches for Website Item
marination Feb 23, 2021
22f41a1
chore: Removed Shopping Cart Module
marination Feb 25, 2021
d7130e3
feat: Shop by Category
marination Mar 2, 2021
16b9c8c
feat: Card Actions and Wishlist
marination Mar 11, 2021
4f64d1c
feat: Animate Add to Cart List interactions (UX)
marination Mar 11, 2021
96cc506
feat: Wishlist from card actions
marination Mar 14, 2021
5951440
feat: Wishlist Page
marination Mar 15, 2021
cd11714
fix: Sider
marination Mar 16, 2021
25ffafa
feat: Product Details Tabbed Section and Add to Wishlist in Item Full…
marination Mar 22, 2021
07d7cf0
fix: Remove unnecessary css variable and hover state
marination Mar 22, 2021
b15ff57
feat: (wip) Ratings and Reviews
marination Mar 25, 2021
c842305
feat: Customer Ratings & Reviews Full Page
marination Apr 7, 2021
3d5f029
fix: Sider and Tests
marination Apr 8, 2021
6026185
feat: Slashed Prices and Discount display
marination Apr 12, 2021
817f695
fix: Item schema modified date update
marination Apr 13, 2021
1d94914
feat: Discount Filters
marination Apr 20, 2021
71f4b98
chore: Sider and Semgrep
marination Apr 21, 2021
0c47f3a
feat: Add basic autocomplete using redisearch
NagariaHussain Apr 21, 2021
e82833f
feat: Basic Query + Autocomplete
NagariaHussain Apr 22, 2021
3160187
feat: Add search fields field
NagariaHussain Apr 23, 2021
8e55c95
feat: Make search index fields configurable
NagariaHussain Apr 26, 2021
f342155
feat: Add Category autocomplete with config in settings
NagariaHussain Apr 26, 2021
ba25460
chore: Make it a little beautiful
NagariaHussain Apr 29, 2021
ffc8616
refactor: Use global redis connection
NagariaHussain Apr 29, 2021
70b164e
chore: Add query clean-up
NagariaHussain May 3, 2021
55d2bf0
chore: Add placeholder image
NagariaHussain May 4, 2021
9ee13ba
feat: Add brand line display setting
NagariaHussain May 5, 2021
34f3a66
feat: Show brand line in search results
NagariaHussain May 5, 2021
4309239
feat: Show Recent Searches
NagariaHussain May 5, 2021
c69de2d
chores: Add function params and remove unused imports
NagariaHussain May 11, 2021
0a70374
feat: Offer Display
marination May 8, 2021
8f0b9c9
fix: Show Offers section only if offers exist
marination May 10, 2021
fd6f3c6
Merge branch 'develop' of https://github.com/frappe/erpnext into e-co…
marination Oct 12, 2021
f9929ed
Merge branch 'develop' of https://github.com/frappe/erpnext into e-co…
marination Nov 16, 2021
48b3ce8
feat: (wip) Toggle Views
marination May 12, 2021
897c08c
feat: Product View toggling
marination May 17, 2021
8c20f66
fix: Sider and Patches
marination May 17, 2021
d29b94f
fix: Patch fix for fresh installs
marination May 18, 2021
423d751
fix: Empty states and miscellanous fixes
marination May 19, 2021
499fb56
fix: Move get_product_filtrs_data to website item file
marination May 19, 2021
03b88bd
fix: Items Query, Sub categories, Review Button
marination May 19, 2021
b29c5d6
fix: Discount Filters and Web templates
marination May 24, 2021
bd0d0ad
feat: Add decorator for redisearch
NagariaHussain May 26, 2021
2514215
chore: Redisearch module load tracking
NagariaHussain May 26, 2021
53bb7a9
chore: Shopping Cart styles and cleanup shallow
marination May 27, 2021
41a5ebc
feat: Add fallback when redisearch not loaded
NagariaHussain May 28, 2021
8b725cc
chore: Redisearch warning in search settings
NagariaHussain May 28, 2021
dcc79f1
fix: Documentation link and open in new tab
NagariaHussain May 28, 2021
b0d7e32
feat: Search UI
marination Jun 1, 2021
ea30ce4
fix: Sider and Patch tests
marination Jun 2, 2021
0c73f68
fix: Search UI open/close and Empty product search results
marination Jun 2, 2021
24ba06c
fix: Mixin import issue, search error handling, shop-by-category slid…
marination Jun 8, 2021
aca3c8f
fix: Font size, empty image styles, and minor cleanup
marination Jun 8, 2021
24c8967
fix: Checkbox sizes and paging buttons
marination Jun 8, 2021
cb52c98
fix: Missing Image in Item Page and Variants in Cart
marination Jun 8, 2021
0dadf53
chore: Cleanup Query Engine and Product query API
marination Jun 29, 2021
b450f1c
fix: Filters state, Search input clearing, Paging buttons
marination Jul 7, 2021
82f8f3c
feat: Guest Display Settings
marination Jul 8, 2021
16abfd4
fix: Sync Website Items on Item Change, Short Website Description
marination Jul 8, 2021
d897062
fix: Rename Wishlist Item, Use Website Item Name in Wishlist Cards
marination Jul 8, 2021
c0811c4
fix: Discount Filtes & Filter behaviour
marination Jul 8, 2021
b5e7f04
chore: UI refresh for grid/list view and search
marination Jul 11, 2021
2fec068
feat: Recommended Items and Item full page refresh
marination Jul 13, 2021
ef4579e
chore: Wishlist UI (minor)
marination Jul 13, 2021
929a24e
feat: Cart minor UI/UX Refresh
marination Jul 15, 2021
6432219
fix: Remove Website Item from Item Dashboard
marination Jul 16, 2021
3fd929c
test: Website Item basic test & removed product configurator tests
marination Jul 19, 2021
4d254a7
test: Website Item (Item full page)
marination Aug 9, 2021
b4529b8
test: Recommendations, Reviews and Wishlist
marination Aug 9, 2021
78ee51c
chore: debug travis
marination Aug 10, 2021
335a237
chore: Re-organise files,remove T&C modal in cart
marination Aug 12, 2021
7d1df9d
fix: Error state and passing args for product listing
marination Aug 13, 2021
80fbe16
test: Product Query & Filter Engine, Item Group Page
marination Aug 16, 2021
9aeb211
chore: Remove `Home Page is Products` and Sider fixes
marination Aug 24, 2021
6b2b9dc
refactor: Cache Item Reviews and other review feedback
marination Aug 25, 2021
1bb135b
fix: Sider and CI
marination Aug 26, 2021
45f64bd
Chore: Miscellaneous UI review changes
marination Sep 1, 2021
bbcbcf7
feat: (minor) Backorder indicator and fixed inconsistencies
marination Sep 2, 2021
e2b9a38
fix: Failing search util import and patch
marination Sep 2, 2021
78b791c
test: Set Price list and company in data engine test setup
marination Sep 3, 2021
942dedd
fix: Paging and Discount filter
marination Sep 3, 2021
685c453
test: Product Discounts
marination Sep 3, 2021
cbfdbd8
fix: Website item patch fixes
deepeshgarg007 Sep 9, 2021
4096b14
fix: Shopping Cart and Variant Selection (Hotfix PR #27508)
marination Sep 15, 2021
d637f79
fix: Handle `is_search_module_loaded` for redis version < 4.0.0 (#27574)
marination Sep 18, 2021
ba52d7c
fix: Website Items with same Item name unhandled, thumbnails missing
marination Sep 30, 2021
296f2f6
fix: Pre-commit formatting
marination Sep 30, 2021
8d389fd
fix: Item Variant selection empty popup on website
marination Oct 12, 2021
d7d70ec
fix: Fetch thumbnail from Item master instead of regenerating
marination Oct 19, 2021
e7819f7
fix: re-run patch
marination Oct 19, 2021
a97ee91
fix: Get db values as dict when checking for thumbnail in existing we…
marination Oct 19, 2021
871e9ca
fix: Check if thumbnail column exists in case of table trimming
marination Oct 19, 2021
dc42c45
fix: Move thumbnail updation to different patch
marination Oct 20, 2021
f5594c8
fix: SO Portal fixes
marination Oct 21, 2021
3a32596
style: Fixed indentation for visible heirarchy
marination Oct 27, 2021
0afcdec
Merge branch 'develop' into e-commerce-refactor-develop
marination Nov 16, 2021
b5abf68
Merge branch 'develop' into e-commerce-refactor-develop
marination Jan 11, 2022
6cd7c47
Merge branch 'develop' into e-commerce-refactor-develop
ankush Jan 31, 2022
bba31a3
fix: missing validate_item_group_defaults function
ankush Jan 31, 2022
b2b827f
chore: Adjust to ESbuild and missing imports
marination Jan 31, 2022
9fb61ef
chore: Fix imports and formatting (linter) & Sider (unused import)
marination Jan 31, 2022
19e5dfb
Merge branch 'develop' into e-commerce-refactor-develop
marination Jan 31, 2022
7bc087e
fix: Merge conflicts, Linter and Server Test
marination Feb 1, 2022
f63f250
feat: Allow addition of custom search box
marination Nov 29, 2021
6583a83
fix: Sider (missing semicolon)
marination Nov 29, 2021
02d9207
fix: search_box_id instead of search_box_class
marination Nov 29, 2021
d4c74b5
fix: no module named 'redisearch' (#28818)
rtdany10 Dec 10, 2021
282fbf4
fix: fetch correct selling price.
dj12djdjs Dec 18, 2021
18e70e8
test: e-commerce customer pricing rule
dj12djdjs Dec 22, 2021
262fcbd
fix(test): e-commerce fetch logged-in user item price.
dj12djdjs Dec 23, 2021
456f277
fix: Convert Item links to Website Item links in Item Card Group temp…
marination Dec 21, 2021
31a2485
fix: Sider
marination Dec 22, 2021
091a07c
fix: Code cleanup
marination Dec 22, 2021
45fadb5
fix: Faulty 'continue' not setting value in db
marination Dec 22, 2021
49cdf9b
fix(e-commerce): shopping cart total quantity (#29076)
dj12djdjs Dec 31, 2021
28e0c1a
fix(ux): tripple digit cart qty
dj12djdjs Dec 30, 2021
20c71ed
fix: Exclude unpublished items while fetching items from other item g…
marination Jan 10, 2022
6c7b302
fix: Behaviour if Item Variants Cache generation
marination Jan 10, 2022
5a462db
test: Variant Selector - Attribute Value fetching
marination Jan 11, 2022
2623046
test: Variant Selector - Fetch next valid Attribute values fetching a…
marination Jan 11, 2022
f2fbe90
fix: Server Side test - teardown correctly
marination Jan 11, 2022
47c8ad0
fix: Cart Logic of Item variant without Website Item
marination Jan 20, 2022
4f7ec25
tests: Variant without web item price fetch and add to cart
marination Jan 21, 2022
606f23b
fix: Sider and Linter
marination Jan 21, 2022
143ff71
fix: (test) set user for price test
marination Jan 21, 2022
00752ca
fix: Wrong variable name breaks Cart Items rendering
marination Jan 21, 2022
1d7f313
debug: CI
marination Jan 21, 2022
2933cf2
fix: Failing test, sider and linter
marination Feb 1, 2022
9eeddc2
fix: Merge conflict inconsistency due to https://github.com/frappe/er…
marination Feb 1, 2022
8c90c50
fix: (minor) build issues on cart and item page
marination Feb 2, 2022
780e29b
Merge branch 'develop' into e-commerce-refactor-develop
marination Feb 2, 2022
4b62d2d
fix: (Linter) Write queries using QB/ORM and other minor lines for se…
marination Feb 2, 2022
384e6b5
Merge branch 'develop' into e-commerce-refactor-develop
marination Feb 2, 2022
f47db26
fix: Cart buttons not working
marination Feb 3, 2022
f97642e
fix: Qb query, use `isin` instead of in and access fields without dot…
marination Feb 3, 2022
bd3b47f
fix: remove stale doctypes and add msg for ecommerce refactor (#27700)
ankush Sep 30, 2021
7eb9dc0
fix: Ignore mandatory fields if exist (#27871)
gavindsouza Oct 8, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions erpnext/accounts/doctype/coupon_code/test_coupon_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ def test_create_test_data():
"selling_cost_center": "Main - _TC",
"income_account": "Sales - _TC"
}],
"show_in_website": 1,
"route":"-test-tesla-car",
"website_warehouse": "Stores - _TC"
})
item.insert()
# create test item price
Expand Down
6 changes: 3 additions & 3 deletions erpnext/accounts/doctype/payment_request/payment_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def on_payment_authorized(self, status=None):
if not status:
return

shopping_cart_settings = frappe.get_doc("Shopping Cart Settings")
shopping_cart_settings = frappe.get_doc("E Commerce Settings")

if status in ["Authorized", "Completed"]:
redirect_to = None
Expand Down Expand Up @@ -435,13 +435,13 @@ def get_existing_payment_request_amount(ref_dt, ref_dn):
""", (ref_dt, ref_dn))
return flt(existing_payment_request_amount[0][0]) if existing_payment_request_amount else 0

def get_gateway_details(args):
def get_gateway_details(args): # nosemgrep
"""return gateway and payment account of default payment gateway"""
if args.get("payment_gateway_account"):
return get_payment_gateway_account(args.get("payment_gateway_account"))

if args.order_type == "Shopping Cart":
payment_gateway_account = frappe.get_doc("Shopping Cart Settings").payment_gateway_account
payment_gateway_account = frappe.get_doc("E Commerce Settings").payment_gateway_account
return get_payment_gateway_account(payment_gateway_account)

gateway_account = get_payment_gateway_account({"is_default": 1})
Expand Down
2 changes: 1 addition & 1 deletion erpnext/accounts/doctype/tax_rule/tax_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def validate_filters(self):
def validate_use_for_shopping_cart(self):
'''If shopping cart is enabled and no tax rule exists for shopping cart, enable this one'''
if (not self.use_for_shopping_cart
and cint(frappe.db.get_single_value('Shopping Cart Settings', 'enabled'))
and cint(frappe.db.get_single_value('E Commerce Settings', 'enabled'))
and not frappe.db.get_value('Tax Rule', {'use_for_shopping_cart': 1, 'name': ['!=', self.name]})):

self.use_for_shopping_cart = 1
Expand Down
22 changes: 0 additions & 22 deletions erpnext/buying/doctype/supplier/supplier.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,28 +131,6 @@ def after_rename(self, olddn, newdn, merge=False):
if frappe.defaults.get_global_default('supp_master_name') == 'Supplier Name':
frappe.db.set(self, "supplier_name", newdn)

def create_onboarding_docs(self, args):
company = frappe.defaults.get_defaults().get('company') or \
frappe.db.get_single_value('Global Defaults', 'default_company')

for i in range(1, args.get('max_count')):
supplier = args.get('supplier_name_' + str(i))
if supplier:
try:
doc = frappe.get_doc({
'doctype': self.doctype,
'supplier_name': supplier,
'supplier_group': _('Local'),
'company': company
}).insert()

if args.get('supplier_email_' + str(i)):
from erpnext.selling.doctype.customer.customer import create_contact
create_contact(supplier, 'Supplier',
doc.name, args.get('supplier_email_' + str(i)))
except frappe.NameError:
pass

@frappe.whitelist()
@frappe.validate_and_sanitize_search_inputs
def get_supplier_primary_contact(doctype, txt, searchfield, start, page_len, filters):
Expand Down

This file was deleted.

7 changes: 3 additions & 4 deletions erpnext/controllers/item_variant.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def find_variant(template, args, variant_item_code=None):

conditions = " or ".join(conditions)

from erpnext.portal.product_configurator.utils import get_item_codes_by_attributes
from erpnext.e_commerce.variant_selector.utils import get_item_codes_by_attributes
possible_variants = [i for i in get_item_codes_by_attributes(args, template) if i != variant_item_code]

for variant in possible_variants:
Expand Down Expand Up @@ -262,9 +262,8 @@ def generate_keyed_value_combinations(args):
def copy_attributes_to_variant(item, variant):
# copy non no-copy fields

exclude_fields = ["naming_series", "item_code", "item_name", "show_in_website",
"show_variant_in_website", "opening_stock", "variant_of", "valuation_rate",
"has_variants", "attributes"]
exclude_fields = ["naming_series", "item_code", "item_name", "published_in_website",
"opening_stock", "variant_of", "valuation_rate"]

if item.variant_based_on=='Manufacturer':
# don't copy manufacturer values if based on part no
Expand Down
86 changes: 86 additions & 0 deletions erpnext/e_commerce/api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt

import json

import frappe
from frappe.utils import cint

from erpnext.e_commerce.product_data_engine.filters import ProductFiltersBuilder
from erpnext.e_commerce.product_data_engine.query import ProductQuery
from erpnext.setup.doctype.item_group.item_group import get_child_groups_for_website


@frappe.whitelist(allow_guest=True)
def get_product_filter_data(query_args=None):
"""
Returns filtered products and discount filters.
:param query_args (dict): contains filters to get products list

Query Args filters:
search (str): Search Term.
field_filters (dict): Keys include item_group, brand, etc.
attribute_filters(dict): Keys include Color, Size, etc.
start (int): Offset items by
item_group (str): Valid Item Group
from_filters (bool): Set as True to jump to page 1
"""
if isinstance(query_args, str):
query_args = json.loads(query_args)

query_args = frappe._dict(query_args)
if query_args:
search = query_args.get("search")
field_filters = query_args.get("field_filters", {})
attribute_filters = query_args.get("attribute_filters", {})
start = cint(query_args.start) if query_args.get("start") else 0
item_group = query_args.get("item_group")
from_filters = query_args.get("from_filters")
else:
search, attribute_filters, item_group, from_filters = None, None, None, None
field_filters = {}
start = 0

# if new filter is checked, reset start to show filtered items from page 1
if from_filters:
start = 0

sub_categories = []
if item_group:
field_filters['item_group'] = item_group
sub_categories = get_child_groups_for_website(item_group, immediate=True)

engine = ProductQuery()
try:
result = engine.query(
attribute_filters,
field_filters,
search_term=search,
start=start,
item_group=item_group
)
except Exception:
traceback = frappe.get_traceback()
frappe.log_error(traceback, frappe._("Product Engine Error"))
return {"exc": "Something went wrong!"}

# discount filter data
filters = {}
discounts = result["discounts"]

if discounts:
filter_engine = ProductFiltersBuilder()
filters["discount_filters"] = filter_engine.get_discount_filters(discounts)

return {
"items": result["items"] or [],
"filters": filters,
"settings": engine.settings,
"sub_categories": sub_categories,
"items_count": result["items_count"]
}

@frappe.whitelist(allow_guest=True)
def get_guest_redirect_on_action():
return frappe.db.get_single_value("E Commerce Settings", "redirect_on_action")
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
// Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt

frappe.ui.form.on("Shopping Cart Settings", {
frappe.ui.form.on("E Commerce Settings", {
onload: function(frm) {
if(frm.doc.__onload && frm.doc.__onload.quotation_series) {
frm.fields_dict.quotation_series.df.options = frm.doc.__onload.quotation_series;
Expand All @@ -23,6 +23,21 @@ frappe.ui.form.on("Shopping Cart Settings", {
</div>`
);
}

frappe.model.with_doctype("Item", () => {
const web_item_meta = frappe.get_meta('Website Item');

const valid_fields = web_item_meta.fields.filter(
df => ["Link", "Table MultiSelect"].includes(df.fieldtype) && !df.hidden
).map(df => ({ label: df.label, value: df.fieldname }));

frm.fields_dict.filter_fields.grid.update_docfield_property(
'fieldname', 'fieldtype', 'Select'
);
frm.fields_dict.filter_fields.grid.update_docfield_property(
'fieldname', 'options', valid_fields
);
});
},
enabled: function(frm) {
if (frm.doc.enabled === 1) {
Expand Down
Loading