refactor: shopping cart (#22617)
* refactoring shopping cart settings * adding column_break in shopping cart settings
This commit is contained in:
parent
5142fc9365
commit
7137b0b670
@ -55,6 +55,7 @@ frappe.ready(function() {
|
|||||||
shopping_cart.show_shoppingcart_dropdown();
|
shopping_cart.show_shoppingcart_dropdown();
|
||||||
shopping_cart.set_cart_count();
|
shopping_cart.set_cart_count();
|
||||||
shopping_cart.bind_dropdown_cart_buttons();
|
shopping_cart.bind_dropdown_cart_buttons();
|
||||||
|
shopping_cart.show_cart_navbar();
|
||||||
});
|
});
|
||||||
|
|
||||||
$.extend(shopping_cart, {
|
$.extend(shopping_cart, {
|
||||||
@ -177,4 +178,12 @@ $.extend(shopping_cart, {
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
show_cart_navbar: function () {
|
||||||
|
frappe.call({
|
||||||
|
method: "erpnext.shopping_cart.doctype.shopping_cart_settings.shopping_cart_settings.is_cart_enabled",
|
||||||
|
callback: function(r) {
|
||||||
|
$(".shopping-cart").toggleClass('hidden', r.message ? false : true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
@ -1,31 +1,16 @@
|
|||||||
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||||
// License: GNU General Public License v3. See license.txt
|
// License: GNU General Public License v3. See license.txt
|
||||||
|
|
||||||
$.extend(cur_frm.cscript, {
|
frappe.ui.form.on("Shopping Cart Settings", {
|
||||||
onload: function() {
|
onload: function(frm) {
|
||||||
if(cur_frm.doc.__onload && cur_frm.doc.__onload.quotation_series) {
|
if(frm.doc.__onload && frm.doc.__onload.quotation_series) {
|
||||||
cur_frm.fields_dict.quotation_series.df.options = cur_frm.doc.__onload.quotation_series;
|
frm.fields_dict.quotation_series.df.options = frm.doc.__onload.quotation_series;
|
||||||
cur_frm.refresh_field("quotation_series");
|
frm.refresh_field("quotation_series");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
refresh: function(){
|
enabled: function(frm) {
|
||||||
toggle_mandatory(cur_frm)
|
if (frm.doc.enabled === 1) {
|
||||||
},
|
frm.set_value('enable_variants', 1);
|
||||||
enable_checkout: function(){
|
|
||||||
toggle_mandatory(cur_frm)
|
|
||||||
},
|
|
||||||
enabled: function() {
|
|
||||||
if (cur_frm.doc.enabled === 1) {
|
|
||||||
cur_frm.doc.show_configure_button = 1;
|
|
||||||
cur_frm.refresh_field('show_configure_button');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
function toggle_mandatory (cur_frm){
|
|
||||||
cur_frm.toggle_reqd("payment_gateway_account", false);
|
|
||||||
if(cur_frm.doc.enabled && cur_frm.doc.enable_checkout) {
|
|
||||||
cur_frm.toggle_reqd("payment_gateway_account", true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,750 +1,192 @@
|
|||||||
{
|
{
|
||||||
"allow_copy": 0,
|
"actions": [],
|
||||||
"allow_events_in_timeline": 0,
|
"creation": "2013-06-19 15:57:32",
|
||||||
"allow_guest_to_view": 0,
|
"description": "Default settings for Shopping Cart",
|
||||||
"allow_import": 0,
|
"doctype": "DocType",
|
||||||
"allow_rename": 0,
|
"document_type": "System",
|
||||||
"beta": 0,
|
"engine": "InnoDB",
|
||||||
"creation": "2013-06-19 15:57:32",
|
"field_order": [
|
||||||
"custom": 0,
|
"enabled",
|
||||||
"description": "Default settings for Shopping Cart",
|
"display_settings",
|
||||||
"docstatus": 0,
|
"show_attachments",
|
||||||
"doctype": "DocType",
|
"show_price",
|
||||||
"document_type": "System",
|
"show_stock_availability",
|
||||||
"editable_grid": 0,
|
"enable_variants",
|
||||||
"fields": [
|
"column_break_7",
|
||||||
{
|
"show_contact_us_button",
|
||||||
"allow_bulk_edit": 0,
|
"show_quantity_in_website",
|
||||||
"allow_in_quick_entry": 0,
|
"show_apply_coupon_code_in_website",
|
||||||
"allow_on_submit": 0,
|
"allow_items_not_in_stock",
|
||||||
"bold": 0,
|
"section_break_2",
|
||||||
"collapsible": 0,
|
"company",
|
||||||
"columns": 0,
|
"price_list",
|
||||||
"fieldname": "enabled",
|
"column_break_4",
|
||||||
"fieldtype": "Check",
|
"default_customer_group",
|
||||||
"hidden": 0,
|
"quotation_series",
|
||||||
"ignore_user_permissions": 0,
|
"section_break_8",
|
||||||
"ignore_xss_filter": 0,
|
"enable_checkout",
|
||||||
"in_filter": 0,
|
"payment_success_url",
|
||||||
"in_global_search": 0,
|
"column_break_11",
|
||||||
"in_list_view": 1,
|
"payment_gateway_account"
|
||||||
"in_standard_filter": 0,
|
],
|
||||||
"label": "Enable Shopping Cart",
|
"fields": [
|
||||||
"length": 0,
|
{
|
||||||
"no_copy": 0,
|
"default": "0",
|
||||||
"permlevel": 0,
|
"fieldname": "enabled",
|
||||||
"print_hide": 0,
|
"fieldtype": "Check",
|
||||||
"print_hide_if_no_value": 0,
|
"in_list_view": 1,
|
||||||
"read_only": 0,
|
"label": "Enable Shopping Cart"
|
||||||
"remember_last_selected_value": 0,
|
},
|
||||||
"report_hide": 0,
|
{
|
||||||
"reqd": 0,
|
"fieldname": "display_settings",
|
||||||
"search_index": 0,
|
"fieldtype": "Section Break",
|
||||||
"set_only_once": 0,
|
"label": "Display Settings"
|
||||||
"translatable": 0,
|
},
|
||||||
"unique": 0
|
{
|
||||||
},
|
"default": "0",
|
||||||
{
|
"fieldname": "show_attachments",
|
||||||
"allow_bulk_edit": 0,
|
"fieldtype": "Check",
|
||||||
"allow_in_quick_entry": 0,
|
"label": "Show Public Attachments"
|
||||||
"allow_on_submit": 0,
|
},
|
||||||
"bold": 0,
|
{
|
||||||
"collapsible": 0,
|
"default": "0",
|
||||||
"columns": 0,
|
"fieldname": "show_price",
|
||||||
"depends_on": "",
|
"fieldtype": "Check",
|
||||||
"description": "",
|
"label": "Show Price"
|
||||||
"fieldname": "display_settings",
|
},
|
||||||
"fieldtype": "Section Break",
|
{
|
||||||
"hidden": 0,
|
"default": "0",
|
||||||
"ignore_user_permissions": 0,
|
"fieldname": "show_stock_availability",
|
||||||
"ignore_xss_filter": 0,
|
"fieldtype": "Check",
|
||||||
"in_filter": 0,
|
"label": "Show Stock Availability"
|
||||||
"in_global_search": 0,
|
},
|
||||||
"in_list_view": 0,
|
{
|
||||||
"in_standard_filter": 0,
|
"default": "0",
|
||||||
"label": "Display Settings",
|
"fieldname": "show_contact_us_button",
|
||||||
"length": 0,
|
"fieldtype": "Check",
|
||||||
"no_copy": 0,
|
"label": "Show Contact Us Button"
|
||||||
"permlevel": 0,
|
},
|
||||||
"precision": "",
|
{
|
||||||
"print_hide": 0,
|
"default": "0",
|
||||||
"print_hide_if_no_value": 0,
|
"depends_on": "show_stock_availability",
|
||||||
"read_only": 0,
|
"fieldname": "show_quantity_in_website",
|
||||||
"remember_last_selected_value": 0,
|
"fieldtype": "Check",
|
||||||
"report_hide": 0,
|
"label": "Show Stock Quantity"
|
||||||
"reqd": 0,
|
},
|
||||||
"search_index": 0,
|
{
|
||||||
"set_only_once": 0,
|
"default": "0",
|
||||||
"translatable": 0,
|
"fieldname": "show_apply_coupon_code_in_website",
|
||||||
"unique": 0
|
"fieldtype": "Check",
|
||||||
},
|
"label": "Show Apply Coupon Code"
|
||||||
{
|
},
|
||||||
"allow_bulk_edit": 0,
|
{
|
||||||
"allow_in_quick_entry": 0,
|
"default": "0",
|
||||||
"allow_on_submit": 0,
|
"fieldname": "allow_items_not_in_stock",
|
||||||
"bold": 0,
|
"fieldtype": "Check",
|
||||||
"collapsible": 0,
|
"label": "Allow items not in stock to be added to cart"
|
||||||
"columns": 0,
|
},
|
||||||
"depends_on": "",
|
{
|
||||||
"description": "",
|
"depends_on": "enabled",
|
||||||
"fieldname": "show_attachments",
|
"fieldname": "section_break_2",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Section Break"
|
||||||
"hidden": 0,
|
},
|
||||||
"ignore_user_permissions": 0,
|
{
|
||||||
"ignore_xss_filter": 0,
|
"fieldname": "company",
|
||||||
"in_filter": 0,
|
"fieldtype": "Link",
|
||||||
"in_global_search": 0,
|
"in_list_view": 1,
|
||||||
"in_list_view": 0,
|
"label": "Company",
|
||||||
"in_standard_filter": 0,
|
"options": "Company",
|
||||||
"label": "Show Public Attachments",
|
"remember_last_selected_value": 1,
|
||||||
"length": 0,
|
"reqd": 1
|
||||||
"no_copy": 0,
|
},
|
||||||
"permlevel": 0,
|
{
|
||||||
"precision": "",
|
"description": "Prices will not be shown if Price List is not set",
|
||||||
"print_hide": 0,
|
"fieldname": "price_list",
|
||||||
"print_hide_if_no_value": 0,
|
"fieldtype": "Link",
|
||||||
"read_only": 0,
|
"label": "Price List",
|
||||||
"remember_last_selected_value": 0,
|
"options": "Price List"
|
||||||
"report_hide": 0,
|
},
|
||||||
"reqd": 0,
|
{
|
||||||
"search_index": 0,
|
"fieldname": "column_break_4",
|
||||||
"set_only_once": 0,
|
"fieldtype": "Column Break"
|
||||||
"translatable": 0,
|
},
|
||||||
"unique": 0
|
{
|
||||||
},
|
"fieldname": "default_customer_group",
|
||||||
{
|
"fieldtype": "Link",
|
||||||
"allow_bulk_edit": 0,
|
"ignore_user_permissions": 1,
|
||||||
"allow_in_quick_entry": 0,
|
"label": "Default Customer Group",
|
||||||
"allow_on_submit": 0,
|
"options": "Customer Group",
|
||||||
"bold": 0,
|
"reqd": 1
|
||||||
"collapsible": 0,
|
},
|
||||||
"columns": 0,
|
{
|
||||||
"depends_on": "",
|
"fieldname": "quotation_series",
|
||||||
"description": "",
|
"fieldtype": "Select",
|
||||||
"fieldname": "show_price",
|
"label": "Quotation Series",
|
||||||
"fieldtype": "Check",
|
"reqd": 1
|
||||||
"hidden": 0,
|
},
|
||||||
"ignore_user_permissions": 0,
|
{
|
||||||
"ignore_xss_filter": 0,
|
"collapsible": 1,
|
||||||
"in_filter": 0,
|
"collapsible_depends_on": "eval:doc.enable_checkout",
|
||||||
"in_global_search": 0,
|
"depends_on": "enabled",
|
||||||
"in_list_view": 0,
|
"fieldname": "section_break_8",
|
||||||
"in_standard_filter": 0,
|
"fieldtype": "Section Break",
|
||||||
"label": "Show Price",
|
"label": "Checkout Settings"
|
||||||
"length": 0,
|
},
|
||||||
"no_copy": 0,
|
{
|
||||||
"permlevel": 0,
|
"default": "0",
|
||||||
"precision": "",
|
"fieldname": "enable_checkout",
|
||||||
"print_hide": 0,
|
"fieldtype": "Check",
|
||||||
"print_hide_if_no_value": 0,
|
"label": "Enable Checkout"
|
||||||
"read_only": 0,
|
},
|
||||||
"remember_last_selected_value": 0,
|
{
|
||||||
"report_hide": 0,
|
"default": "Orders",
|
||||||
"reqd": 0,
|
"description": "After payment completion redirect user to selected page.",
|
||||||
"search_index": 0,
|
"fieldname": "payment_success_url",
|
||||||
"set_only_once": 0,
|
"fieldtype": "Select",
|
||||||
"translatable": 0,
|
"label": "Payment Success Url",
|
||||||
"unique": 0
|
"options": "\nOrders\nInvoices\nMy Account"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"allow_bulk_edit": 0,
|
"fieldname": "column_break_11",
|
||||||
"allow_in_quick_entry": 0,
|
"fieldtype": "Column Break"
|
||||||
"allow_on_submit": 0,
|
},
|
||||||
"bold": 0,
|
{
|
||||||
"collapsible": 0,
|
"fieldname": "payment_gateway_account",
|
||||||
"columns": 0,
|
"fieldtype": "Link",
|
||||||
"fieldname": "show_stock_availability",
|
"label": "Payment Gateway Account",
|
||||||
"fieldtype": "Check",
|
"options": "Payment Gateway Account"
|
||||||
"hidden": 0,
|
},
|
||||||
"ignore_user_permissions": 0,
|
{
|
||||||
"ignore_xss_filter": 0,
|
"fieldname": "column_break_7",
|
||||||
"in_filter": 0,
|
"fieldtype": "Column Break"
|
||||||
"in_global_search": 0,
|
},
|
||||||
"in_list_view": 0,
|
{
|
||||||
"in_standard_filter": 0,
|
"default": "0",
|
||||||
"label": "Show Stock Availability",
|
"fieldname": "enable_variants",
|
||||||
"length": 0,
|
"fieldtype": "Check",
|
||||||
"no_copy": 0,
|
"label": "Enable Variants"
|
||||||
"permlevel": 0,
|
}
|
||||||
"precision": "",
|
],
|
||||||
"print_hide": 0,
|
"icon": "fa fa-shopping-cart",
|
||||||
"print_hide_if_no_value": 0,
|
"idx": 1,
|
||||||
"read_only": 0,
|
"issingle": 1,
|
||||||
"remember_last_selected_value": 0,
|
"links": [],
|
||||||
"report_hide": 0,
|
"modified": "2020-07-17 17:53:22.667228",
|
||||||
"reqd": 0,
|
"modified_by": "Administrator",
|
||||||
"search_index": 0,
|
"module": "Shopping Cart",
|
||||||
"set_only_once": 0,
|
"name": "Shopping Cart Settings",
|
||||||
"translatable": 0,
|
"owner": "Administrator",
|
||||||
"unique": 0
|
"permissions": [
|
||||||
},
|
{
|
||||||
{
|
"create": 1,
|
||||||
"allow_bulk_edit": 0,
|
"email": 1,
|
||||||
"allow_in_quick_entry": 0,
|
"print": 1,
|
||||||
"allow_on_submit": 0,
|
"read": 1,
|
||||||
"bold": 0,
|
"role": "Website Manager",
|
||||||
"collapsible": 0,
|
"share": 1,
|
||||||
"columns": 0,
|
"write": 1
|
||||||
"fieldname": "show_configure_button",
|
}
|
||||||
"fieldtype": "Check",
|
],
|
||||||
"hidden": 0,
|
"sort_field": "modified",
|
||||||
"ignore_user_permissions": 0,
|
"sort_order": "ASC"
|
||||||
"ignore_xss_filter": 0,
|
}
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Show Configure Button",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "show_contact_us_button",
|
|
||||||
"fieldtype": "Check",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Show Contact Us Button",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"depends_on": "show_stock_availability",
|
|
||||||
"fieldname": "show_quantity_in_website",
|
|
||||||
"fieldtype": "Check",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Show Stock Quantity",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"depends_on": "",
|
|
||||||
"fetch_if_empty": 0,
|
|
||||||
"fieldname": "show_apply_coupon_code_in_website",
|
|
||||||
"fieldtype": "Check",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Show Apply Coupon Code",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fetch_if_empty": 0,
|
|
||||||
"fieldname": "allow_items_not_in_stock",
|
|
||||||
"fieldtype": "Check",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Allow items not in stock to be added to cart",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"depends_on": "enabled",
|
|
||||||
"fieldname": "section_break_2",
|
|
||||||
"fieldtype": "Section Break",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"depends_on": "",
|
|
||||||
"fieldname": "company",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 1,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Company",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Company",
|
|
||||||
"permlevel": 0,
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 1,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 1,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"description": "Prices will not be shown if Price List is not set",
|
|
||||||
"fieldname": "price_list",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Price List",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Price List",
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "column_break_4",
|
|
||||||
"fieldtype": "Column Break",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"description": "",
|
|
||||||
"fieldname": "default_customer_group",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 1,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Default Customer Group",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Customer Group",
|
|
||||||
"permlevel": 0,
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 1,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "quotation_series",
|
|
||||||
"fieldtype": "Select",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Quotation Series",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 1,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 1,
|
|
||||||
"collapsible_depends_on": "eval:doc.enable_checkout",
|
|
||||||
"columns": 0,
|
|
||||||
"depends_on": "enabled",
|
|
||||||
"fieldname": "section_break_8",
|
|
||||||
"fieldtype": "Section Break",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Checkout Settings",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"collapsible_depends_on": "",
|
|
||||||
"columns": 0,
|
|
||||||
"depends_on": "",
|
|
||||||
"fieldname": "enable_checkout",
|
|
||||||
"fieldtype": "Check",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Enable Checkout",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"default": "Orders",
|
|
||||||
"description": "After payment completion redirect user to selected page.",
|
|
||||||
"fieldname": "payment_success_url",
|
|
||||||
"fieldtype": "Select",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Payment Success Url",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "\nOrders\nInvoices\nMy Account",
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "column_break_11",
|
|
||||||
"fieldtype": "Column Break",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_bulk_edit": 0,
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"columns": 0,
|
|
||||||
"fieldname": "payment_gateway_account",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"hidden": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"label": "Payment Gateway Account",
|
|
||||||
"length": 0,
|
|
||||||
"no_copy": 0,
|
|
||||||
"options": "Payment Gateway Account",
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"remember_last_selected_value": 0,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"set_only_once": 0,
|
|
||||||
"translatable": 0,
|
|
||||||
"unique": 0
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"has_web_view": 0,
|
|
||||||
"hide_heading": 0,
|
|
||||||
"hide_toolbar": 0,
|
|
||||||
"icon": "fa fa-shopping-cart",
|
|
||||||
"idx": 1,
|
|
||||||
"image_view": 0,
|
|
||||||
"in_create": 0,
|
|
||||||
"is_submittable": 0,
|
|
||||||
"issingle": 1,
|
|
||||||
"istable": 0,
|
|
||||||
"max_attachments": 0,
|
|
||||||
"modified": "2019-10-14 13:54:24.575322",
|
|
||||||
"modified_by": "Administrator",
|
|
||||||
"module": "Shopping Cart",
|
|
||||||
"name": "Shopping Cart Settings",
|
|
||||||
"owner": "Administrator",
|
|
||||||
"permissions": [
|
|
||||||
{
|
|
||||||
"amend": 0,
|
|
||||||
"cancel": 0,
|
|
||||||
"create": 1,
|
|
||||||
"delete": 0,
|
|
||||||
"email": 1,
|
|
||||||
"export": 0,
|
|
||||||
"if_owner": 0,
|
|
||||||
"import": 0,
|
|
||||||
"permlevel": 0,
|
|
||||||
"print": 1,
|
|
||||||
"read": 1,
|
|
||||||
"report": 0,
|
|
||||||
"role": "Website Manager",
|
|
||||||
"set_user_permissions": 0,
|
|
||||||
"share": 1,
|
|
||||||
"submit": 0,
|
|
||||||
"write": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"quick_entry": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"read_only_onload": 0,
|
|
||||||
"show_name_in_global_search": 0,
|
|
||||||
"sort_order": "ASC",
|
|
||||||
"track_changes": 0,
|
|
||||||
"track_seen": 0,
|
|
||||||
"track_views": 0
|
|
||||||
}
|
|
@ -80,6 +80,7 @@ def get_shopping_cart_settings():
|
|||||||
|
|
||||||
return frappe.local.shopping_cart_settings
|
return frappe.local.shopping_cart_settings
|
||||||
|
|
||||||
|
@frappe.whitelist(allow_guest=True)
|
||||||
def is_cart_enabled():
|
def is_cart_enabled():
|
||||||
return get_shopping_cart_settings().enabled
|
return get_shopping_cart_settings().enabled
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
{% set cart_settings = shopping_cart.cart_settings %}
|
{% set cart_settings = shopping_cart.cart_settings %}
|
||||||
|
|
||||||
<div class="mt-3">
|
<div class="mt-3">
|
||||||
{% if cart_settings.show_configure_button | int %}
|
{% if cart_settings.enable_variants | int %}
|
||||||
<button class="btn btn-primary btn-configure"
|
<button class="btn btn-primary btn-configure"
|
||||||
data-item-code="{{ doc.name }}"
|
data-item-code="{{ doc.name }}"
|
||||||
data-item-name="{{ doc.item_name }}"
|
data-item-name="{{ doc.item_name }}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user