diff --git a/.github/workflows/sync.yaml b/.github/workflows/sync.yaml new file mode 100644 index 0000000000..02a32541e1 --- /dev/null +++ b/.github/workflows/sync.yaml @@ -0,0 +1,32 @@ +name: Sync with upstream branch + +on: + push: + branches: + - version-* + - develop + + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Fetch upstream + run: | + git remote add upstream https://github.com/frappe/webshop.git + git fetch upstream + + - name: Sync with upstream + run: | + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config user.name "github-actions[bot]" + git merge upstream/${{ github.ref_name }} + + - name: Push to origin + run: | + git push origin ${{ github.ref_name }} \ No newline at end of file diff --git a/README.md b/README.md index f9392b38b3..e048ebe50d 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,58 @@ -## Frappe Webshop +# Frappe Webshop + Frappe webshop is an Open Source eCommerce Platform ![Frappe Webshop](webshop.png) -## Installation -1. [Install bench](https://github.com/frappe/bench). -2. [Install ERPNext](https://github.com/frappe/bench#installation). -3. Once ERPNext is installed, add the webshop app to your bench by running - - ```sh - $ bench get-app webshop - ``` -4. After that, you can install the webshop app on the required site by running - ```sh - $ bench --site sitename install-app webshop - ``` - -#### License -GNU GPL V3. (See [LICENSE](LICENSE) for more information). +## Update guide + +**Note:** There will be no commit on `develop` branch. + +There are 2 remotes: + +- origin (zaviagodev/webshop) +- upstream (frappe/webshop) + +Each version should have a seprate branch on both remotes like `version-15`, `version-13` e.t.c + +### Steps + +1. Developer will commit the change in the relative branch example `version-15` +2. After commiting developer should keep the relative branch in sync with its `upstream` branch by: + + ```bash + git fetch upstream + git merge upstream/ + ``` + +3. At times there might be some conflicts developer hast to make sure the conflicts are resolved properly. + +### Steps for new version Release + +1. Switch to latest branch example `version-15` & make sure its synced with its upstream branch. + + ```bash + git checkout version-15 + git fetch upstream + git merge upstream/version-15 + ``` + +2. create new branch from latest branch & push. + + ```bash + git checkout version-15 + git checkout -b version-16 + git push origin version-16 + ``` + +3. sync with relative upstream branch by + + ```bash + git fetch upstream version-16 + git merge upstream/version-16 + ``` + +4. resolve conflicts if any & push. + + ```bash + git push origin version-16 + ``` diff --git a/webshop/hooks.py b/webshop/hooks.py index 722069d327..58cf038b8f 100644 --- a/webshop/hooks.py +++ b/webshop/hooks.py @@ -38,6 +38,10 @@ "Homepage": "public/js/override/homepage.js", } +override_whitelisted_methods = { + "webshop.webshop.doctype.website_item.website_item.make_website_item": "webshop.webshop.doctype.website_item.custom_website_item.make_website_item" +} + doc_events = { "Item": { "on_update": [ diff --git a/webshop/public/js/override/item.js b/webshop/public/js/override/item.js index e61f122209..26ba9523d9 100644 --- a/webshop/public/js/override/item.js +++ b/webshop/public/js/override/item.js @@ -1,8 +1,8 @@ frappe.ui.form.on("Item", { - refresh: function(frm) { - if (!frm.doc.__islocal) { + refresh: function (frm) { + // if (!frm.doc.__islocal) { if (!frm.doc.published_in_website) { - frm.add_custom_button(__("Publish in Website"), function() { + frm.add_custom_button(__("Publish in Website"), function () { frappe.call({ method: "webshop.webshop.doctype.website_item.website_item.make_website_item", args: { @@ -10,28 +10,29 @@ frappe.ui.form.on("Item", { }, freeze: true, freeze_message: __("Publishing Item ..."), - callback: function(result) { - frappe.msgprint({ - message: __("Website Item {0} has been created.", - [repl('%(item)s', { - item_encoded: encodeURIComponent(result.message[0]), - item: result.message[1] - })] - ), - title: __("Published"), - indicator: "green" - }); + callback: function (result) { + // frappe.msgprint({ + // message: __("Website Item {0} has been created.", + // [repl('%(item)s', { + // item_encoded: encodeURIComponent(result.message[0]), + // item: result.message[1] + // })] + // ), + // title: __("Published"), + // indicator: "green" + // }); + window.location.href = "/app/website-item/" + result.message[0] } }); }, __('Actions')); } else { - frm.add_custom_button(__("View Website Item"), function() { - frappe.db.get_value("Website Item", {item_code: frm.doc.name}, "name", (d) => { + frm.add_custom_button(__("View Website Item"), function () { + frappe.db.get_value("Website Item", { item_code: frm.doc.name }, "name", (d) => { if (!d.name) frappe.throw(__("Website Item not found")); frappe.set_route("Form", "Website Item", d.name); }); }); } - } + // } } }); diff --git a/webshop/templates/pages/wishlist.py b/webshop/templates/pages/wishlist.py index 66b359caa5..afff52ad23 100644 --- a/webshop/templates/pages/wishlist.py +++ b/webshop/templates/pages/wishlist.py @@ -85,6 +85,6 @@ def set_stock_price_details(items, settings, selling_price_list): if item.formatted_mrp: item.discount = price_details.get( "formatted_discount_percent" - ) or price_details.get("formatted_discount_rate") + ) or price_details.get("formatted_discount_rate") or price_details.get("formatted_discount_amount") return items diff --git a/webshop/webshop/api.py b/webshop/webshop/api.py index d7399cef52..7bd869f1ab 100644 --- a/webshop/webshop/api.py +++ b/webshop/webshop/api.py @@ -10,80 +10,367 @@ from webshop.webshop.product_data_engine.filters import ProductFiltersBuilder from webshop.webshop.product_data_engine.query import ProductQuery from webshop.webshop.doctype.override_doctype.item_group import get_child_groups_for_website +from webshop.webshop.doctype.override_doctype.item_group import get_main_groups_for_website +from webshop.webshop.shopping_cart.cart import get_party, update_cart as _update_cart +from webshop.webshop.doctype.wishlist.wishlist import add_to_wishlist +from webshop.webshop.doctype.wishlist.wishlist import remove_from_wishlist +from frappe.utils.oauth import redirect_post_login +from frappe import _ +from frappe.utils.password import update_password as _update_password +from frappe.website.utils import is_signup_disabled +from frappe.utils import ( + escape_html, +) +from webshop.webshop.shopping_cart.cart import (_get_cart_quotation) +from frappe.utils import nowdate, nowtime, cint +from frappe.handler import upload_file @frappe.whitelist(allow_guest=True) def get_product_filter_data(query_args=None): - """ - Returns filtered products and discount filters. - - Args: - 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: - 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: - frappe.log_error("Product query with filter failed") - 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"], - } + """ + Returns filtered products and discount filters. + + Args: + 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: + 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: + print(frappe.get_traceback()) + frappe.log_error("Product query with filter failed") + return {"exc": frappe.get_traceback()} + + # 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"], + "total_items" : frappe.db.count('Website Item', {'published': '1'}) + } @frappe.whitelist(allow_guest=True) def get_guest_redirect_on_action(): - return frappe.db.get_single_value("Webshop Settings", "redirect_on_action") + return frappe.db.get_single_value("Webshop Settings", "redirect_on_action") + + +@frappe.whitelist(allow_guest=True) +def get_main_group(): + return get_main_groups_for_website() + + +# @frappe.whitelist() +# def get_orders(filters="{}", start=0, page_size=20): +# party = get_party() +# filters = json.loads(filters) +# filters = { +# **filters, +# "customer": party.name, +# } +# order_list = frappe.db.get_all( +# "Sales Order", +# filters=filters, +# fields="*", +# limit_start=start, +# limit_page_length=page_size, +# ) +# count = frappe.db.count("Sales Order", filters=filters) +# return { +# "orders": order_list, +# "count": count, +# } + +# @frappe.whitelist() +# def get_order(order_name): +# party = get_party() +# sales_order = frappe.get_last_doc("Sales Order", filters={"name": order_name, "customer": party.name}) +# if not sales_order: +# frappe.throw(_("You are not allowed to access this order")) +# return sales_order + +@frappe.whitelist() +def get_orders(filters="{}", start=0, page_size=20): + party = get_party() + filters = json.loads(filters) + filters = { + **filters, + "customer": party.name, + } + invoice_list = frappe.db.get_all( + "Sales Invoice", + filters=filters, + fields="*", + limit_start=start, + limit_page_length=page_size, + order_by="modified desc" + ) + count = frappe.db.count("Sales Invoice", filters=filters) + return { + "orders": invoice_list, + "count": count, + } + +@frappe.whitelist() +def get_order(invoice_name): + party = get_party() + sales_invoice = frappe.get_last_doc("Sales Invoice", filters={"name": invoice_name, "customer": party.name}) + have_payment_entry = frappe.db.exists("Payment Entry Reference", {"reference_name": invoice_name}) + if not sales_invoice: + frappe.throw(_("You are not allowed to access this order")) + return { + "have_payment_entry": True if have_payment_entry else False, + **sales_invoice.as_dict() + } + +@frappe.whitelist() +def get_shipping_methods(): + lp_record = frappe.get_all("Shipping Rule", filters={"custom_show_on_website": 1}, fields=["name","shipping_rule_type","shipping_amount"]) + return lp_record + +@frappe.whitelist() +def update_wshlist( + item_codes: list = [], +): + if frappe.db.exists("Wishlist", frappe.session.user): + wishlist = frappe.get_doc("Wishlist", frappe.session.user) + wishlist.items = [] + wishlist.save(ignore_permissions=True) + for item_code in item_codes: + add_to_wishlist(item_code) + return item_codes + + +@frappe.whitelist(allow_guest=True) +def sign_up(email: str, full_name: str, password): + if is_signup_disabled(): + frappe.throw(_("Sign Up is disabled"), title=_("Not Allowed")) + + user = frappe.db.get("User", {"email": email}) + if user: + if user.enabled: + return frappe.throw(_("Already Registered")) + else: + return frappe.throw(_("Registered but disabled")) + else: + if frappe.db.get_creation_count("User", 60) > 300: + frappe.respond_as_web_page( + _("Temporarily Disabled"), + _( + "Too many users signed up recently, so the registration is disabled. Please try back in an hour" + ), + http_status_code=429, + ) + + from frappe.utils import random_string + at_index = email.find("@") + username = '' + if at_index != -1: + username = email[:at_index] + + base_username = username + count = 1 + while frappe.db.get_value("User", {"username": username}): + count += 1 + username = f"{base_username}{count}" + + + user = frappe.get_doc( + { + "doctype": "User", + "email": email, + "first_name": escape_html(full_name), + "username": username, + "enabled": 1, + "birth_date": None, + "new_password": password, + "user_type": "Website User", + } + ) + user.flags.ignore_permissions = True + user.flags.ignore_password_policy = True + user.flags.is_verified = 1 + user.insert() + + default_role = frappe.db.get_single_value("Portal Settings", "default_role") + if default_role: + user.add_roles(default_role) + + get_party(user=user.name) + + # api_secret = frappe.generate_hash(length=15) + # if not user.api_key: + # api_key = frappe.generate_hash(length=15) + # user.api_key = api_key + # user.api_secret = api_secret + # user.save() + # user.reload() + + # token = f"{user.api_key}:{user.get_password('api_secret')}" + + # use Login Manager to login + frappe.local.login_manager.login_as(user.name) + + return { + "user": user.name, + "username": user.username, + "full_name": user.full_name, + "email": user.email + } + + +@frappe.whitelist() +def update_cart(cart): + quotation = _get_cart_quotation() + if not quotation.as_dict().get("__islocal", 0): + for item in quotation.items: + frappe.delete_doc("Quotation Item", item.name, ignore_permissions=True) + if quotation.items: + quotation.save(ignore_permissions=True) + for item_code, qty in cart.items(): + _update_cart(item_code, qty) + return _get_cart_quotation() + + +@frappe.whitelist() +def update_profile(first_name=None, last_name=None, phone=None): + user = frappe.get_doc("User", frappe.session.user) + if first_name is not None: + user.first_name = first_name + if last_name is not None: + print("last_name", last_name) + user.last_name = last_name + if phone is not None: + user.phone = phone + user.flags.ignore_permissions = True + user.save() + +@frappe.whitelist() +def payment_methods(): + payments = frappe.get_doc("Webshop Settings", "Webshop Settings") + + payment_methods = [] + + if payments.enable_promptpay_qr == 1: + payment_info = { + 'name': payments.payment_method_title, + 'key': 1, + 'promptpay_qr_image': payments.upload_your_promptpay_qr_image, + 'account_name': payments.promptpay_account_name, + 'promptpay_number': payments.promptpay_number + } + payment_methods.append(payment_info) + + if payments.enable_bank_transfer == 1: + banks_list = frappe.get_all("Payment Channel",filters={"parent": "Webshop Settings"},fields=["bank","bank_account_name","bank_account_number"]) + payment_info = { + 'name': payments.bank_title, + 'key': 2, + 'banks_list': [ { + 'bank': bank.get("bank"), + 'bank_account_name': bank.get("bank_account_name"), + 'bank_account_number': bank.get("bank_account_number"), + 'custom_bank_logo': frappe.db.get_value("Bank", bank.get("bank"), "custom_bank_logo") + } for bank in banks_list] + } + payment_methods.append(payment_info) + + return payment_methods + + +@frappe.whitelist() +def confirm_payment(invoice_name, payment_info): + frappe.form_dict.is_private = True + bank_slip = upload_file() + + if not bank_slip: + frappe.throw("Please upload bank slip") + + payment_info = json.loads(payment_info) + web_settings = frappe.get_doc("Webshop Settings", "Webshop Settings") + + # # make sales invoice + # from erpnext.selling.doctype.sales_order.sales_order import make_sales_invoice + # sales_invoice = make_sales_invoice(order_name, ignore_permissions=True) + # sales_invoice.custom_channel = "Website" + # for item in sales_invoice.items: + # item.warehouse = None + # # sales_invoice.set_target_warehouse = None + # sales_invoice.save(ignore_permissions=True) + # sales_invoice.submit() + # print("sales_invoice", sales_invoice.name) + + current_user = frappe.session.user + current_session_data = frappe.session.data + frappe.set_user("Administrator") + + # make payment entry + from erpnext.accounts.doctype.payment_entry.payment_entry import get_payment_entry + payment_entry = get_payment_entry("Sales Invoice", invoice_name) + payment_entry.custom_payment_file = bank_slip.get("file_url") + payment_entry.mode_of_payment = web_settings.mode_of_payment_for_qr if payment_info.get("payment_method_key") == "1" else web_settings.mode_of_payment_for_bank + payment_entry.reference_date = nowdate() + payment_entry.reference_no = invoice_name + payment_entry.custom_bank_name = payment_info.get("bank") if payment_info.get("payment_method_key") == "2" else None + payment_entry.save(ignore_permissions=True) + + frappe.set_user(current_user) + frappe.session.data = current_session_data + + +@frappe.whitelist(allow_guest=True) +def get_config(): + return frappe.get_doc("Webshop Settings") \ No newline at end of file diff --git a/webshop/webshop/custom/shipping_rule.json b/webshop/webshop/custom/shipping_rule.json new file mode 100644 index 0000000000..062e9b04c4 --- /dev/null +++ b/webshop/webshop/custom/shipping_rule.json @@ -0,0 +1,69 @@ +{ + "doctype": "Shipping Rule", + "custom_fields": [ + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-04-22 06:23:35.946986", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Shipping Rule", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_show_on_website", + "fieldtype": "Check", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "disabled", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Show on website", + "length": 0, + "mandatory_depends_on": null, + "modified": "2024-04-22 06:23:35.946986", + "modified_by": "Administrator", + "module": null, + "name": "Shipping Rule-custom_show_on_website", + "no_copy": 0, + "non_negative": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + } + ], + "property_setters": [], + "sync_on_migrate": 1 +} \ No newline at end of file diff --git a/webshop/webshop/custom/website_item.json b/webshop/webshop/custom/website_item.json new file mode 100644 index 0000000000..ba3ae2d6a5 --- /dev/null +++ b/webshop/webshop/custom/website_item.json @@ -0,0 +1,3170 @@ +{ + "custom_fields": [ + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-08-30 11:47:30.465119", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom__item_product_variants", + "fieldtype": "Table", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 24, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom_manage_variants", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Item Product variants", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-08-30 11:47:30.465119", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom__item_product_variants", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": "Item Product variants", + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-02 17:37:46.477892", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_additional_info", + "fieldtype": "Tab Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 72, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "website_warehouse", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Additional Info", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-02 17:37:46.477892", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_additional_info", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-02 17:19:38.156404", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_column_break_0n8ml", + "fieldtype": "Column Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 32, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "stock_information_section", + "is_system_generated": 0, + "is_virtual": 0, + "label": "", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-02 17:19:38.156404", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_column_break_0n8ml", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-02 16:39:34.976493", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_column_break_8rnbk", + "fieldtype": "Column Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 58, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom_on_sale", + "is_system_generated": 0, + "is_virtual": 0, + "label": "", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-02 16:39:34.976493", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_column_break_8rnbk", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-02 16:50:40.211057", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_column_break_ct4ct", + "fieldtype": "Column Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 67, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom_set_discount_value", + "is_system_generated": 0, + "is_virtual": 0, + "label": "", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-02 16:50:40.211057", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_column_break_ct4ct", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-10 11:21:46.309102", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_column_break_eziym", + "fieldtype": "Column Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 28, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "item_group", + "is_system_generated": 0, + "is_virtual": 0, + "label": "", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-10 11:21:46.309102", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_column_break_eziym", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-04 02:16:16.875651", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_column_break_tgeci", + "fieldtype": "Column Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 36, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "section_break_17", + "is_system_generated": 0, + "is_virtual": 0, + "label": "", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-04 02:16:16.875651", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_column_break_tgeci", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-02 16:39:35.415987", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_cost_of_goods", + "fieldtype": "Currency", + "hidden": 1, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 60, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom_logo_section_in_pricing", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Cost of goods", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-02 16:39:35.415987", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_cost_of_goods", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-02 16:50:39.391211", + "default": null, + "depends_on": "custom_on_sale", + "description": "Set your discount value based on your selected discount type.", + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_disc_value", + "fieldtype": "Section Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 65, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom_select_discount_type_", + "is_system_generated": 0, + "is_virtual": 0, + "label": "
2. Set Value
", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-02 16:50:39.391211", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_disc_value", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-02 16:50:38.449268", + "default": null, + "depends_on": "custom_on_sale", + "description": "Select type of discount you want to use, you can use\u2028By Percentages or
By Total Amount of your product", + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_discount_type_section", + "fieldtype": "Section Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 63, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom_sale_price", + "is_system_generated": 0, + "is_virtual": 0, + "label": "
1. Select Type
", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-02 16:50:38.449268", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_discount_type_section", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-08 16:18:21.038726", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_get_images_from_main_item", + "fieldtype": "Button", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 15, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom_images_section_top", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Get Images from Main Item", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-08 16:18:21.038726", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_get_images_from_main_item", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-02 17:37:48.313034", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_get_information_from_main_item", + "fieldtype": "Button", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 74, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom_web_information", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Get Information from Main Item", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-02 17:37:48.313034", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_get_information_from_main_item", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-03 15:14:12.492209", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_images_list", + "fieldtype": "Section Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 13, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "slideshow", + "is_system_generated": 0, + "is_virtual": 0, + "label": "", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-03 15:14:12.492209", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_images_list", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-04 12:59:47.113557", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_images_section_top", + "fieldtype": "HTML", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 14, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom_images_list", + "is_system_generated": 0, + "is_virtual": 0, + "label": "", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-04 12:59:47.113557", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_images_section_top", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": "", + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-02 17:19:38.906599", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_inventory", + "fieldtype": "Tab Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 69, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom_sales_price", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Inventory", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-02 17:19:38.906599", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_inventory", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-04 13:16:11.302786", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_logo_section_in_pricing", + "fieldtype": "HTML", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 59, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom_column_break_8rnbk", + "is_system_generated": 0, + "is_virtual": 0, + "label": "", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-04 13:16:11.302786", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_logo_section_in_pricing", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": "", + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-03 10:30:43.842028", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_long_description", + "fieldtype": "Text", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 80, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom_return__refund_title", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Long Description", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-03 10:30:43.842028", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_long_description", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 1, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-08-30 11:47:30.019944", + "default": null, + "depends_on": "eval:doc.has_variants", + "description": null, + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_manage_variants", + "fieldtype": "Section Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 23, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom_website_pricing_virtual", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Manage variants", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-08-30 11:47:30.019944", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_manage_variants", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-02 16:39:36.307102", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_margin", + "fieldtype": "Currency", + "hidden": 1, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 61, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom_cost_of_goods", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Margin", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-02 16:39:36.307102", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_margin", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-02 16:41:10.474275", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_on_sale", + "fieldtype": "Check", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 57, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom_price", + "is_system_generated": 0, + "is_virtual": 0, + "label": "On Sale", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-02 16:41:10.474275", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_on_sale", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-02 16:39:34.516620", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_price", + "fieldtype": "Currency", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 56, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom_website_pricing_summary", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Price", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-02 16:39:34.516620", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_price", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-02 16:31:26.955361", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_pricing", + "fieldtype": "Tab Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 54, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "website_content", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Pricing", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-02 16:31:26.955361", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_pricing", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-03 10:30:42.849188", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_return__refund_policy", + "fieldtype": "Section Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 78, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "web_long_description", + "is_system_generated": 0, + "is_virtual": 0, + "label": "
Return & Refund Policy
", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-03 10:30:42.849188", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_return__refund_policy", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-03 10:30:43.375530", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_return__refund_title", + "fieldtype": "Data", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 79, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom_return__refund_policy", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Return & Refund Title", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-03 10:30:43.375530", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_return__refund_title", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-09 09:56:53.647342", + "default": "eval:doc.custom_sales_price", + "depends_on": "eval:doc.custom_on_sale==1", + "description": null, + "docstatus": 0, + "dt": "Website Item", + "fetch_from": "item_code.custom_sale_price_not_virtual", + "fetch_if_empty": 1, + "fieldname": "custom_sale_price", + "fieldtype": "Currency", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 62, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 1, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom_margin", + "is_system_generated": 0, + "is_virtual": 1, + "label": "Sale Price", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-09 09:56:53.647342", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_sale_price", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 1, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-02 16:50:40.633488", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_sales_price", + "fieldtype": "Currency", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 68, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom_column_break_ct4ct", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Sale Price", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-02 16:50:40.633488", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_sales_price", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-02 16:27:29.545204", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_section_break_1ewip", + "fieldtype": "Section Break", + "hidden": 1, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 1, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": null, + "is_system_generated": 0, + "is_virtual": 0, + "label": "", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-02 16:27:29.545204", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_section_break_1ewip", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-02 16:50:38.900861", + "default": "Discount Percentage", + "depends_on": null, + "description": "", + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_select_discount_type_", + "fieldtype": "Select", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 64, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom_discount_type_section", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Select Discount Type ", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-02 16:50:38.900861", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_select_discount_type_", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": "Discount Percentage\nDiscount Amount", + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-02 16:50:39.798356", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_set_discount_value", + "fieldtype": "Currency", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 66, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom_disc_value", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Set Discount Value", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-02 16:50:39.798356", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_set_discount_value", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-03 10:30:45.195914", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_shipping_description", + "fieldtype": "Text", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 83, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom_shipping_title", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Description", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-03 10:30:45.195914", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_shipping_description", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 1, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-03 10:30:44.272494", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_shipping_info", + "fieldtype": "Section Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 81, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom_long_description", + "is_system_generated": 0, + "is_virtual": 0, + "label": "
Shipping Info
", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-03 10:30:44.272494", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_shipping_info", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-03 10:30:44.701346", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_shipping_title", + "fieldtype": "Data", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 82, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom_shipping_info", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Shipping Title", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-03 10:30:44.701346", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_shipping_title", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-02 16:20:55.440897", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_web_category", + "fieldtype": "Section Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 25, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom__item_product_variants", + "is_system_generated": 0, + "is_virtual": 0, + "label": "
Website Category
", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-02 16:20:55.440897", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_web_category", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-02 17:37:47.432740", + "default": null, + "depends_on": null, + "description": "Here you'll detail your product with short and long descriptions, and set your refund policy and shipping information.", + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_web_information", + "fieldtype": "Section Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 73, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom_additional_info", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Web Information", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-02 17:37:47.432740", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_web_information", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-02 15:04:22.636948", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_website_pricing", + "fieldtype": "Section Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 21, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "published", + "is_system_generated": 0, + "is_virtual": 0, + "label": "
Website Pricing
", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-02 15:04:22.636948", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_website_pricing", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-02 16:39:34.116365", + "default": null, + "depends_on": null, + "description": "
Set specific website pricing list here, you can have different pricing
in your website which is different than the master item
\n
\n
", + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_website_pricing_summary", + "fieldtype": "Section Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 55, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom_pricing", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Website Pricing Summary", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-02 16:39:34.116365", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_website_pricing_summary", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": "Set specific pricing list here, you can have different pricing
in your website which is different than the master item", + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-02 15:04:23.017573", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_website_pricing_virtual", + "fieldtype": "Read Only", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 22, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom_website_pricing", + "is_system_generated": 0, + "is_virtual": 1, + "label": "", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-02 15:04:23.017573", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_website_pricing_virtual", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2024-07-02 17:19:39.373397", + "default": null, + "depends_on": null, + "description": "
Control your stock levels here. Update quantities and track inventory across
all channels to keep your business running smoothly
\n
\n
", + "docstatus": 0, + "dt": "Website Item", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_website_store_inventory", + "fieldtype": "Section Break", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 70, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom_inventory", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Website Store Inventory", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2024-07-02 17:19:39.373397", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_website_store_inventory", + "no_copy": 0, + "non_negative": 0, + "not_in_filter": 0, + "options": null, + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 0, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + } + ], + "custom_perms": [], + "doctype": "Website Item", + "links": [], + "property_setters": [ + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-07-02 17:21:52.230639", + "default_value": null, + "doc_type": "Website Item", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "advanced_display_section", + "idx": 0, + "is_system_generated": 0, + "modified": "2024-08-15 11:59:30.207831", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-advanced_display_section-hidden", + "owner": "Administrator", + "property": "hidden", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-07-11 12:56:14.571155", + "default_value": null, + "doc_type": "Website Item", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "custom_on_sale", + "idx": 0, + "is_system_generated": 1, + "modified": "2024-08-15 11:59:29.777759", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_on_sale-in_list_view", + "owner": "Administrator", + "property": "in_list_view", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-07-17 17:18:28.033766", + "default_value": null, + "doc_type": "Website Item", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "custom_price", + "idx": 0, + "is_system_generated": 1, + "modified": "2024-08-15 11:59:29.720063", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_price-in_list_view", + "owner": "Administrator", + "property": "in_list_view", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-07-12 15:59:28.885001", + "default_value": null, + "doc_type": "Website Item", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "custom_sale_price", + "idx": 0, + "is_system_generated": 1, + "modified": "2024-08-15 11:59:29.748514", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_sale_price-in_list_view", + "owner": "Administrator", + "property": "in_list_view", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-07-12 16:00:47.619089", + "default_value": null, + "doc_type": "Website Item", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "custom_sales_price", + "idx": 0, + "is_system_generated": 1, + "modified": "2024-08-15 11:59:29.835900", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_sales_price-in_list_view", + "owner": "Administrator", + "property": "in_list_view", + "property_type": "Check", + "row_name": null, + "value": "0" + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-07-11 12:06:44.737469", + "default_value": null, + "doc_type": "Website Item", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "custom_select_discount_type_", + "idx": 0, + "is_system_generated": 1, + "modified": "2024-08-15 11:59:29.905212", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-custom_select_discount_type_-in_list_view", + "owner": "Administrator", + "property": "in_list_view", + "property_type": "Check", + "row_name": null, + "value": "0" + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-07-04 18:32:20.286896", + "default_value": null, + "doc_type": "Website Item", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "description", + "idx": 0, + "is_system_generated": 0, + "modified": "2024-08-15 11:59:30.023610", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-description-hidden", + "owner": "Administrator", + "property": "hidden", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-07-02 17:41:14.596249", + "default_value": null, + "doc_type": "Website Item", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "description", + "idx": 0, + "is_system_generated": 0, + "modified": "2024-08-15 11:59:30.157902", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-description-label", + "owner": "Administrator", + "property": "label", + "property_type": "Data", + "row_name": null, + "value": "Long Description" + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-07-02 17:21:51.435972", + "default_value": null, + "doc_type": "Website Item", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "display_additional_information_section", + "idx": 0, + "is_system_generated": 0, + "modified": "2024-08-15 11:59:30.309237", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-display_additional_information_section-hidden", + "owner": "Administrator", + "property": "hidden", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-07-04 12:58:08.328023", + "default_value": null, + "doc_type": "Website Item", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "display_section", + "idx": 0, + "is_system_generated": 0, + "modified": "2024-08-15 11:59:30.081941", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-display_section-hidden", + "owner": "Administrator", + "property": "hidden", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-08-30 11:09:30.556549", + "default_value": null, + "doc_type": "Website Item", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "has_variants", + "idx": 0, + "is_system_generated": 0, + "modified": "2024-08-30 11:09:30.556549", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-has_variants-depends_on", + "owner": "Administrator", + "property": "depends_on", + "property_type": "Data", + "row_name": null, + "value": "eval:!doc.variant_of" + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-07-11 12:06:44.680982", + "default_value": null, + "doc_type": "Website Item", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "item_group", + "idx": 0, + "is_system_generated": 1, + "modified": "2024-08-15 11:59:29.861120", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-item_group-in_list_view", + "owner": "Administrator", + "property": "in_list_view", + "property_type": "Check", + "row_name": null, + "value": "0" + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-07-10 11:39:48.830967", + "default_value": null, + "doc_type": "Website Item", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "item_name", + "idx": 0, + "is_system_generated": 0, + "modified": "2024-08-15 11:59:29.974248", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-item_name-hidden", + "owner": "Administrator", + "property": "hidden", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-10-21 13:51:22.871029", + "default_value": null, + "doc_type": "Website Item", + "docstatus": 0, + "doctype_or_field": "DocType", + "field_name": null, + "idx": 0, + "is_system_generated": 0, + "modified": "2024-10-21 13:51:22.871029", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-main-field_order", + "owner": "Administrator", + "property": "field_order", + "property_type": "Data", + "row_name": null, + "value": "[\"custom_section_break_1ewip\", \"naming_series\", \"route\", \"has_variants\", \"variant_of\", \"column_break_3\", \"stock_uom\", \"column_break_11\", \"display_section\", \"website_image_alt\", \"column_break_13\", \"slideshow\", \"custom_images_list\", \"custom_images_section_top\", \"custom_get_images_from_main_item\", \"thumbnail\", \"website_image\", \"website_images\", \"web_item_name\", \"published\", \"custom_website_pricing\", \"custom_website_pricing_virtual\", \"custom_manage_variants\", \"custom__item_product_variants\", \"custom_web_category\", \"item_code\", \"item_group\", \"custom_column_break_eziym\", \"brand\", \"item_name\", \"stock_information_section\", \"custom_column_break_0n8ml\", \"column_break_24\", \"on_backorder\", \"section_break_17\", \"custom_column_break_tgeci\", \"column_break_27\", \"website_specifications\", \"copy_from_item_group\", \"display_additional_information_section\", \"show_tabbed_section\", \"tabs\", \"recommended_items_section\", \"recommended_items\", \"offers_section\", \"offers\", \"section_break_6\", \"ranking\", \"set_meta_tags\", \"column_break_22\", \"website_item_groups\", \"advanced_display_section\", \"website_content\", \"custom_pricing\", \"custom_website_pricing_summary\", \"custom_price\", \"custom_on_sale\", \"custom_column_break_8rnbk\", \"custom_logo_section_in_pricing\", \"custom_cost_of_goods\", \"custom_margin\", \"custom_sale_price\", \"custom_discount_type_section\", \"custom_select_discount_type_\", \"custom_disc_value\", \"custom_set_discount_value\", \"custom_column_break_ct4ct\", \"custom_sales_price\", \"custom_inventory\", \"custom_website_store_inventory\", \"website_warehouse\", \"custom_additional_info\", \"custom_web_information\", \"custom_get_information_from_main_item\", \"short_description\", \"description\", \"web_long_description\", \"custom_return__refund_policy\", \"custom_return__refund_title\", \"custom_long_description\", \"custom_shipping_info\", \"custom_shipping_title\", \"custom_shipping_description\"]" + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-08-14 14:49:39.739758", + "default_value": null, + "doc_type": "Website Item", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "naming_series", + "idx": 0, + "is_system_generated": 0, + "modified": "2024-08-14 14:49:39.739758", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-naming_series-default", + "owner": "Administrator", + "property": "default", + "property_type": "Text", + "row_name": null, + "value": "WEB-ITM-.####" + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-08-14 14:49:39.716605", + "default_value": null, + "doc_type": "Website Item", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "naming_series", + "idx": 0, + "is_system_generated": 0, + "modified": "2024-08-14 14:49:39.716605", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-naming_series-options", + "owner": "Administrator", + "property": "options", + "property_type": "Text", + "row_name": null, + "value": "WEB-ITM-.####" + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-07-02 17:21:51.842150", + "default_value": null, + "doc_type": "Website Item", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "offers_section", + "idx": 0, + "is_system_generated": 0, + "modified": "2024-08-15 11:59:30.258242", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-offers_section-hidden", + "owner": "Administrator", + "property": "hidden", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-07-04 13:08:11.896267", + "default_value": null, + "doc_type": "Website Item", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "published", + "idx": 0, + "is_system_generated": 0, + "modified": "2024-08-15 11:59:30.055435", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-published-label", + "owner": "Administrator", + "property": "label", + "property_type": "Data", + "row_name": null, + "value": "Show in online store" + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-07-02 17:21:51.642710", + "default_value": null, + "doc_type": "Website Item", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "recommended_items_section", + "idx": 0, + "is_system_generated": 0, + "modified": "2024-08-15 11:59:30.282430", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-recommended_items_section-hidden", + "owner": "Administrator", + "property": "hidden", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-07-11 12:06:44.709695", + "default_value": null, + "doc_type": "Website Item", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "route", + "idx": 0, + "is_system_generated": 1, + "modified": "2024-08-15 11:59:29.927091", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-route-in_list_view", + "owner": "Administrator", + "property": "in_list_view", + "property_type": "Check", + "row_name": null, + "value": "0" + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-07-02 17:21:51.224275", + "default_value": null, + "doc_type": "Website Item", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "section_break_17", + "idx": 0, + "is_system_generated": 0, + "modified": "2024-08-15 11:59:30.335707", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-section_break_17-hidden", + "owner": "Administrator", + "property": "hidden", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-07-02 17:21:52.023233", + "default_value": null, + "doc_type": "Website Item", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "section_break_6", + "idx": 0, + "is_system_generated": 0, + "modified": "2024-08-15 11:59:30.233738", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-section_break_6-hidden", + "owner": "Administrator", + "property": "hidden", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-07-02 17:41:14.382412", + "default_value": null, + "doc_type": "Website Item", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "short_description", + "idx": 0, + "is_system_generated": 0, + "modified": "2024-08-15 11:59:30.183479", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-short_description-label", + "owner": "Administrator", + "property": "label", + "property_type": "Data", + "row_name": null, + "value": "Short Description" + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-07-04 12:51:29.934230", + "default_value": null, + "doc_type": "Website Item", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "slideshow", + "idx": 0, + "is_system_generated": 0, + "modified": "2024-08-15 11:59:30.108432", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-slideshow-hidden", + "owner": "Administrator", + "property": "hidden", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-07-02 17:21:51.003988", + "default_value": null, + "doc_type": "Website Item", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "stock_information_section", + "idx": 0, + "is_system_generated": 0, + "modified": "2024-08-15 11:59:30.358735", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-stock_information_section-hidden", + "owner": "Administrator", + "property": "hidden", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-07-11 14:00:30.610684", + "default_value": null, + "doc_type": "Website Item", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "thumbnail", + "idx": 0, + "is_system_generated": 1, + "modified": "2024-08-15 11:59:29.884244", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-thumbnail-in_list_view", + "owner": "Administrator", + "property": "in_list_view", + "property_type": "Check", + "row_name": null, + "value": "0" + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-07-11 12:06:44.637960", + "default_value": null, + "doc_type": "Website Item", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "web_item_name", + "idx": 0, + "is_system_generated": 1, + "modified": "2024-08-15 11:59:29.806689", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-web_item_name-in_list_view", + "owner": "Administrator", + "property": "in_list_view", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-07-04 12:51:29.759972", + "default_value": null, + "doc_type": "Website Item", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "website_image_alt", + "idx": 0, + "is_system_generated": 0, + "modified": "2024-08-15 11:59:30.132188", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-website_image_alt-hidden", + "owner": "Administrator", + "property": "hidden", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-07-08 14:16:30.202343", + "default_value": null, + "doc_type": "Website Item", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "website_images", + "idx": 0, + "is_system_generated": 0, + "modified": "2024-08-15 11:59:29.997666", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-website_images-in_preview", + "owner": "Administrator", + "property": "in_preview", + "property_type": "Check", + "row_name": null, + "value": "1" + }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2024-07-02 17:19:37.907817", + "default_value": null, + "doc_type": "Website Item", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "website_warehouse", + "idx": 0, + "is_system_generated": 0, + "modified": "2024-08-15 11:59:30.381803", + "modified_by": "Administrator", + "module": null, + "name": "Website Item-website_warehouse-description", + "owner": "Administrator", + "property": "description", + "property_type": "Text", + "row_name": null, + "value": "Entering the first Stock of this product to track the inventory" + } + ], + "sync_on_migrate": 1 +} \ No newline at end of file diff --git a/webshop/webshop/doctype/override_doctype/item_group.py b/webshop/webshop/doctype/override_doctype/item_group.py index 9148564392..60ded8e591 100644 --- a/webshop/webshop/doctype/override_doctype/item_group.py +++ b/webshop/webshop/doctype/override_doctype/item_group.py @@ -149,4 +149,18 @@ def get_child_groups_for_website(item_group_name, immediate=False, include_self= if include_self: filters.update({"lft": [">=", item_group.lft], "rgt": ["<=", item_group.rgt]}) - return frappe.get_all("Item Group", filters=filters, fields=["name", "route"], order_by="name") \ No newline at end of file + return frappe.get_all("Item Group", filters=filters, fields=["name", "route"], order_by="name") + + +def get_children(group_name): + children = frappe.get_all("Item Group", filters={"parent_item_group": group_name,"show_in_website":"1"}, fields=["name"], order_by="name") + for child in children: + child['children'] = get_children(child['name']) + return children + + +def get_main_groups_for_website(): + main_groups = frappe.get_all("Item Group", filters={"parent_item_group": "All Item Groups","show_in_website":"1"}, fields=["name"], order_by="name") + for group in main_groups: + group['children'] = get_children(group['name']) + return main_groups diff --git a/webshop/webshop/doctype/payment_channel/__init__.py b/webshop/webshop/doctype/payment_channel/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/webshop/webshop/doctype/payment_channel/payment_channel.json b/webshop/webshop/doctype/payment_channel/payment_channel.json new file mode 100644 index 0000000000..1d8b18697b --- /dev/null +++ b/webshop/webshop/doctype/payment_channel/payment_channel.json @@ -0,0 +1,54 @@ +{ + "actions": [], + "allow_rename": 1, + "creation": "2024-04-04 06:56:55.620649", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "bank", + "bank_account_name", + "column_break_biqv", + "bank_account_number" + ], + "fields": [ + { + "fieldname": "bank", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Bank", + "options": "Bank", + "reqd": 1 + }, + { + "fieldname": "bank_account_name", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Bank Account Name", + "reqd": 1 + }, + { + "fieldname": "column_break_biqv", + "fieldtype": "Column Break" + }, + { + "fieldname": "bank_account_number", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Bank Account Number", + "reqd": 1 + } + ], + "index_web_pages_for_search": 1, + "istable": 1, + "links": [], + "modified": "2024-06-30 23:23:50.364493", + "modified_by": "Administrator", + "module": "Webshop", + "name": "Payment Channel", + "owner": "Administrator", + "permissions": [], + "sort_field": "modified", + "sort_order": "DESC", + "states": [] +} \ No newline at end of file diff --git a/webshop/webshop/doctype/payment_channel/payment_channel.py b/webshop/webshop/doctype/payment_channel/payment_channel.py new file mode 100644 index 0000000000..2f1543f3c4 --- /dev/null +++ b/webshop/webshop/doctype/payment_channel/payment_channel.py @@ -0,0 +1,9 @@ +# Copyright (c) 2024, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +# import frappe +from frappe.model.document import Document + + +class PaymentChannel(Document): + pass diff --git a/webshop/webshop/doctype/webshop_settings/webshop_settings.js b/webshop/webshop/doctype/webshop_settings/webshop_settings.js index 2d5558b3f1..2d71a6f7f2 100644 --- a/webshop/webshop/doctype/webshop_settings/webshop_settings.js +++ b/webshop/webshop/doctype/webshop_settings/webshop_settings.js @@ -13,6 +13,12 @@ frappe.ui.form.on("Webshop Settings", { }); }, refresh: function(frm) { + const tab = frappe.route_options?.initial_tab; + if (tab) { + frm.layout.select_tab(tab); + // remove the tab from url + window.history.replaceState(null, null, window.location.href.replace(window.location.search, "")); + } if (frm.doc.enabled) { frm.get_field('store_page_docs').$wrapper.removeClass('hide-control').html( `
${__("Follow these steps to create a landing page for your store")}: diff --git a/webshop/webshop/doctype/webshop_settings/webshop_settings.json b/webshop/webshop/doctype/webshop_settings/webshop_settings.json index 1b65f536a9..ab8864beba 100644 --- a/webshop/webshop/doctype/webshop_settings/webshop_settings.json +++ b/webshop/webshop/doctype/webshop_settings/webshop_settings.json @@ -5,7 +5,12 @@ "editable_grid": 1, "engine": "InnoDB", "field_order": [ + "site_name", "products_per_page", + "brand_logo", + "site_favicon", + "default_language", + "help_url", "filter_categories_section", "enable_field_filters", "filter_fields", @@ -22,11 +27,14 @@ "column_break_13", "show_apply_coupon_code_in_website", "show_contact_us_button", + "contact_us_label", + "contact_us_url", "show_attachments", "section_break_18", "company", "price_list", "enabled", + "add_to_cart_label", "store_page_docs", "column_break_21", "default_customer_group", @@ -40,6 +48,7 @@ "payment_success_url", "add_ons_section", "enable_wishlist", + "enable_i18n", "column_break_22", "enable_reviews", "column_break_23", @@ -48,12 +57,30 @@ "redisearch_warning", "search_index_fields", "is_redisearch_enabled", + "is_search_enabled", "is_redisearch_loaded", "shop_by_category_section", "slideshow", "guest_display_settings_section", "hide_price_for_guest", - "redirect_on_action" + "redirect_on_action", + "payment_setting_tab", + "website_payment_setting_section", + "enable_bank_transfer", + "section_break_uzqc", + "bank_title", + "payment_channels", + "mode_of_payment_for_bank", + "promptpay_qr_section", + "enable_promptpay_qr", + "section_break_bgza", + "payment_method_title", + "upload_your_promptpay_qr_image", + "mode_of_payment_for_qr", + "bank", + "column_break_pnbl", + "promptpay_account_name", + "promptpay_number" ], "fields": [ { @@ -366,12 +393,163 @@ "fieldtype": "Check", "label": "Enable Redisearch", "read_only_depends_on": "eval:!doc.is_redisearch_loaded" + }, + { + "fieldname": "brand_logo", + "fieldtype": "Attach Image", + "label": "Brand Logo" + }, + { + "default": "0", + "fieldname": "is_search_enabled", + "fieldtype": "Check", + "label": "Enable Search" + }, + { + "default": "0", + "fieldname": "enable_i18n", + "fieldtype": "Check", + "label": "Enable Internationalization (I18N)" + }, + { + "fieldname": "default_language", + "default": "en", + "fieldtype": "Link", + "label": "Default Language", + "options": "Language", + "reqd": 1 + }, + { + "depends_on": "show_contact_us_button", + "fieldname": "contact_us_label", + "fieldtype": "Data", + "label": "Contact us label", + "mandatory_depends_on": "show_contact_us_button" + }, + { + "depends_on": "show_contact_us_button", + "fieldname": "contact_us_url", + "fieldtype": "Data", + "label": "Contact us URL", + "mandatory_depends_on": "show_contact_us_button" + }, + { + "fieldname": "payment_setting_tab", + "fieldtype": "Tab Break", + "label": "Payment Setting" + }, + { + "fieldname": "website_payment_setting_section", + "fieldtype": "Section Break", + "label": "Website Payment Setting" + }, + { + "default": "0", + "fieldname": "enable_bank_transfer", + "fieldtype": "Check", + "label": "Enable Bank Transfer" + }, + { + "depends_on": "enable_bank_transfer", + "fieldname": "section_break_uzqc", + "fieldtype": "Section Break" + }, + { + "fieldname": "bank_title", + "fieldtype": "Data", + "label": "Payment Method Title" + }, + { + "fieldname": "payment_channels", + "fieldtype": "Table", + "options": "Payment Channel" + }, + { + "fieldname": "mode_of_payment_for_bank", + "fieldtype": "Link", + "label": "Mode Of payment for bank", + "options": "Mode of Payment" + }, + { + "fieldname": "promptpay_qr_section", + "fieldtype": "Section Break", + "label": "PromptPay QR" + }, + { + "default": "0", + "fieldname": "enable_promptpay_qr", + "fieldtype": "Check", + "label": "Enable PromptPay QR" + }, + { + "depends_on": "enable_promptpay_qr", + "fieldname": "section_break_bgza", + "fieldtype": "Section Break" + }, + { + "fieldname": "payment_method_title", + "fieldtype": "Data", + "label": "Payment Method Title" + }, + { + "fieldname": "upload_your_promptpay_qr_image", + "fieldtype": "Attach Image", + "label": "Upload your PromptPay QR image" + }, + { + "fieldname": "mode_of_payment_for_qr", + "fieldtype": "Link", + "label": "Mode of payment for Qr", + "options": "Mode of Payment" + }, + { + "fieldname": "bank", + "fieldtype": "Link", + "label": "Bank", + "options": "Bank" + }, + { + "fieldname": "column_break_pnbl", + "fieldtype": "Column Break" + }, + { + "fieldname": "promptpay_account_name", + "fieldtype": "Data", + "label": "PromptPay Account Name", + "mandatory_depends_on": "enable_promptpay_qr" + }, + { + "fieldname": "promptpay_number", + "fieldtype": "Data", + "label": "PromptPay number", + "mandatory_depends_on": "enable_promptpay_qr" + }, + { + "fieldname": "site_favicon", + "fieldtype": "Attach Image", + "label": "Site Favicon" + }, + { + "fieldname": "site_name", + "fieldtype": "Data", + "label": "Site Name", + "reqd": 1 + }, + { + "fieldname": "help_url", + "fieldtype": "Data", + "label": "Help URL" + }, + { + "fieldname": "add_to_cart_label", + "fieldtype": "Data", + "label": "Add To Cart Label" } ], "index_web_pages_for_search": 1, "issingle": 1, "links": [], - "modified": "2022-04-01 18:35:56.106756", + "modified": "2024-07-11 13:11:39.212717", "modified_by": "Administrator", "module": "Webshop", "name": "Webshop Settings", diff --git a/webshop/webshop/doctype/website_item/custom_website_item.py b/webshop/webshop/doctype/website_item/custom_website_item.py new file mode 100644 index 0000000000..9db2d8fdfb --- /dev/null +++ b/webshop/webshop/doctype/website_item/custom_website_item.py @@ -0,0 +1,312 @@ +import json +from typing import TYPE_CHECKING + +if TYPE_CHECKING: + from erpnext.stock.doctype.item.item import Item + +import frappe +from frappe import _ +from frappe.utils import cint, cstr, flt, random_string +from frappe.core.doctype.file.utils import get_local_image, get_web_image +from frappe.website.doctype.website_slideshow.website_slideshow import get_slideshow +from frappe.website.website_generator import WebsiteGenerator + +from webshop.webshop.doctype.item_review.item_review import get_item_reviews +from webshop.webshop.redisearch_utils import ( + delete_item_from_index, + insert_item_to_index, + update_index_for_item, +) +from webshop.webshop.shopping_cart.cart import _set_price_list +from webshop.webshop.doctype.override_doctype.item_group import ( + get_parent_item_groups, + invalidate_cache_for, +) +from erpnext.stock.doctype.item.item import Item +from erpnext.utilities.product import get_price +from webshop.webshop.shopping_cart.cart import get_party +from webshop.webshop.variant_selector.item_variants_cache import ( + ItemVariantsCacheManager, +) +import erpnext +from erpnext.controllers.item_variant import get_variant + + +class CustomWebSiteItem( ): + + @property + def custom_website_pricing_virtual(self): + currency = frappe.defaults.get_global_default('currency') + if self.custom_on_sale: + if self.custom_on_sale: + discount_in_percentage = self.custom_set_discount_value if self.custom_select_discount_type_ == 'Discount Percentage' else self.custom_set_discount_value / self.custom_price * 100 if self.custom_price else 0 + discount_in_value = (self.custom_set_discount_value / 100) * self.custom_price if self.custom_select_discount_type_ == 'Discount Percentage' else self.custom_set_discount_value + custom_sale_price = self.custom_sales_price = (self.custom_price or 0) - (discount_in_value or 0) + else: + discount_in_percentage = 0 + discount_in_value = 0 + custom_sale_price = 0 + custom_price = self.custom_price + + + custom_sale_price = float(custom_sale_price) if isinstance(custom_sale_price, str) else custom_sale_price + custom_sale_price=custom_sale_price if self.custom_on_sale else 0 + # discount_in_percentage = float(discount_in_percentage) if isinstance(discount_in_percentage, str) else discount_in_percentage + discount_in_value = float(discount_in_value) if isinstance(discount_in_value, str) else discount_in_value + + + return f''' +
+
+ Price + {frappe.utils.fmt_money(self.custom_price, currency=currency)} +
+ {'
Sales Price'+frappe.utils.fmt_money(custom_sale_price,currency=currency)+'
' if custom_sale_price>0 else ""} +
+ {f'Discount in %{round(discount_in_percentage, 2):g} %' if discount_in_percentage > 0 else ""} +
+ {'
Discount in Value'+frappe.utils.fmt_money(discount_in_value, currency=currency)+'
' if discount_in_value>0 else ""} +
+ ''' + + def before_save(self): + if self.is_new(): + item_doc = frappe.get_doc('Item', self.item_code) + self.custom_price = item_doc.standard_rate + if item_doc.custom_on_sale: + self.custom_on_sale = item_doc.custom_on_sale + self.custom_select_discount_type_ = item_doc.custom_discount_type + self.custom_set_discount_value = item_doc.custom_discount_value + self.custom_sales_price = item_doc.custom_sale_price_not_virtual + self.custom_sale_price = item_doc.custom_sales_price_1 + self.update_price() + self.update_pricing_rule() + + fields = self.get_changed_fields() + if fields and len(fields) >= 2: + if self.custom_price: + self.update_price() + self.update_pricing_rule() + else: + pass + + + def update_pricing_rule(self): + price_list = frappe.db.get_single_value("Webshop Settings", "price_list") or frappe.db.get_value("Price List", _("Website Selling")) + existing_rules = frappe.db.exists('Pricing Rule', {'title': self.item_code, 'for_price_list': price_list}) + + if existing_rules: + pricing_rule = frappe.get_doc('Pricing Rule', existing_rules) + pricing_rule.update({ + 'disable': 0 if self.custom_on_sale else 1, + 'rate_or_discount': self.custom_select_discount_type_, + 'rate': self.custom_set_discount_value if self.custom_select_discount_type_ == 'Rate' else 0, + 'discount_amount': self.custom_set_discount_value if self.custom_select_discount_type_ == 'Discount Amount' else 0, + 'discount_percentage': self.custom_set_discount_value if self.custom_select_discount_type_ == 'Discount Percentage' else 0 + }) + # Save the document + pricing_rule.save() + else: + self.add_pricing_rule() + + + def add_pricing_rule(self): + price_list = frappe.db.get_single_value("Webshop Settings", "price_list") or frappe.db.get_value("Price List", _("Website Selling")) + pricing_rule = frappe.get_doc({ + 'doctype': 'Pricing Rule', + 'apply_on': "Item Code", + 'price_or_product_discount': "Price", + 'selling': 1, + 'for_price_list': price_list, + 'title': self.item_code, + 'pricing_rule_name': self.item_code, + 'currency': erpnext.get_default_currency(), + 'rate_or_discount': self.custom_select_discount_type_, + 'rate': self.custom_set_discount_value if self.custom_select_discount_type_ == 'Rate' else 0, + 'discount_amount': self.custom_set_discount_value if self.custom_select_discount_type_ == 'Discount Amount' else 0, + 'discount_percentage': self.custom_set_discount_value if self.custom_select_discount_type_ == 'Discount Percentage' else 0, + 'items': [{ + 'item_code': self.item_code + }] + }) + pricing_rule.insert() + return pricing_rule + + def update_price(self, price_list=None): + if self.custom_price: + if not price_list: + price_list = frappe.db.get_single_value("Webshop Settings", "price_list") or frappe.db.get_value("Price List", _("Website Selling")) + + existing_price = frappe.db.exists('Item Price', {'item_code': self.item_code,'price_list': price_list}) + if existing_price: + frappe.db.set_value('Item Price', existing_price, 'price_list_rate', self.custom_price) + else: + if price_list: + item_price = frappe.get_doc( + { + "doctype": "Item Price", + "price_list": price_list, + "item_code": self.item_code, + "currency": erpnext.get_default_currency(), + "price_list_rate": self.custom_price, + } + ) + item_price.insert() + self.item_price = item_price + + def get_changed_fields(self): + changed_fields = [] + initilaized_fields = [] + old_doc = self.get_doc_before_save() + if not old_doc: + return [] + for field in frappe.get_meta(self.doctype).fields: + if not field.is_virtual and field.fieldtype != 'Table': + if self.get(field.fieldname) != None and old_doc.get(field.fieldname) == None: + initilaized_fields.append(field.fieldname) + + if self.get(field.fieldname) != old_doc.get(field.fieldname): + changed_fields.append(field.fieldname) + + return [changed_fields, initilaized_fields] + + +@frappe.whitelist() +def get_item_data_for_web_item(reference,item_name): + main_item = frappe.get_doc("Item",item_name) + if( main_item is not None ): + temp_dict=dict({ + "custom_short_description":main_item.custom_short_description, + "description":main_item.description, + "custom_return__refund_title":main_item.custom_return__refund_title, + "custom_return__refund_description":main_item.custom_return__refund_description, + "custom_shipping_title":main_item.custom_shipping_title, + "custom_shipping_description":main_item.custom_shipping_description, + }) + frappe.response['message'] = temp_dict + else: + frappe.response['message'] = "None" + +@frappe.whitelist() +def get_images_from_item(item_code, website_item): + item = frappe.get_doc("Item", item_code) + if( item is not None ): + if website_item: + website_item = frappe.get_doc("Website Item", website_item) + if website_item: + website_item.website_images = [] + for custom_image in item.get("custom_images"): + custom_image_doc = frappe.get_doc("File", custom_image.get("image")) + file_name, ext = custom_image_doc.file_name.split(".") + custom_image_doc.file_name = f"{file_name[:134]}.{ext}" + image = frappe.copy_doc(custom_image_doc).update({ + "attached_to_doctype": "Website Item", + "attached_to_name": website_item.name, + "attached_to_field": "website_images", + }).insert() + website_item.append("website_images", { + "file_url": image.file_url, + "image": image.name, + }) + website_item.save() + + + +@frappe.whitelist() +def make_website_item(doc, save=True): + print("custom => make_website_item") + """ + Make Website Item from Item. Used via Form UI or patch. + """ + if not doc: + return + if isinstance(doc, str): + doc = json.loads(doc) + if frappe.db.exists("Website Item", {"item_code": doc.get("item_code")}): + message = _("Website Item already exists against {0}").format( + frappe.bold(doc.get("item_code")) + ) + frappe.throw(message, title=_("Already Published")) + website_item = frappe.new_doc("Website Item") + website_item.autoname() + website_item.web_item_name = doc.get("item_name") + fields_to_map = [ + "item_code", + "item_name", + "item_group", + "stock_uom", + "brand", + "has_variants", + "variant_of", + "description", + "custom_return__refund_title", + "custom_shipping_title", + "custom_shipping_description" + ] + for field in fields_to_map: + website_item.update({field: doc.get(field)}) + website_item.short_description=doc.get("custom_short_description") + website_item.web_long_description=doc.get("description") + website_item.custom_long_description=doc.get("custom_return__refund_description") + + if not frappe.flags.in_migrate and ( + doc.get("image") and not website_item.website_image + ): + website_item.website_image = doc.get("image") + for custom_image in doc.get("custom_images", []): + custom_image_doc = frappe.get_doc("File", custom_image.get("image")) + file_name, ext = custom_image_doc.file_name.split(".") + custom_image_doc.file_name = f"{file_name[:134]}.{ext}" + image = frappe.copy_doc(custom_image_doc).update({ + "attached_to_doctype": "Website Item", + "attached_to_name": website_item.name, + "attached_to_field": "website_images", + }).insert() + website_item.append("website_images", { + "file_url": image.file_url, + "image": image.name, + }) + + if not save: + return website_item + + website_item.insert(set_name=website_item.name) + + if doc.get("has_variants"): + variants_list = [] + variants = doc.get("custom__item_product_variants") + if variants: + for variant in variants: + variants_list.append({ + "variant": variant["variant"], + "data_hwpc": variant["data_hwpc"], + "status": variant["status"] + }) + website_item.set("custom__item_product_variants", variants_list) + frappe.enqueue( + "webshop.webshop.doctype.website_item.custom_website_item.make_website_variants", + item_code=doc.get("item_code"), + now=frappe.flags.in_test, + ) + website_item.save() + + insert_item_to_index(website_item) + return [website_item.name, website_item.web_item_name] + + +def make_website_variants(item_code): + variants = frappe.get_all("Item", filters={"variant_of": item_code}, fields=["name", "item_name"]) + for variant in variants: + doc = frappe.get_doc("Item", variant.name) + make_website_item(doc) + # if item_code: + # insert_item_pricing(item_code, variant_price=doc.standard_rate) + +# def insert_item_pricing(item_code, price_list='Standard Selling', variant_price=0.0): +# existing_prices = frappe.get_all('Item Price', filters={'item_code': item_code}, fields=['name', 'price_list_rate']) +# if existing_prices: +# frappe.db.set_value('Item Price', existing_prices[0].name, 'price_list_rate', variant_price) +# frappe.db.set_value('Website Item', item_code, 'standard_rate', variant_price) +# else: +# CustomItem.add_price(item_code, variant_price) +# frappe.db.set_value('Website Item', item_code, 'standard_rate', variant_price) \ No newline at end of file diff --git a/webshop/webshop/doctype/website_item/website_item.js b/webshop/webshop/doctype/website_item/website_item.js index e82cd1d933..e77d1530a6 100644 --- a/webshop/webshop/doctype/website_item/website_item.js +++ b/webshop/webshop/doctype/website_item/website_item.js @@ -3,23 +3,80 @@ frappe.ui.form.on('Website Item', { onload: (frm) => { + let images_button = $(".btn-attach[data-fieldname='website_images']"); + images_button.html("Upload Images"); + images_button.css("visibility", "hidden"); + + frm.set_df_property("description", "read_only", 0); // should never check Private frm.fields_dict["website_image"].df.is_private = 0; - }, + if (frm.doc.custom_on_sale && frm.doc.custom_sales_price > 0) + frm.set_value("custom_sale_price", frm.doc.custom_sales_price, 0, 1); + }, + onload_post_render: (frm) => { + setTimeout(function (frm) { + console.log("loaded") + let images_button = $(".btn-attach[data-fieldname='website_images']"); + images_button.css("visibility", "visible"); + $("div[data-fieldname='website_images']").find(".row").after(images_button); + }, 1200); + }, + custom_price: function (frm) { + update_sale_price(frm) + }, + custom_select_discount_type_: function (frm) { + update_sale_price(frm) + }, + custom_sales_price: function (frm) { + reverse_update_sale_price(frm) + }, + custom_set_discount_value: function (frm) { + update_sale_price(frm) + }, + custom_get_information_from_main_item(frm) { + if (frm.doc.item_code == null) { + frappe.msgprint("Please add item code to proceed"); + } + frappe.call({ + freeze: true, + freeze_message: "Loading item data...", + method: 'webshop.webshop.doctype.website_item.custom_website_item.get_item_data_for_web_item', + args: { + 'reference': frm.doc.name, + 'item_name': frm.doc.item_code, + }, + callback: function (r) { + response = r.message; + frm.set_value("short_description", response.custom_short_description); + frm.set_value("web_long_description", response.description); + frm.set_value("custom_return__refund_title", response.custom_return__refund_title); + frm.set_value("custom_long_description", response.custom_return__refund_description); + frm.set_value("custom_shipping_title", response.custom_shipping_title); + frm.set_value("custom_shipping_description", response.custom_shipping_description); + } + }); + }, + custom_get_images_from_main_item(frm) { + if (frm.doc.item_code == null) { + frappe.msgprint("Please add item code to proceed"); + } else { + fetch_images(frm) + } + }, refresh: (frm) => { - frm.add_custom_button(__("Prices"), function() { - frappe.set_route("List", "Item Price", {"item_code": frm.doc.item_code}); + frm.add_custom_button(__("Prices"), function () { + frappe.set_route("List", "Item Price", { "item_code": frm.doc.item_code }); }, __("View")); - frm.add_custom_button(__("Stock"), function() { + frm.add_custom_button(__("Stock"), function () { frappe.route_options = { "item_code": frm.doc.item_code }; frappe.set_route("query-report", "Stock Balance"); }, __("View")); - frm.add_custom_button(__("Webshop Settings"), function() { + frm.add_custom_button(__("Webshop Settings"), function () { frappe.set_route("Form", "Webshop Settings"); }, __("View")); }, @@ -35,3 +92,74 @@ frappe.ui.form.on('Website Item', { frappe.utils.set_meta_tag(frm.doc.route); } }); +function fetch_images(frm) { + frappe.call({ + freeze: true, + freeze_message: "Fetching Images", + method: 'webshop.webshop.doctype.website_item.custom_website_item.get_images_from_item', + args: { + 'item_code': frm.doc.item_code, + 'website_item': frm.doc.name, + }, + callback: function (r) { + frm.reload_doc(); + } + }); +} +function update_sale_price(frm) { + let sale_price = 0; + if (frm.doc.custom_on_sale) { + if (frm.doc.custom_set_discount_value < 0) { + frappe.msgprint("Negative numbers are not allowed") + frm.set_value("custom_set_discount_value", 0); + return; + } + if (frm.doc.custom_select_discount_type_ == "Discount Percentage") { + if (frm.doc.custom_set_discount_value > 100) { + frappe.msgprint("Discount percentage cannot be more than 100%") + frm.set_value("custom_set_discount_value", 0); + return; + } + sale_price = frm.doc.custom_set_discount_value / 100; + sale_price = frm.doc.custom_price - (frm.doc.custom_price * sale_price); + } else { + if (frm.doc.custom_set_discount_value > frm.doc.custom_price) { + frappe.msgprint("Sale price cannot be more than the product price") + frm.set_value("custom_set_discount_value", 0); + return; + } + sale_price = frm.doc.custom_price - frm.doc.custom_set_discount_value; + } + let discounted_value = Math.round((sale_price + Number.EPSILON) * 100) / 100; + if (discounted_value < 1 || discounted_value == null || isNaN(discounted_value)) { + discounted_value = 0; + } + discounted_value.toFixed(2) + frm.set_value("custom_sale_price", discounted_value); + $(".input-with-feedback[data-fieldname='custom_sales_price']").val(discounted_value); + // frm.set_value("custom_sales_price", discounted_value ); + //frm.set_value("custom_sales_price", discounted_value ); + } +} +function reverse_update_sale_price(frm) { + + if (frm.doc.custom_sales_price > frm.doc.custom_price) { + frappe.msgprint("Discount cannot be more than the product price") + frm.set_value("custom_set_discount_value", 0); + return; + } + + let sale_price = 0; + if (frm.doc.custom_on_sale) { + discounted_value = frm.doc.custom_price - frm.doc.custom_sales_price; + sale_price = frm.doc.custom_sales_price; + if (frm.doc.custom_select_discount_type_ == "Discount Percentage") { + frm.set_value("custom_select_discount_type_", "Discount Amount"); + } + frm.set_value("custom_set_discount_value", discounted_value); + // frm.set_value("custom_sales_price", sale_price ); + } + $(".input-with-feedback[data-fieldname='custom_sales_price']").val($(".input-with-feedback[data-fieldname='custom_sales_price']").val()); + return; +} + diff --git a/webshop/webshop/doctype/website_item/website_item.json b/webshop/webshop/doctype/website_item/website_item.json index 6e23a13e92..89bf9c0e13 100644 --- a/webshop/webshop/doctype/website_item/website_item.json +++ b/webshop/webshop/doctype/website_item/website_item.json @@ -24,6 +24,7 @@ "brand", "display_section", "website_image", + "website_images", "website_image_alt", "column_break_13", "slideshow", @@ -341,6 +342,12 @@ "fieldname": "on_backorder", "fieldtype": "Check", "label": "On Backorder" + }, + { + "fieldname": "website_images", + "fieldtype": "Attach Multiple Images", + "label": "Website images", + "options": "Image List" } ], "has_web_view": 1, @@ -348,7 +355,7 @@ "index_web_pages_for_search": 1, "links": [], "make_attachments_public": 1, - "modified": "2022-09-30 04:01:52.090732", + "modified": "2024-07-04 07:06:05.856466", "modified_by": "Administrator", "module": "Webshop", "name": "Website Item", diff --git a/webshop/webshop/doctype/website_item/website_item.py b/webshop/webshop/doctype/website_item/website_item.py index aa7e3de347..5d32e4d11f 100644 --- a/webshop/webshop/doctype/website_item/website_item.py +++ b/webshop/webshop/doctype/website_item/website_item.py @@ -31,9 +31,8 @@ from webshop.webshop.variant_selector.item_variants_cache import ( ItemVariantsCacheManager, ) - - -class WebsiteItem(WebsiteGenerator): +from webshop.webshop.doctype.website_item.custom_website_item import CustomWebSiteItem +class WebsiteItem(WebsiteGenerator,CustomWebSiteItem): website = frappe._dict( page_title_field="web_item_name", condition_field="published", @@ -80,6 +79,7 @@ def validate(self): def on_update(self): invalidate_cache_for_web_item(self) + self.update_template_item() def on_trash(self): @@ -526,11 +526,32 @@ def make_website_item(doc, save=True): "has_variants", "variant_of", "description", + "custom_return__refund_title", + "custom_shipping_title", + "custom_shipping_description", ] + + for field in fields_to_map: website_item.update({field: doc.get(field)}) + website_item.short_description=doc.get("custom_short_description") + website_item.web_long_description=doc.get("description") + website_item.custom_long_description=doc.get("custom_return__refund_description") + + # img_doc= frappe.get_doc("File","") + # const_img={ + # "image": img_doc, + # "file_type": img_doc.file_type, + # "file_url": img_doc.file_url, + # "thumbnail_url": img_doc.thumbnail_url, + # "file_size": img_doc.file_size, + # } + # # website_item.custom_images=const_img + # frappe.msgprint(str(const_img)) # Needed for publishing/mapping via Form UI only + + if not frappe.flags.in_migrate and ( doc.get("image") and not website_item.website_image ): @@ -540,7 +561,7 @@ def make_website_item(doc, save=True): return website_item website_item.save() - + # Add to search cache insert_item_to_index(website_item) diff --git a/webshop/webshop/doctype/website_item/website_item_list.js b/webshop/webshop/doctype/website_item/website_item_list.js index b9dd9214a3..f8800be37e 100644 --- a/webshop/webshop/doctype/website_item/website_item_list.js +++ b/webshop/webshop/doctype/website_item/website_item_list.js @@ -16,5 +16,10 @@ frappe.listview_settings['Website Item'] = { } else { return [__("Not Published"), "grey", "published,=,0"]; } - } + }, + + // onload(listview) { + // $(".primary-action[data-label='Add Website Item']").css("display","none"); + // }, + }; \ No newline at end of file diff --git a/webshop/webshop/product_data_engine/query.py b/webshop/webshop/product_data_engine/query.py index 4fb6c60543..70fd950541 100644 --- a/webshop/webshop/product_data_engine/query.py +++ b/webshop/webshop/product_data_engine/query.py @@ -94,13 +94,14 @@ def query_items(self, start=0): # MySQL does not support offset without limit, # frappe does not accept two parameters for limit # https://dev.mysql.com/doc/refman/8.0/en/select.html#id4651989 + count_items = frappe.db.get_all( "Website Item", filters=self.filters, or_filters=self.or_filters, limit_page_length=184467440737095516, - limit_start=start, # get all items from this offset for total count ahead - order_by="ranking desc", + # limit_start=start, # get all items from this offset for total count ahead + # order_by="ranking desc", ) count = len(count_items) @@ -119,6 +120,14 @@ def query_items(self, start=0): limit_start=start, order_by="ranking desc", ) + + items_with_values = [] + for item in items: + item_doc = frappe.get_doc("Website Item", item.name) + # custom_images = item_doc.get("custom_multipleimges", []) + # file_urls = [image.get("file_url") for image in custom_images] + # item["slider_images"] = file_urls + items_with_values.append(item) return items, count @@ -257,7 +266,7 @@ def get_price_discount_info(self, item, price_object, discount_list): if item.formatted_mrp: item.discount = price_object.get("formatted_discount_percent") or price_object.get( "formatted_discount_rate" - ) + ) or price_object.get("formatted_discount_amount") def get_stock_availability(self, item): """Modify item object and add stock details.""" diff --git a/webshop/webshop/shopping_cart/cart.py b/webshop/webshop/shopping_cart/cart.py index d7abbfd4be..9e28bceeff 100644 --- a/webshop/webshop/shopping_cart/cart.py +++ b/webshop/webshop/shopping_cart/cart.py @@ -11,14 +11,14 @@ from erpnext.accounts.utils import get_account_name from webshop.webshop.doctype.webshop_settings.webshop_settings import ( - get_shopping_cart_settings, + get_shopping_cart_settings, ) from webshop.webshop.utils.product import get_web_item_qty_in_stock from erpnext.selling.doctype.quotation.quotation import _make_sales_order class WebsitePriceListMissingError(frappe.ValidationError): - pass + pass def set_cart_count(quotation=None): @@ -33,7 +33,9 @@ def set_cart_count(quotation=None): @frappe.whitelist() def get_cart_quotation(doc=None): + print("//////////get_cart_quotation///////////////") party = get_party() + print("//////////get_cart_quotation end///////////////") if not doc: quotation = _get_cart_quotation(party) @@ -53,11 +55,16 @@ def get_cart_quotation(doc=None): "cart_settings": frappe.get_cached_doc("Webshop Settings"), } +@frappe.whitelist() +def get_addresses(): + return get_address_docs() @frappe.whitelist() def get_shipping_addresses(party=None): if not party: + print("//////////get_shipping_addresses///////////////") party = get_party() + print("//////////get_shipping_addresses end///////////////") addresses = get_address_docs(party=party) return [ { @@ -73,7 +80,9 @@ def get_shipping_addresses(party=None): @frappe.whitelist() def get_billing_addresses(party=None): if not party: + print("//////////get_billing_addresses///////////////") party = get_party() + print("//////////get_billing_addresses end///////////////") addresses = get_address_docs(party=party) return [ { @@ -85,6 +94,89 @@ def get_billing_addresses(party=None): if address.address_type == "Billing" ] +@frappe.whitelist() +def get_address(address_name): + print("//////////get_address///////////////") + portal_user = frappe.get_last_doc("Portal User", filters={ + "user": frappe.session.user, + "parenttype": "Customer" + }) + + print("portal_user => ", portal_user) + + if not portal_user: + frappe.throw(_("Address not found")) + + customer_link = frappe.get_last_doc("Dynamic Link", filters={ + "link_name": portal_user.parent, + "link_doctype": "Customer", + "parenttype": "Address", + "parent": address_name + }) + + if not customer_link: + frappe.throw(_("Address not found")) + + address = frappe.get_doc("Address", address_name) + return address.as_dict() + +@frappe.whitelist() +def update_address(address_name, address): + portal_user = frappe.get_last_doc("Portal User", filters={ + "user": frappe.session.user, + "parenttype": "Customer" + }) + + if not portal_user: + frappe.throw(_("Address not found")) + + customer_link = frappe.get_last_doc("Dynamic Link", filters={ + "link_name": portal_user.parent, + "link_doctype": "Customer", + "parenttype": "Address", + "parent": address_name + }) + + if not customer_link: + frappe.throw(_("Address not found")) + + address_doc = frappe.get_doc("Address", address_name) + address_doc.update(address) + address_doc.save(ignore_permissions=True) + +@frappe.whitelist() +def delete_address(address_name): + portal_user = frappe.get_last_doc("Portal User", filters={ + "user": frappe.session.user, + "parenttype": "Customer" + }) + + if not portal_user: + frappe.throw(_("Address not found")) + + customer_link = frappe.get_last_doc("Dynamic Link", filters={ + "link_name": portal_user.parent, + "link_doctype": "Customer", + "parenttype": "Address", + "parent": address_name + }) + + if not customer_link: + frappe.throw(_("Address not found")) + + frappe.db.set_value("Address", address_name, "disabled", 1) + + quotations = frappe.get_all("Quotation", filters={ + "status": "Draft", + "shipping_address_name": address_name + }) + + for quotation in quotations: + frappe.get_doc("Quotation", quotation.name).update({ + "shipping_address_name": None, + "shipping_address": None + }).save(ignore_permissions=True) + @frappe.whitelist() def place_order(): @@ -136,7 +228,21 @@ def place_order(): if hasattr(frappe.local, "cookie_manager"): frappe.local.cookie_manager.delete_cookie("cart_count") - return sales_order.name + # make sales invoice + from erpnext.selling.doctype.sales_order.sales_order import make_sales_invoice + sales_invoice = make_sales_invoice(sales_order.name, ignore_permissions=True) + print("sales_order.base_discount_amount", sales_order.base_discount_amount) + print("base_discount_amoun", sales_invoice.base_discount_amount) + sales_invoice.custom_sales_channel = "Website" + sales_invoice.update_stock = 0 if cint(cart_settings.allow_items_not_in_stock) else 1 + for item in sales_invoice.items: + item.warehouse = None + # sales_invoice.set_target_warehouse = None + sales_invoice.save(ignore_permissions=True) + sales_invoice.submit() + # print("sales_invoice", sales_invoice.name) + + return sales_invoice.name @frappe.whitelist() @@ -213,7 +319,7 @@ def update_cart(item_code, qty, additional_notes=None, with_items=False): ), } else: - return {"name": quotation.name} + return {"name": quotation.name if quotation else None} @frappe.whitelist() @@ -275,9 +381,8 @@ def create_lead_for_item_inquiry(lead, subject, message): def get_terms_and_conditions(terms_name): return frappe.db.get_value("Terms and Conditions", terms_name, "terms") - @frappe.whitelist() -def update_cart_address(address_type, address_name): +def update_cart_address(address_name, address_type): quotation = _get_cart_quotation() address_doc = frappe.get_doc("Address", address_name).as_dict() address_display = get_address_display(address_doc) @@ -369,7 +474,9 @@ def decorate_quotation_doc(doc): def _get_cart_quotation(party=None): """Return the open Quotation of type "Shopping Cart" or make a new one""" if not party: + print("//////////_get_cart_quotation///////////////") party = get_party() + print("//////////_get_cart_quotation end///////////////") quotation = frappe.get_all( "Quotation", @@ -417,19 +524,19 @@ def _get_cart_quotation(party=None): def update_party(fullname, company_name=None, mobile_no=None, phone=None): party = get_party() - + party.customer_name = company_name or fullname party.customer_type = "Company" if company_name else "Individual" - contact_name = frappe.db.get_value("Contact", {"email_id": frappe.session.user}) - contact = frappe.get_doc("Contact", contact_name) - contact.first_name = fullname - contact.last_name = None - contact.customer_name = party.customer_name - contact.mobile_no = mobile_no - contact.phone = phone - contact.flags.ignore_permissions = True - contact.save() + # contact_name = frappe.db.get_value("Contact", {"email_id": frappe.session.user}) + # contact = frappe.get_doc("Contact", contact_name) + # contact.first_name = fullname + # contact.last_name = None + # contact.customer_name = party.customer_name + # contact.mobile_no = mobile_no + # contact.phone = phone + # contact.flags.ignore_permissions = True + # contact.save() party_doc = frappe.get_doc(party.as_dict()) party_doc.flags.ignore_permissions = True @@ -445,7 +552,9 @@ def update_party(fullname, company_name=None, mobile_no=None, phone=None): def apply_cart_settings(party=None, quotation=None): if not party: + print("//////////apply_cart_settings///////////////") party = get_party() + print("//////////apply_cart_settings end///////////////") if not quotation: quotation = _get_cart_quotation(party) @@ -486,8 +595,10 @@ def _set_price_list(cart_settings, quotation=None): """Set price list based on customer or shopping cart default""" from erpnext.accounts.party import get_default_price_list + print("//////////_set_price_list///////////////") party_name = quotation.get("party_name") if quotation else get_party().get("name") selling_price_list = None + print("//////////_set_price_list end///////////////") # check if default customer price list exists if party_name and frappe.db.exists("Customer", party_name): @@ -541,12 +652,16 @@ def get_party(user=None): contact_name = get_contact_name(user) party = None + print("contact_name => ", contact_name) + + if contact_name: contact = frappe.get_doc("Contact", contact_name) if contact.links: party_doctype = contact.links[0].link_doctype party = contact.links[0].link_name + print("party => ", party) cart_settings = frappe.get_cached_doc("Webshop Settings") debtors_account = "" @@ -555,54 +670,45 @@ def get_party(user=None): debtors_account = get_debtors_account(cart_settings) if party: - doc = frappe.get_doc(party_doctype, party) - if doc.doctype in ["Customer", "Supplier"]: - if not frappe.db.exists("Portal User", {"parent": doc.name, "user": user}): - doc.append("portal_users", {"user": user}) - doc.flags.ignore_permissions = True - doc.flags.ignore_mandatory = True - doc.save() - - return doc + return frappe.get_doc(party_doctype, party) else: if not cart_settings.enabled: frappe.local.flags.redirect_location = "/contact" raise frappe.Redirect - customer = frappe.new_doc("Customer") + fullname = get_fullname(user) - customer.update( - { - "customer_name": fullname, - "customer_type": "Individual", - "customer_group": get_shopping_cart_settings().default_customer_group, - "territory": get_root_of("Territory"), - } - ) - - customer.append("portal_users", {"user": user}) - + customer_doc = frappe.get_doc({ + 'doctype':"Customer", + # 'customer_name': fullname, + 'customer_name': user, + 'email_id': user, + 'email': user, + 'customer_type': 'Individual', + 'customer_group': get_shopping_cart_settings().default_customer_group, + 'territory': get_root_of("Territory") + }) + customer_doc.append("portal_users", {"user": user}) if debtors_account: - customer.update( + customer_doc.update( { "accounts": [ {"company": cart_settings.company, "account": debtors_account} ] } ) + customer_doc.flags.ignore_mandatory = True + customer_doc.save(ignore_permissions=True) - customer.flags.ignore_mandatory = True - customer.insert(ignore_permissions=True) - - contact = frappe.new_doc("Contact") - contact.update( - {"first_name": fullname, "email_ids": [{"email_id": user, "is_primary": 1}]} - ) - contact.append("links", dict(link_doctype="Customer", link_name=customer.name)) - contact.flags.ignore_mandatory = True - contact.insert(ignore_permissions=True) + # contact = frappe.new_doc("Contact") + # contact.update( + # {"first_name": fullname, "email_ids": [{"email_id": user, "is_primary": 1}]} + # ) + # contact.append("links", dict(link_doctype="Customer", link_name=customer_doc.name)) + # contact.flags.ignore_mandatory = True + # contact.insert(ignore_permissions=True) - return customer + return customer_doc def get_debtors_account(cart_settings): @@ -645,15 +751,17 @@ def get_debtors_account(cart_settings): def get_address_docs( - doctype=None, - txt=None, - filters=None, - limit_start=0, - limit_page_length=20, - party=None, + doctype=None, + txt=None, + filters=None, + limit_start=0, + limit_page_length=20, + party=None, ): if not party: + print("//////////get_address_docs///////////////") party = get_party() + print("//////////get_address_docs end///////////////") if not party: return [] @@ -670,6 +778,8 @@ def get_address_docs( for a in address_names: address = frappe.get_doc("Address", a.parent) + if address.disabled: + continue address.display = get_address_display(address.as_dict()) out.append(address) @@ -709,11 +819,10 @@ def get_applicable_shipping_rules(party=None, quotation=None): shipping_rules = get_shipping_rules(quotation) if shipping_rules: - rule_label_map = frappe.db.get_values("Shipping Rule", shipping_rules, "label") - # we need this in sorted order as per the position of the rule in the settings page - return [[rule, rule] for rule in shipping_rules] + return [frappe.get_doc("Shipping Rule", rule_name) for rule_name in shipping_rules] +@frappe.whitelist() def get_shipping_rules(quotation=None, cart_settings=None): if not quotation: quotation = _get_cart_quotation() @@ -724,18 +833,15 @@ def get_shipping_rules(quotation=None, cart_settings=None): "Address", quotation.shipping_address_name, "country" ) if country: - sr_country = frappe.qb.DocType("Shipping Rule Country") - sr = frappe.qb.DocType("Shipping Rule") - query = ( - frappe.qb.from_(sr_country) - .join(sr) - .on(sr.name == sr_country.parent) - .select(sr.name) - .distinct() - .where((sr_country.country == country) & (sr.disabled != 1)) - ) - result = query.run(as_list=True) - shipping_rules = [x[0] for x in result] + res = frappe.get_all( + "Shipping Rule", + filters={"custom_show_on_website": 1, "disabled": 0}, + or_filters=[ + {"country": country}, + {"country": ""}, + ], + ) + shipping_rules = [x.get("name") for x in res] return shipping_rules @@ -761,7 +867,7 @@ def show_terms(doc): @frappe.whitelist(allow_guest=True) -def apply_coupon_code(applied_code, applied_referral_sales_partner): +def apply_coupon_code(applied_code, applied_referral_sales_partner=None): quotation = True if not applied_code: diff --git a/webshop/webshop/shopping_cart/product_info.py b/webshop/webshop/shopping_cart/product_info.py index 97e5871f01..433632261a 100644 --- a/webshop/webshop/shopping_cart/product_info.py +++ b/webshop/webshop/shopping_cart/product_info.py @@ -11,6 +11,7 @@ from erpnext.utilities.product import (get_price) from webshop.webshop.utils.product import (get_non_stock_item_status, get_web_item_qty_in_stock) from webshop.webshop.shopping_cart.cart import get_party +from webshop.webshop.variant_selector.utils import get_attributes_and_values @frappe.whitelist(allow_guest=True) @@ -60,12 +61,37 @@ def get_product_info_for_website(item_code, skip_quotation_creation=False): stock_status = frappe._dict({"on_backorder": True}) else: stock_status = get_web_item_qty_in_stock(item_code, "website_warehouse") + + fields = [ + "name", + "item_code", + "web_item_name", + "web_long_description", + "short_description", + "thumbnail", + "item_group", + "stock_uom", + "slideshow", + "website_images", + "website_specifications", + "has_variants", + "custom_return__refund_title", + "custom_long_description", + "custom_shipping_title", + "custom_shipping_description" + ] + values = frappe.get_cached_value("Website Item", {"item_code": item_code}, fields) + product = dict(zip(fields, values)) + + if product["has_variants"]: + product["variant_attributes"] = get_attributes_and_values(item_code) product_info = { "price": price, "qty": 0, "uom": frappe.db.get_value("Item", item_code, "stock_uom"), "sales_uom": frappe.db.get_value("Item", item_code, "sales_uom"), + **product } if stock_status: