├── ._.DS_Store ├── ._go1_webshop.png ├── README.md ├── go1_webshop.png ├── go1_webshop ├── ._.DS_Store ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-311.pyc │ └── hooks.cpython-311.pyc ├── config │ └── __init__.py ├── fixtures │ └── custom_field.json ├── go1_webshop │ ├── ._.DS_Store │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-311.pyc │ │ ├── after_install.cpython-311.pyc │ │ ├── api.cpython-311.pyc │ │ └── query.cpython-311.pyc │ ├── after_install.py │ ├── api.py │ ├── custom │ │ ├── builder_client_script.json │ │ ├── builder_component.json │ │ ├── builder_page.json │ │ ├── builder_settings.json │ │ ├── file.json │ │ ├── item.json │ │ ├── item_barcode.json │ │ ├── item_group.json │ │ ├── item_price.json │ │ ├── mobile_menu.json │ │ ├── website_item.json │ │ ├── website_slideshow.json │ │ └── website_slideshow_item.json │ ├── default_pages │ │ ├── builder_client_scripts.json │ │ ├── builder_components.json │ │ └── builder_pages.json │ ├── doctype │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ └── __init__.cpython-311.pyc │ │ ├── erp_settings │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-311.pyc │ │ │ │ └── erp_settings.cpython-311.pyc │ │ │ ├── erp_settings.js │ │ │ ├── erp_settings.json │ │ │ ├── erp_settings.py │ │ │ └── test_erp_settings.py │ │ ├── go1_webshop_settings │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-311.pyc │ │ │ │ └── go1_webshop_settings.cpython-311.pyc │ │ │ ├── go1_webshop_settings.js │ │ │ ├── go1_webshop_settings.json │ │ │ ├── go1_webshop_settings.py │ │ │ └── test_go1_webshop_settings.py │ │ ├── go1_webshop_theme │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-311.pyc │ │ │ │ └── go1_webshop_theme.cpython-311.pyc │ │ │ ├── go1_webshop_theme.js │ │ │ ├── go1_webshop_theme.json │ │ │ ├── go1_webshop_theme.py │ │ │ └── test_go1_webshop_theme.py │ │ ├── go1_webshop_theme_settings │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-311.pyc │ │ │ │ └── go1_webshop_theme_settings.cpython-311.pyc │ │ │ ├── go1_webshop_theme_settings.js │ │ │ ├── go1_webshop_theme_settings.json │ │ │ ├── go1_webshop_theme_settings.py │ │ │ └── test_go1_webshop_theme_settings.py │ │ ├── mobile_menu │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-311.pyc │ │ │ │ └── mobile_menu.cpython-311.pyc │ │ │ ├── mobile_menu.js │ │ │ ├── mobile_menu.json │ │ │ ├── mobile_menu.py │ │ │ └── test_mobile_menu.py │ │ ├── override_doctype │ │ │ ├── __pycache__ │ │ │ │ └── builder_page.cpython-311.pyc │ │ │ └── builder_page.py │ │ └── theme_category_details │ │ │ ├── __init__.py │ │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-311.pyc │ │ │ ├── category_details.cpython-311.pyc │ │ │ └── theme_category_details.cpython-311.pyc │ │ │ ├── theme_category_details.json │ │ │ └── theme_category_details.py │ ├── favicon.ico │ ├── go1_webshop_files.zip │ ├── jquery.min.js │ ├── query.py │ ├── themes │ │ ├── fashion_theme │ │ │ └── theme.css │ │ └── furniture_theme │ │ │ └── theme.css │ └── workspace │ │ └── go1_webshop │ │ └── go1_webshop.json ├── hooks.py ├── modules.txt ├── patches.txt ├── public │ ├── .gitkeep │ ├── images │ │ └── User Profile.png │ └── root.css ├── templates │ ├── __init__.py │ ├── js │ │ └── custom_html_block.json │ └── pages │ │ └── __init__.py └── www │ └── __init__.py ├── license.txt └── pyproject.toml /._.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/._.DS_Store -------------------------------------------------------------------------------- /._go1_webshop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/._go1_webshop.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Go1 Webshop 2 | 3 | Go1 Webshop is an Open Source eCommerce portal built on frappe builder. 4 | 5 | ![Go1 Webshop](go1_webshop.png) 6 | 7 | ## Installation 8 | 1. [Install bench](https://github.com/frappe/bench). 9 | 2. [Install ERPNext](https://github.com/frappe/bench#installation). 10 | 3. [Install Webshop](https://github.com/frappe/webshop#installation). 11 | 4. [Install Builder](https://github.com/frappe/builder#installation). 12 | 5. Once Builder is installed, add the Go1 Webshop app to your bench by running 13 | 14 | ```sh 15 | $ bench get-app https://github.com/TridotsTech/Go1-Webshop 16 | ``` 17 | 6. Then you have to install the Go1 Webshop app on the required site by running 18 | ```sh 19 | $ bench --site sitename install-app go1_webshop 20 | ``` 21 | 7. Enable the server by running 22 | 23 | ```sh 24 | $ bench set-config -g server_script_enabled 1 25 | ``` 26 | 27 | #### Go1 Webshop Ecommerce Portal Pages 28 | 29 | To get Go1 Webshop ecommerce portal pages follow the following steps 30 | 31 | 1. Go to Go1 Webshop Settings 32 | 2. In Settings, you have an option import pages.By clicking Import Pages button you will have the ecommerce pages with sample data. 33 | 3. After importing the pages , need to execute command for restting the routes 34 | ```sh 35 | $ bench --site sitename clear-cache 36 | ``` -------------------------------------------------------------------------------- /go1_webshop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop.png -------------------------------------------------------------------------------- /go1_webshop/._.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/._.DS_Store -------------------------------------------------------------------------------- /go1_webshop/__init__.py: -------------------------------------------------------------------------------- 1 | __version__ = "0.0.1" 2 | -------------------------------------------------------------------------------- /go1_webshop/__pycache__/__init__.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/__pycache__/__init__.cpython-311.pyc -------------------------------------------------------------------------------- /go1_webshop/__pycache__/hooks.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/__pycache__/hooks.cpython-311.pyc -------------------------------------------------------------------------------- /go1_webshop/config/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/config/__init__.py -------------------------------------------------------------------------------- /go1_webshop/fixtures/custom_field.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Builder Settings-custom_server_script", 4 | "owner": "Administrator", 5 | "creation": "2024-06-27 11:51:52.163278", 6 | "modified": "2024-06-27 11:51:52.163278", 7 | "modified_by": "Administrator", 8 | "docstatus": 0, 9 | "idx": 3, 10 | "is_system_generated": 0, 11 | "dt": "Builder Settings", 12 | "label": "Server Script", 13 | "fieldname": "custom_server_script", 14 | "insert_after": "style", 15 | "length": 0, 16 | "fieldtype": "Code", 17 | "precision": "", 18 | "hide_seconds": 0, 19 | "hide_days": 0, 20 | "sort_options": 0, 21 | "fetch_if_empty": 0, 22 | "collapsible": 0, 23 | "non_negative": 0, 24 | "reqd": 0, 25 | "unique": 0, 26 | "is_virtual": 0, 27 | "read_only": 0, 28 | "ignore_user_permissions": 0, 29 | "hidden": 0, 30 | "print_hide": 0, 31 | "print_hide_if_no_value": 0, 32 | "no_copy": 0, 33 | "allow_on_submit": 0, 34 | "in_list_view": 0, 35 | "in_standard_filter": 0, 36 | "in_global_search": 0, 37 | "in_preview": 0, 38 | "bold": 0, 39 | "report_hide": 0, 40 | "search_index": 0, 41 | "allow_in_quick_entry": 0, 42 | "ignore_xss_filter": 0, 43 | "translatable": 0, 44 | "hide_border": 0, 45 | "show_dashboard": 0, 46 | "permlevel": 0, 47 | "columns": 0, 48 | "doctype": "Custom Field" 49 | } 50 | ] -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/._.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/go1_webshop/._.DS_Store -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/go1_webshop/__init__.py -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/__pycache__/__init__.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/go1_webshop/__pycache__/__init__.cpython-311.pyc -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/__pycache__/after_install.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/go1_webshop/__pycache__/after_install.cpython-311.pyc -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/__pycache__/api.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/go1_webshop/__pycache__/api.cpython-311.pyc -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/__pycache__/query.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/go1_webshop/__pycache__/query.cpython-311.pyc -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/api.py: -------------------------------------------------------------------------------- 1 | from frappe import _ 2 | import frappe 3 | import json 4 | import requests 5 | from frappe import _ 6 | from webshop.webshop.product_data_engine.filters import ProductFiltersBuilder 7 | from frappe.utils import cint 8 | from go1_webshop.go1_webshop.query import ProductQuery 9 | from webshop.webshop.doctype.override_doctype.item_group import get_child_groups_for_website 10 | 11 | def currency(amount): 12 | return "rs"+amount 13 | 14 | @frappe.whitelist() 15 | def logout_customer(): 16 | frappe.local.cookie_manager.delete_cookie('sid') 17 | frappe.local.cookie_manager.delete_cookie('user_id') 18 | return {"status":"Success"} 19 | 20 | def update_website_context(context): 21 | # context.favicon = "/assets/go1_builder/go1_builder/gf-favicon.png" 22 | return "" 23 | 24 | @frappe.whitelist() 25 | def insert_new_address(doc): 26 | if frappe.db.exists("Address",doc["name"]): 27 | address = frappe.get_doc("Address",doc["name"]).update(doc) 28 | address.save(ignore_permissions = True) 29 | frappe.db.commit() 30 | return address 31 | else: 32 | address = frappe.new_doc("Address").update(doc) 33 | address.insert(ignore_permissions = True) 34 | return address 35 | 36 | 37 | @frappe.whitelist() 38 | def get_address_data(doc): 39 | return frappe.get_doc("Address",doc) 40 | 41 | @frappe.whitelist() 42 | def delete_address_data(doc): 43 | try: 44 | address = frappe.get_doc("Address",doc) 45 | address.delete(ignore_permissions = True) 46 | return "Successfully Deleted" 47 | except frappe.exceptions.LinkExistsError: 48 | if frappe.db.exists("Quotation",{"customer_address",doc}): 49 | quo_doc = frappe.get_doc("Quotation",{"customer_address",doc}) 50 | return f"Cannot delete address linked with Quotation {quo_doc.name}" 51 | if frappe.db.exists("Sales Order",{"customer_address",doc}): 52 | so_doc = frappe.get_doc("Sales Order",{"customer_address",doc}) 53 | return f"Cannot delete address linked with Sales Order {so_doc.name}" 54 | 55 | 56 | 57 | @frappe.whitelist(allow_guest=True) 58 | def get_user(doc): 59 | user_list = frappe.db.get_all('User', doc, filters={'email':frappe.session.user}) 60 | return user_list 61 | 62 | @frappe.whitelist(allow_guest=True) 63 | def check_items_quantity(items): 64 | try: 65 | from go1_webshop.go1_webshop.doctype.erp_settings.erp_settings import get_item_price_list 66 | if items and len(items) == 0: 67 | return 'Success' 68 | elif items and len(items) > 0: 69 | for item in items: 70 | item_info = get_item_price_list(item.get("item_code")) 71 | if item_info and item_info.get("product_info").get("stock_qty") <= item.get('qty'): 72 | frappe.response.error_message = f"There Is No Stock Available For {item.get('item_name')}" 73 | return 'Failed' 74 | return 'Success' 75 | except Exception: 76 | frappe.log_error(title="go1_webshop.go1_webshop.api.check_items_quantity",message="") 77 | 78 | @frappe.whitelist(allow_guest=True) 79 | def update_user(doc): 80 | frappe.log_error("doc['last_Name']",doc["last_Name"]) 81 | frappe.db.set_value('User', frappe.session.user,"last_name", doc["last_Name"]) 82 | frappe.db.commit() 83 | 84 | @frappe.whitelist(allow_guest=True) 85 | def insert_doc(**data): 86 | try: 87 | user = "" 88 | if data.get('data').get('doctype') == "Comment": 89 | user = frappe.session.user 90 | data['data']['comment_by'] = user 91 | if data: 92 | insert_doc = frappe.get_doc({"doctype": data.get('data').get('doctype')}) 93 | insert_doc.update(data.get('data')) 94 | value = insert_doc.insert(ignore_permissions=True) 95 | frappe.db.commit() 96 | return value 97 | except Exception as e: 98 | frappe.log_error("Error inserting document: " + str(e)) 99 | return None 100 | 101 | @frappe.whitelist(allow_guest=True) 102 | def check_user_exists(email, password): 103 | try: 104 | user_exists = frappe.db.exists("User", {"email": email, "password": password}) 105 | return {"exists": user_exists} 106 | except Exception as e: 107 | frappe.log_error("Error checking user existence: {0}".format(str(e))) 108 | return {"error": "An error occurred while checking user existence"} 109 | 110 | @frappe.whitelist(allow_guest=True) 111 | def get_list(doctype,fields=["name"],filters=None,page_no=1,page_size=20,order_by="creation desc",child_fields=None): 112 | limit_start = ((int(page_no) - 1) * int(page_size)) 113 | try: 114 | list_items = frappe.get_all(doctype, 115 | filters=filters, 116 | fields=fields, 117 | order_by=order_by, 118 | start=limit_start, 119 | page_length=page_size, 120 | ) 121 | if child_fields and len(child_fields): 122 | for item in list_items: 123 | for child in child_fields: 124 | condition = "parent = '"+item.name+"'" 125 | query = """ SELECT name 126 | FROM `tab{child}` T 127 | WHERE {condition} order by T.creation DESC""".format(condition=condition, 128 | child=child) 129 | child_field_name = child.casefold().replace(" ", "_") 130 | item[child_field_name] = frappe.db.sql(query,as_dict=1) 131 | frappe.response.message = list_items 132 | return list_items 133 | except: 134 | frappe.log_error("go1_webshop.api.get_list",frappe.get_traceback()) 135 | 136 | 137 | @frappe.whitelist(allow_guest=True) 138 | def get_product_filter_data(query_args=None): 139 | """ 140 | Returns filtered products and discount filters. 141 | 142 | Args: 143 | query_args (dict): contains filters to get products list 144 | 145 | Query Args filters: 146 | search (str): Search Term. 147 | field_filters (dict): Keys include item_group, brand, etc. 148 | attribute_filters(dict): Keys include Color, Size, etc. 149 | start (int): Offset items by 150 | item_group (str): Valid Item Group 151 | from_filters (bool): Set as True to jump to page 1 152 | """ 153 | if isinstance(query_args, str): 154 | query_args = json.loads(query_args) 155 | 156 | query_args = frappe._dict(query_args) 157 | 158 | if query_args: 159 | search = query_args.get("search") 160 | field_filters = query_args.get("field_filters", {}) 161 | attribute_filters = query_args.get("attribute_filters", {}) 162 | start = cint(query_args.start) if query_args.get("start") else 0 163 | item_group = query_args.get("item_group") 164 | from_filters = query_args.get("from_filters") 165 | sort_by = query_args.get("sort_by") if query_args.get("sort_by") else None 166 | else: 167 | search, attribute_filters, item_group, from_filters = None, None, None, None 168 | field_filters = {} 169 | start = 0 170 | 171 | # if new filter is checked, reset start to show filtered items from page 1 172 | if from_filters: 173 | start = 0 174 | 175 | sub_categories = [] 176 | if item_group: 177 | sub_categories = get_child_groups_for_website(item_group, immediate=True) 178 | 179 | engine = ProductQuery() 180 | 181 | try: 182 | result = engine.query( 183 | attribute_filters, 184 | field_filters, 185 | search_term=search, 186 | start=start, 187 | item_group=item_group, 188 | sort_by=sort_by 189 | ) 190 | frappe.log_error("result",result) 191 | 192 | except Exception: 193 | frappe.log_error("Product query with filter failed") 194 | return {"exc": "Something went wrong!"} 195 | 196 | # discount filter data 197 | filters = {} 198 | discounts = result["discounts"] 199 | 200 | if discounts: 201 | filter_engine = ProductFiltersBuilder() 202 | filters["discount_filters"] = filter_engine.get_discount_filters(discounts) 203 | 204 | return { 205 | "items": result["items"] or [], 206 | "filters": filters, 207 | "settings": engine.settings, 208 | "sub_categories": sub_categories, 209 | "items_count": result["items_count"], 210 | } 211 | 212 | 213 | @frappe.whitelist(allow_guest=True) 214 | def get_guest_redirect_on_action(): 215 | return frappe.db.get_single_value("Webshop Settings", "redirect_on_action") 216 | 217 | 218 | @frappe.whitelist() 219 | def update_global_script(doc,method): 220 | global_script = frappe.get_value("Builder Settings","Builder Settings","custom_server_script") 221 | if global_script and doc.is_go1_webshop_item: 222 | if doc.page_data_script: 223 | if"\n# End Global Script\n" not in doc.page_data_script: 224 | doc.db_set('page_data_script',"\n# Start Global Script\n"+ global_script + "\n# End Global Script\n"+ doc.page_data_script) 225 | else: 226 | doc.db_set('page_data_script',"\n# Start Global Script\n"+global_script + "\n# End Global Script\n") 227 | frappe.db.commit() 228 | 229 | 230 | @frappe.whitelist() 231 | def update_global_script_builder_page(doc,method): 232 | old_doc = doc.get_doc_before_save() 233 | # global_script = frappe.get_value("Builder Settings","Builder Settings","custom_server_script") 234 | pages = frappe.db.get_all("Builder Page",pluck="name") 235 | for i in pages: 236 | page = frappe.get_doc("Builder Page",i) 237 | if doc.custom_server_script and page.is_go1_webshop_item: 238 | if page.page_data_script: 239 | if "\n# End Global Script\n" not in page.page_data_script: 240 | page.db_set('page_data_script',"\n# Start Global Script\n"+ doc.custom_server_script + "\n# End Global Script\n"+ page.page_data_script) 241 | else: 242 | parts = page.page_data_script.split("\n# End Global Script\n") 243 | page.db_set('page_data_script',"\n# Start Global Script\n"+ doc.custom_server_script + "\n# End Global Script\n"+ parts[1]) 244 | else: 245 | page.db_set('page_data_script',"\n# Start Global Script\n"+doc.custom_server_script + "\n# End Global Script\n") 246 | frappe.db.commit() 247 | 248 | 249 | @frappe.whitelist() 250 | def insert_theme_register(full_name = None, email = None, phone = None, password = None): 251 | payload = { 252 | "full_name": full_name, 253 | "email": email, 254 | "phone":phone, 255 | "password":password 256 | } 257 | from go1_webshop.go1_webshop.doctype.erp_settings.erp_settings import get_external_url_details 258 | external_url_details = get_external_url_details("api", "insert_go1_theme_registration") 259 | frappe.log_error("external_url_details",external_url_details) 260 | try: 261 | response = requests.post( 262 | external_url_details.get("external_url"), 263 | headers = external_url_details.get("headers"), 264 | data = json.dumps(payload) 265 | ) 266 | response.raise_for_status() 267 | themes = response.json() 268 | if themes and themes.get("message"): 269 | output = themes.get("message") 270 | frappe.log_error("output", output) 271 | if output.get("api_key") and output.get("api_secret"): 272 | go1_theme_settings = frappe.get_doc("Go1 Webshop Theme Settings") 273 | go1_theme_settings.api_key = output.get("api_key") 274 | go1_theme_settings.api_secret = output.get("api_secret") 275 | go1_theme_settings.save(ignore_permissions = True) 276 | return "Success" 277 | except: 278 | frappe.log_error("Error in api.insert_theme_register", frappe.get_traceback()) 279 | 280 | @frappe.whitelist() 281 | def login_theme_registration(email = None, password = None): 282 | payload = { 283 | "usr": email, 284 | "pwd":password 285 | } 286 | from go1_webshop.go1_webshop.doctype.erp_settings.erp_settings import get_external_url_details 287 | external_url_details = get_external_url_details("api", "login_go1_theme_registration") 288 | frappe.log_error("external_url_details",external_url_details) 289 | try: 290 | response = requests.post( 291 | external_url_details.get("external_url"), 292 | headers = external_url_details.get("headers"), 293 | data = json.dumps(payload) 294 | ) 295 | response.raise_for_status() 296 | themes = response.json() 297 | if themes and themes.get("message"): 298 | output = themes.get("message") 299 | frappe.log_error("output", output) 300 | if output.get("status") == "Success": 301 | if output.get("message")["api_key"] and output.get("message")["api_secret"]: 302 | go1_theme_settings = frappe.get_doc("Go1 Webshop Theme Settings") 303 | go1_theme_settings.api_key = output.get("message")["api_key"] 304 | go1_theme_settings.api_secret = output.get("message")["api_secret"] 305 | go1_theme_settings.save(ignore_permissions = True) 306 | return output.get("status") 307 | except: 308 | frappe.log_error("Error in api.insert_theme_register", frappe.get_traceback()) 309 | 310 | 311 | @frappe.whitelist() 312 | def update_website_item_route(doc,method): 313 | if doc.route: 314 | doc.route = doc.route.replace("/","-") -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/custom/builder_client_script.json: -------------------------------------------------------------------------------- 1 | { 2 | "custom_fields": [ 3 | { 4 | "_assign": null, 5 | "_comments": null, 6 | "_liked_by": null, 7 | "_user_tags": null, 8 | "allow_in_quick_entry": 0, 9 | "allow_on_submit": 0, 10 | "bold": 0, 11 | "collapsible": 0, 12 | "collapsible_depends_on": null, 13 | "columns": 0, 14 | "creation": "2024-07-31 20:37:29.774459", 15 | "default": null, 16 | "depends_on": null, 17 | "description": null, 18 | "docstatus": 0, 19 | "dt": "Builder Client Script", 20 | "fetch_from": null, 21 | "fetch_if_empty": 0, 22 | "fieldname": "is_go1_webshop_item", 23 | "fieldtype": "Check", 24 | "hidden": 1, 25 | "hide_border": 0, 26 | "hide_days": 0, 27 | "hide_seconds": 0, 28 | "idx": 0, 29 | "ignore_user_permissions": 0, 30 | "ignore_xss_filter": 0, 31 | "in_global_search": 0, 32 | "in_list_view": 0, 33 | "in_preview": 0, 34 | "in_standard_filter": 0, 35 | "insert_after": null, 36 | "is_system_generated": 0, 37 | "is_virtual": 0, 38 | "label": "Is Go1 Webshop Item", 39 | "length": 0, 40 | "link_filters": null, 41 | "mandatory_depends_on": null, 42 | "modified": "2024-07-31 20:37:39.520091", 43 | "modified_by": "Administrator", 44 | "module": "Go1 Webshop", 45 | "name": "Builder Client Script-custom_is_go1_webshop_item", 46 | "no_copy": 0, 47 | "non_negative": 0, 48 | "options": null, 49 | "owner": "Administrator", 50 | "permlevel": 0, 51 | "precision": "", 52 | "print_hide": 0, 53 | "print_hide_if_no_value": 0, 54 | "print_width": null, 55 | "read_only": 0, 56 | "read_only_depends_on": null, 57 | "report_hide": 0, 58 | "reqd": 0, 59 | "search_index": 0, 60 | "show_dashboard": 0, 61 | "sort_options": 0, 62 | "translatable": 0, 63 | "unique": 0, 64 | "width": null 65 | } 66 | ], 67 | "custom_perms": [], 68 | "doctype": "Builder Client Script", 69 | "links": [ 70 | { 71 | "creation": "2023-11-20 09:10:55.441174", 72 | "custom": 0, 73 | "docstatus": 0, 74 | "group": null, 75 | "hidden": 0, 76 | "idx": 1, 77 | "is_child_table": 0, 78 | "link_doctype": "Builder Page", 79 | "link_fieldname": "builder_script", 80 | "modified": "2024-06-26 17:08:00.692219", 81 | "modified_by": "Administrator", 82 | "name": "fpvms8djsj", 83 | "owner": "Administrator", 84 | "parent": "Builder Client Script", 85 | "parent_doctype": null, 86 | "parentfield": "links", 87 | "parenttype": "DocType", 88 | "table_fieldname": "client_scripts" 89 | } 90 | ], 91 | "property_setters": [], 92 | "sync_on_migrate": 1 93 | } -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/custom/builder_component.json: -------------------------------------------------------------------------------- 1 | { 2 | "custom_fields": [ 3 | { 4 | "_assign": null, 5 | "_comments": null, 6 | "_liked_by": null, 7 | "_user_tags": null, 8 | "allow_in_quick_entry": 0, 9 | "allow_on_submit": 0, 10 | "bold": 0, 11 | "collapsible": 0, 12 | "collapsible_depends_on": null, 13 | "columns": 0, 14 | "creation": "2024-07-31 20:24:49.546103", 15 | "default": null, 16 | "depends_on": null, 17 | "description": null, 18 | "docstatus": 0, 19 | "dt": "Builder Component", 20 | "fetch_from": null, 21 | "fetch_if_empty": 0, 22 | "fieldname": "is_go1_webshop_item", 23 | "fieldtype": "Check", 24 | "hidden": 1, 25 | "hide_border": 0, 26 | "hide_days": 0, 27 | "hide_seconds": 0, 28 | "idx": 4, 29 | "ignore_user_permissions": 0, 30 | "ignore_xss_filter": 0, 31 | "in_global_search": 0, 32 | "in_list_view": 0, 33 | "in_preview": 0, 34 | "in_standard_filter": 0, 35 | "insert_after": "component_id", 36 | "is_system_generated": 0, 37 | "is_virtual": 0, 38 | "label": "Is Go1 Webshop Item", 39 | "length": 0, 40 | "link_filters": null, 41 | "mandatory_depends_on": null, 42 | "modified": "2024-07-31 20:24:56.821547", 43 | "modified_by": "Administrator", 44 | "module": "Go1 Webshop", 45 | "name": "Builder Component-custom_is_go1_webshop_item", 46 | "no_copy": 0, 47 | "non_negative": 0, 48 | "options": null, 49 | "owner": "Administrator", 50 | "permlevel": 0, 51 | "precision": "", 52 | "print_hide": 0, 53 | "print_hide_if_no_value": 0, 54 | "print_width": null, 55 | "read_only": 0, 56 | "read_only_depends_on": null, 57 | "report_hide": 0, 58 | "reqd": 0, 59 | "search_index": 0, 60 | "show_dashboard": 0, 61 | "sort_options": 0, 62 | "translatable": 0, 63 | "unique": 0, 64 | "width": null 65 | } 66 | ], 67 | "custom_perms": [], 68 | "doctype": "Builder Component", 69 | "links": [], 70 | "property_setters": [], 71 | "sync_on_migrate": 1 72 | } -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/custom/builder_page.json: -------------------------------------------------------------------------------- 1 | { 2 | "custom_fields": [ 3 | { 4 | "_assign": null, 5 | "_comments": null, 6 | "_liked_by": null, 7 | "_user_tags": null, 8 | "allow_in_quick_entry": 0, 9 | "allow_on_submit": 0, 10 | "bold": 0, 11 | "collapsible": 0, 12 | "collapsible_depends_on": null, 13 | "columns": 0, 14 | "creation": "2024-07-31 20:20:27.951535", 15 | "default": null, 16 | "depends_on": null, 17 | "description": null, 18 | "docstatus": 0, 19 | "dt": "Builder Page", 20 | "fetch_from": null, 21 | "fetch_if_empty": 0, 22 | "fieldname": "is_go1_webshop_item", 23 | "fieldtype": "Check", 24 | "hidden": 1, 25 | "hide_border": 0, 26 | "hide_days": 0, 27 | "hide_seconds": 0, 28 | "idx": 18, 29 | "ignore_user_permissions": 0, 30 | "ignore_xss_filter": 0, 31 | "in_global_search": 0, 32 | "in_list_view": 0, 33 | "in_preview": 0, 34 | "in_standard_filter": 0, 35 | "insert_after": "meta_image", 36 | "is_system_generated": 0, 37 | "is_virtual": 0, 38 | "label": "Is Go1 Webshop Item", 39 | "length": 0, 40 | "link_filters": null, 41 | "mandatory_depends_on": null, 42 | "modified": "2024-07-31 20:20:41.660835", 43 | "modified_by": "Administrator", 44 | "module": "Go1 Webshop", 45 | "name": "Builder Page-custom_is_go1_webshop_item", 46 | "no_copy": 0, 47 | "non_negative": 0, 48 | "options": null, 49 | "owner": "Administrator", 50 | "permlevel": 0, 51 | "precision": "", 52 | "print_hide": 0, 53 | "print_hide_if_no_value": 0, 54 | "print_width": null, 55 | "read_only": 0, 56 | "read_only_depends_on": null, 57 | "report_hide": 0, 58 | "reqd": 0, 59 | "search_index": 0, 60 | "show_dashboard": 0, 61 | "sort_options": 0, 62 | "translatable": 0, 63 | "unique": 0, 64 | "width": null 65 | } 66 | ], 67 | "custom_perms": [], 68 | "doctype": "Builder Page", 69 | "links": [], 70 | "property_setters": [], 71 | "sync_on_migrate": 1 72 | } -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/custom/builder_settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "custom_fields": [ 3 | { 4 | "_assign": null, 5 | "_comments": null, 6 | "_liked_by": null, 7 | "_user_tags": null, 8 | "allow_in_quick_entry": 0, 9 | "allow_on_submit": 0, 10 | "bold": 0, 11 | "collapsible": 0, 12 | "collapsible_depends_on": null, 13 | "columns": 0, 14 | "creation": "2024-06-27 11:51:52.163278", 15 | "default": null, 16 | "depends_on": null, 17 | "description": null, 18 | "docstatus": 0, 19 | "dt": "Builder Settings", 20 | "fetch_from": null, 21 | "fetch_if_empty": 0, 22 | "fieldname": "custom_server_script", 23 | "fieldtype": "Code", 24 | "hidden": 0, 25 | "hide_border": 0, 26 | "hide_days": 0, 27 | "hide_seconds": 0, 28 | "idx": 3, 29 | "ignore_user_permissions": 0, 30 | "ignore_xss_filter": 0, 31 | "in_global_search": 0, 32 | "in_list_view": 0, 33 | "in_preview": 0, 34 | "in_standard_filter": 0, 35 | "insert_after": "style", 36 | "is_system_generated": 0, 37 | "is_virtual": 0, 38 | "label": "Server Script", 39 | "length": 0, 40 | "link_filters": null, 41 | "mandatory_depends_on": null, 42 | "modified": "2024-06-27 11:51:52.163278", 43 | "modified_by": "Administrator", 44 | "module": null, 45 | "name": "Builder Settings-custom_server_script", 46 | "no_copy": 0, 47 | "non_negative": 0, 48 | "options": null, 49 | "owner": "Administrator", 50 | "permlevel": 0, 51 | "precision": "", 52 | "print_hide": 0, 53 | "print_hide_if_no_value": 0, 54 | "print_width": null, 55 | "read_only": 0, 56 | "read_only_depends_on": null, 57 | "report_hide": 0, 58 | "reqd": 0, 59 | "search_index": 0, 60 | "show_dashboard": 0, 61 | "sort_options": 0, 62 | "translatable": 0, 63 | "unique": 0, 64 | "width": null 65 | } 66 | ], 67 | "custom_perms": [], 68 | "doctype": "Builder Settings", 69 | "links": [], 70 | "property_setters": [], 71 | "sync_on_migrate": 1 72 | } -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/custom/file.json: -------------------------------------------------------------------------------- 1 | { 2 | "custom_fields": [ 3 | { 4 | "_assign": null, 5 | "_comments": null, 6 | "_liked_by": null, 7 | "_user_tags": null, 8 | "allow_in_quick_entry": 0, 9 | "allow_on_submit": 0, 10 | "bold": 0, 11 | "collapsible": 0, 12 | "collapsible_depends_on": null, 13 | "columns": 0, 14 | "creation": "2024-07-31 20:21:00.189160", 15 | "default": null, 16 | "depends_on": null, 17 | "description": null, 18 | "docstatus": 0, 19 | "dt": "File", 20 | "fetch_from": null, 21 | "fetch_if_empty": 0, 22 | "fieldname": "is_go1_webshop_item", 23 | "fieldtype": "Check", 24 | "hidden": 1, 25 | "hide_border": 0, 26 | "hide_days": 0, 27 | "hide_seconds": 0, 28 | "idx": 24, 29 | "ignore_user_permissions": 0, 30 | "ignore_xss_filter": 0, 31 | "in_global_search": 0, 32 | "in_list_view": 0, 33 | "in_preview": 0, 34 | "in_standard_filter": 0, 35 | "insert_after": "uploaded_to_google_drive", 36 | "is_system_generated": 0, 37 | "is_virtual": 0, 38 | "label": "Is Go1 Webshop Item", 39 | "length": 0, 40 | "link_filters": null, 41 | "mandatory_depends_on": null, 42 | "modified": "2024-07-31 20:21:15.374771", 43 | "modified_by": "Administrator", 44 | "module": "Go1 Webshop", 45 | "name": "File-custom_is_go1_webshop_item", 46 | "no_copy": 0, 47 | "non_negative": 0, 48 | "options": null, 49 | "owner": "Administrator", 50 | "permlevel": 0, 51 | "precision": "", 52 | "print_hide": 0, 53 | "print_hide_if_no_value": 0, 54 | "print_width": null, 55 | "read_only": 0, 56 | "read_only_depends_on": null, 57 | "report_hide": 0, 58 | "reqd": 0, 59 | "search_index": 0, 60 | "show_dashboard": 0, 61 | "sort_options": 0, 62 | "translatable": 0, 63 | "unique": 0, 64 | "width": null 65 | } 66 | ], 67 | "custom_perms": [], 68 | "doctype": "File", 69 | "links": [], 70 | "property_setters": [ 71 | { 72 | "_assign": null, 73 | "_comments": null, 74 | "_liked_by": null, 75 | "_user_tags": null, 76 | "creation": "2024-08-06 18:47:41.684475", 77 | "default_value": null, 78 | "doc_type": "File", 79 | "docstatus": 0, 80 | "doctype_or_field": "DocField", 81 | "field_name": "file_type", 82 | "idx": 0, 83 | "is_system_generated": 1, 84 | "modified": "2024-08-06 18:51:18.571025", 85 | "modified_by": "Administrator", 86 | "module": null, 87 | "name": "File-file_type-in_list_view", 88 | "owner": "Administrator", 89 | "property": "in_list_view", 90 | "property_type": "Check", 91 | "row_name": null, 92 | "value": "1" 93 | }, 94 | { 95 | "_assign": null, 96 | "_comments": null, 97 | "_liked_by": null, 98 | "_user_tags": null, 99 | "creation": "2024-08-06 18:47:41.632742", 100 | "default_value": null, 101 | "doc_type": "File", 102 | "docstatus": 0, 103 | "doctype_or_field": "DocField", 104 | "field_name": "file_size", 105 | "idx": 0, 106 | "is_system_generated": 1, 107 | "modified": "2024-08-06 18:51:18.542745", 108 | "modified_by": "Administrator", 109 | "module": null, 110 | "name": "File-file_size-in_list_view", 111 | "owner": "Administrator", 112 | "property": "in_list_view", 113 | "property_type": "Check", 114 | "row_name": null, 115 | "value": "1" 116 | }, 117 | { 118 | "_assign": null, 119 | "_comments": null, 120 | "_liked_by": null, 121 | "_user_tags": null, 122 | "creation": "2024-08-06 18:47:41.591561", 123 | "default_value": null, 124 | "doc_type": "File", 125 | "docstatus": 0, 126 | "doctype_or_field": "DocField", 127 | "field_name": "file_name", 128 | "idx": 0, 129 | "is_system_generated": 1, 130 | "modified": "2024-08-06 18:51:18.516145", 131 | "modified_by": "Administrator", 132 | "module": null, 133 | "name": "File-file_name-in_list_view", 134 | "owner": "Administrator", 135 | "property": "in_list_view", 136 | "property_type": "Check", 137 | "row_name": null, 138 | "value": "1" 139 | }, 140 | { 141 | "_assign": null, 142 | "_comments": null, 143 | "_liked_by": null, 144 | "_user_tags": null, 145 | "creation": "2024-08-06 18:47:41.693489", 146 | "default_value": null, 147 | "doc_type": "File", 148 | "docstatus": 0, 149 | "doctype_or_field": "DocField", 150 | "field_name": "file_url", 151 | "idx": 0, 152 | "is_system_generated": 1, 153 | "modified": "2024-08-06 18:51:18.448078", 154 | "modified_by": "Administrator", 155 | "module": null, 156 | "name": "File-file_url-in_list_view", 157 | "owner": "Administrator", 158 | "property": "in_list_view", 159 | "property_type": "Check", 160 | "row_name": null, 161 | "value": "0" 162 | } 163 | ], 164 | "sync_on_migrate": 1 165 | } -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/custom/item.json: -------------------------------------------------------------------------------- 1 | { 2 | "custom_fields": [ 3 | { 4 | "_assign": null, 5 | "_comments": null, 6 | "_liked_by": null, 7 | "_user_tags": null, 8 | "allow_in_quick_entry": 0, 9 | "allow_on_submit": 0, 10 | "bold": 0, 11 | "collapsible": 0, 12 | "collapsible_depends_on": null, 13 | "columns": 0, 14 | "creation": "2024-07-31 20:16:10.876851", 15 | "default": null, 16 | "depends_on": null, 17 | "description": null, 18 | "docstatus": 0, 19 | "dt": "Item", 20 | "fetch_from": null, 21 | "fetch_if_empty": 0, 22 | "fieldname": "is_go1_webshop_item", 23 | "fieldtype": "Check", 24 | "hidden": 1, 25 | "hide_border": 0, 26 | "hide_days": 0, 27 | "hide_seconds": 0, 28 | "idx": 20, 29 | "ignore_user_permissions": 0, 30 | "ignore_xss_filter": 0, 31 | "in_global_search": 0, 32 | "in_list_view": 0, 33 | "in_preview": 0, 34 | "in_standard_filter": 0, 35 | "insert_after": "asset_naming_series", 36 | "is_system_generated": 0, 37 | "is_virtual": 0, 38 | "label": "Is Go1 Webshop Item", 39 | "length": 0, 40 | "link_filters": null, 41 | "mandatory_depends_on": null, 42 | "modified": "2024-07-31 20:17:33.110180", 43 | "modified_by": "Administrator", 44 | "module": "Go1 Webshop", 45 | "name": "Item-custom_is_go1_webshop_item", 46 | "no_copy": 0, 47 | "non_negative": 0, 48 | "options": null, 49 | "owner": "Administrator", 50 | "permlevel": 0, 51 | "precision": "", 52 | "print_hide": 0, 53 | "print_hide_if_no_value": 0, 54 | "print_width": null, 55 | "read_only": 0, 56 | "read_only_depends_on": null, 57 | "report_hide": 0, 58 | "reqd": 0, 59 | "search_index": 0, 60 | "show_dashboard": 0, 61 | "sort_options": 0, 62 | "translatable": 0, 63 | "unique": 0, 64 | "width": null 65 | }, 66 | { 67 | "_assign": null, 68 | "_comments": null, 69 | "_liked_by": null, 70 | "_user_tags": null, 71 | "allow_in_quick_entry": 0, 72 | "allow_on_submit": 0, 73 | "bold": 0, 74 | "collapsible": 0, 75 | "collapsible_depends_on": null, 76 | "columns": 0, 77 | "creation": "2024-06-26 17:11:01.054014", 78 | "default": null, 79 | "depends_on": null, 80 | "description": null, 81 | "docstatus": 0, 82 | "dt": "Item", 83 | "fetch_from": null, 84 | "fetch_if_empty": 0, 85 | "fieldname": "is_ineligible_for_itc", 86 | "fieldtype": "Check", 87 | "hidden": 0, 88 | "hide_border": 0, 89 | "hide_days": 0, 90 | "hide_seconds": 0, 91 | "idx": 0, 92 | "ignore_user_permissions": 0, 93 | "ignore_xss_filter": 0, 94 | "in_global_search": 0, 95 | "in_list_view": 0, 96 | "in_preview": 0, 97 | "in_standard_filter": 0, 98 | "insert_after": "item_tax_section_break", 99 | "is_system_generated": 1, 100 | "is_virtual": 0, 101 | "label": "Is Ineligible for Input Tax Credit", 102 | "length": 0, 103 | "link_filters": null, 104 | "mandatory_depends_on": null, 105 | "modified": "2024-06-26 17:11:01.054014", 106 | "modified_by": "Administrator", 107 | "module": null, 108 | "name": "Item-is_ineligible_for_itc", 109 | "no_copy": 0, 110 | "non_negative": 0, 111 | "options": null, 112 | "owner": "Administrator", 113 | "permlevel": 0, 114 | "precision": "", 115 | "print_hide": 0, 116 | "print_hide_if_no_value": 0, 117 | "print_width": null, 118 | "read_only": 0, 119 | "read_only_depends_on": null, 120 | "report_hide": 0, 121 | "reqd": 0, 122 | "search_index": 0, 123 | "show_dashboard": 0, 124 | "sort_options": 0, 125 | "translatable": 0, 126 | "unique": 0, 127 | "width": null 128 | }, 129 | { 130 | "_assign": null, 131 | "_comments": null, 132 | "_liked_by": null, 133 | "_user_tags": null, 134 | "allow_in_quick_entry": 0, 135 | "allow_on_submit": 0, 136 | "bold": 0, 137 | "collapsible": 0, 138 | "collapsible_depends_on": null, 139 | "columns": 0, 140 | "creation": "2024-06-26 17:10:06.434791", 141 | "default": "0", 142 | "depends_on": "published_in_website", 143 | "description": null, 144 | "docstatus": 0, 145 | "dt": "Item", 146 | "fetch_from": null, 147 | "fetch_if_empty": 0, 148 | "fieldname": "published_in_website", 149 | "fieldtype": "Check", 150 | "hidden": 0, 151 | "hide_border": 0, 152 | "hide_days": 0, 153 | "hide_seconds": 0, 154 | "idx": 106, 155 | "ignore_user_permissions": 1, 156 | "ignore_xss_filter": 0, 157 | "in_global_search": 0, 158 | "in_list_view": 0, 159 | "in_preview": 0, 160 | "in_standard_filter": 0, 161 | "insert_after": "default_manufacturer_part_no", 162 | "is_system_generated": 1, 163 | "is_virtual": 0, 164 | "label": "Published In Website", 165 | "length": 0, 166 | "link_filters": null, 167 | "mandatory_depends_on": null, 168 | "modified": "2024-06-26 17:10:06.434791", 169 | "modified_by": "Administrator", 170 | "module": null, 171 | "name": "Item-published_in_website", 172 | "no_copy": 0, 173 | "non_negative": 0, 174 | "options": null, 175 | "owner": "Administrator", 176 | "permlevel": 0, 177 | "precision": "", 178 | "print_hide": 0, 179 | "print_hide_if_no_value": 0, 180 | "print_width": null, 181 | "read_only": 1, 182 | "read_only_depends_on": null, 183 | "report_hide": 0, 184 | "reqd": 0, 185 | "search_index": 0, 186 | "show_dashboard": 0, 187 | "sort_options": 0, 188 | "translatable": 0, 189 | "unique": 0, 190 | "width": null 191 | } 192 | ], 193 | "custom_perms": [], 194 | "doctype": "Item", 195 | "links": [], 196 | "property_setters": [ 197 | { 198 | "_assign": null, 199 | "_comments": null, 200 | "_liked_by": null, 201 | "_user_tags": null, 202 | "creation": "2024-06-26 17:34:50.736693", 203 | "default_value": null, 204 | "doc_type": "Item", 205 | "docstatus": 0, 206 | "doctype_or_field": "DocField", 207 | "field_name": "barcodes", 208 | "idx": 0, 209 | "is_system_generated": 1, 210 | "modified": "2024-06-26 17:34:50.736693", 211 | "modified_by": "Administrator", 212 | "module": null, 213 | "name": "Item-barcodes-hidden", 214 | "owner": "Administrator", 215 | "property": "hidden", 216 | "property_type": "Check", 217 | "row_name": null, 218 | "value": "0" 219 | }, 220 | { 221 | "_assign": null, 222 | "_comments": null, 223 | "_liked_by": null, 224 | "_user_tags": null, 225 | "creation": "2024-06-26 17:34:45.073777", 226 | "default_value": null, 227 | "doc_type": "Item", 228 | "docstatus": 0, 229 | "doctype_or_field": "DocField", 230 | "field_name": "item_code", 231 | "idx": 0, 232 | "is_system_generated": 0, 233 | "modified": "2024-06-26 17:34:45.073777", 234 | "modified_by": "Administrator", 235 | "module": null, 236 | "name": "Item-item_code-reqd", 237 | "owner": "Administrator", 238 | "property": "reqd", 239 | "property_type": "Check", 240 | "row_name": null, 241 | "value": "1" 242 | }, 243 | { 244 | "_assign": null, 245 | "_comments": null, 246 | "_liked_by": null, 247 | "_user_tags": null, 248 | "creation": "2024-06-26 17:34:45.052853", 249 | "default_value": null, 250 | "doc_type": "Item", 251 | "docstatus": 0, 252 | "doctype_or_field": "DocField", 253 | "field_name": "item_code", 254 | "idx": 0, 255 | "is_system_generated": 0, 256 | "modified": "2024-06-26 17:34:45.052853", 257 | "modified_by": "Administrator", 258 | "module": null, 259 | "name": "Item-item_code-hidden", 260 | "owner": "Administrator", 261 | "property": "hidden", 262 | "property_type": "Check", 263 | "row_name": null, 264 | "value": "0" 265 | }, 266 | { 267 | "_assign": null, 268 | "_comments": null, 269 | "_liked_by": null, 270 | "_user_tags": null, 271 | "creation": "2024-06-26 17:34:45.033297", 272 | "default_value": null, 273 | "doc_type": "Item", 274 | "docstatus": 0, 275 | "doctype_or_field": "DocField", 276 | "field_name": "naming_series", 277 | "idx": 0, 278 | "is_system_generated": 0, 279 | "modified": "2024-06-26 17:34:45.033297", 280 | "modified_by": "Administrator", 281 | "module": null, 282 | "name": "Item-naming_series-hidden", 283 | "owner": "Administrator", 284 | "property": "hidden", 285 | "property_type": "Check", 286 | "row_name": null, 287 | "value": "1" 288 | }, 289 | { 290 | "_assign": null, 291 | "_comments": null, 292 | "_liked_by": null, 293 | "_user_tags": null, 294 | "creation": "2024-06-26 17:34:44.597663", 295 | "default_value": null, 296 | "doc_type": "Item", 297 | "docstatus": 0, 298 | "doctype_or_field": "DocField", 299 | "field_name": "naming_series", 300 | "idx": 0, 301 | "is_system_generated": 0, 302 | "modified": "2024-06-26 17:34:44.597663", 303 | "modified_by": "Administrator", 304 | "module": null, 305 | "name": "Item-naming_series-reqd", 306 | "owner": "Administrator", 307 | "property": "reqd", 308 | "property_type": "Check", 309 | "row_name": null, 310 | "value": "0" 311 | } 312 | ], 313 | "sync_on_migrate": 1 314 | } -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/custom/item_barcode.json: -------------------------------------------------------------------------------- 1 | { 2 | "custom_fields": [], 3 | "custom_perms": [], 4 | "doctype": "Item Barcode", 5 | "links": [], 6 | "property_setters": [ 7 | { 8 | "_assign": null, 9 | "_comments": null, 10 | "_liked_by": null, 11 | "_user_tags": null, 12 | "creation": "2024-06-26 17:34:50.685827", 13 | "default_value": null, 14 | "doc_type": "Item Barcode", 15 | "docstatus": 0, 16 | "doctype_or_field": "DocField", 17 | "field_name": "barcode", 18 | "idx": 0, 19 | "is_system_generated": 1, 20 | "modified": "2024-06-26 17:34:50.685827", 21 | "modified_by": "Administrator", 22 | "module": null, 23 | "name": "Item Barcode-barcode-hidden", 24 | "owner": "Administrator", 25 | "property": "hidden", 26 | "property_type": "Check", 27 | "row_name": null, 28 | "value": "0" 29 | } 30 | ], 31 | "sync_on_migrate": 1 32 | } -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/custom/item_price.json: -------------------------------------------------------------------------------- 1 | { 2 | "custom_fields": [ 3 | { 4 | "_assign": null, 5 | "_comments": null, 6 | "_liked_by": null, 7 | "_user_tags": null, 8 | "allow_in_quick_entry": 0, 9 | "allow_on_submit": 0, 10 | "bold": 0, 11 | "collapsible": 0, 12 | "collapsible_depends_on": null, 13 | "columns": 0, 14 | "creation": "2024-07-31 20:27:35.153800", 15 | "default": null, 16 | "depends_on": null, 17 | "description": null, 18 | "docstatus": 0, 19 | "dt": "Item Price", 20 | "fetch_from": null, 21 | "fetch_if_empty": 0, 22 | "fieldname": "is_go1_webshop_item", 23 | "fieldtype": "Check", 24 | "hidden": 1, 25 | "hide_border": 0, 26 | "hide_days": 0, 27 | "hide_seconds": 0, 28 | "idx": 0, 29 | "ignore_user_permissions": 0, 30 | "ignore_xss_filter": 0, 31 | "in_global_search": 0, 32 | "in_list_view": 0, 33 | "in_preview": 0, 34 | "in_standard_filter": 0, 35 | "insert_after": null, 36 | "is_system_generated": 0, 37 | "is_virtual": 0, 38 | "label": "Is Go1 Webshop Item", 39 | "length": 0, 40 | "link_filters": null, 41 | "mandatory_depends_on": null, 42 | "modified": "2024-07-31 20:27:46.673524", 43 | "modified_by": "Administrator", 44 | "module": "Go1 Webshop", 45 | "name": "Item Price-custom_is_go1_webshop_item", 46 | "no_copy": 0, 47 | "non_negative": 0, 48 | "options": null, 49 | "owner": "Administrator", 50 | "permlevel": 0, 51 | "precision": "", 52 | "print_hide": 0, 53 | "print_hide_if_no_value": 0, 54 | "print_width": null, 55 | "read_only": 0, 56 | "read_only_depends_on": null, 57 | "report_hide": 0, 58 | "reqd": 0, 59 | "search_index": 0, 60 | "show_dashboard": 0, 61 | "sort_options": 0, 62 | "translatable": 0, 63 | "unique": 0, 64 | "width": null 65 | } 66 | ], 67 | "custom_perms": [], 68 | "doctype": "Item Price", 69 | "links": [], 70 | "property_setters": [], 71 | "sync_on_migrate": 1 72 | } -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/custom/mobile_menu.json: -------------------------------------------------------------------------------- 1 | { 2 | "custom_fields": [ 3 | { 4 | "_assign": null, 5 | "_comments": null, 6 | "_liked_by": null, 7 | "_user_tags": null, 8 | "allow_in_quick_entry": 0, 9 | "allow_on_submit": 0, 10 | "bold": 0, 11 | "collapsible": 0, 12 | "collapsible_depends_on": null, 13 | "columns": 0, 14 | "creation": "2024-08-28 17:15:45.503921", 15 | "default": null, 16 | "depends_on": null, 17 | "description": null, 18 | "docstatus": 0, 19 | "dt": "Mobile Menu", 20 | "fetch_from": null, 21 | "fetch_if_empty": 0, 22 | "fieldname": "is_go1_webshop_item", 23 | "fieldtype": "Check", 24 | "hidden": 1, 25 | "hide_border": 0, 26 | "hide_days": 0, 27 | "hide_seconds": 0, 28 | "idx": 0, 29 | "ignore_user_permissions": 0, 30 | "ignore_xss_filter": 0, 31 | "in_global_search": 0, 32 | "in_list_view": 0, 33 | "in_preview": 0, 34 | "in_standard_filter": 0, 35 | "insert_after": null, 36 | "is_system_generated": 0, 37 | "is_virtual": 0, 38 | "label": "Is Go1 Webshop Item", 39 | "length": 0, 40 | "link_filters": null, 41 | "mandatory_depends_on": null, 42 | "modified": "2024-08-28 17:15:52.758785", 43 | "modified_by": "Administrator", 44 | "module": "Go1 Webshop", 45 | "name": "Mobile Menu-custom_is_go1_webshop_item", 46 | "no_copy": 0, 47 | "non_negative": 0, 48 | "options": null, 49 | "owner": "Administrator", 50 | "permlevel": 0, 51 | "precision": "", 52 | "print_hide": 0, 53 | "print_hide_if_no_value": 0, 54 | "print_width": null, 55 | "read_only": 0, 56 | "read_only_depends_on": null, 57 | "report_hide": 0, 58 | "reqd": 0, 59 | "search_index": 0, 60 | "show_dashboard": 0, 61 | "sort_options": 0, 62 | "translatable": 0, 63 | "unique": 0, 64 | "width": null 65 | } 66 | ], 67 | "custom_perms": [], 68 | "doctype": "Mobile Menu", 69 | "links": [], 70 | "property_setters": [], 71 | "sync_on_migrate": 1 72 | } -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/custom/website_item.json: -------------------------------------------------------------------------------- 1 | { 2 | "custom_fields": [ 3 | { 4 | "_assign": null, 5 | "_comments": null, 6 | "_liked_by": null, 7 | "_user_tags": null, 8 | "allow_in_quick_entry": 0, 9 | "allow_on_submit": 0, 10 | "bold": 0, 11 | "collapsible": 0, 12 | "collapsible_depends_on": null, 13 | "columns": 0, 14 | "creation": "2024-07-31 20:19:42.906774", 15 | "default": null, 16 | "depends_on": null, 17 | "description": null, 18 | "docstatus": 0, 19 | "dt": "Website Item", 20 | "fetch_from": null, 21 | "fetch_if_empty": 0, 22 | "fieldname": "is_go1_webshop_item", 23 | "fieldtype": "Check", 24 | "hidden": 1, 25 | "hide_border": 0, 26 | "hide_days": 0, 27 | "hide_seconds": 0, 28 | "idx": 44, 29 | "ignore_user_permissions": 0, 30 | "ignore_xss_filter": 0, 31 | "in_global_search": 0, 32 | "in_list_view": 0, 33 | "in_preview": 0, 34 | "in_standard_filter": 0, 35 | "insert_after": "website_content", 36 | "is_system_generated": 0, 37 | "is_virtual": 0, 38 | "label": "Is Go1 Webshop Item", 39 | "length": 0, 40 | "link_filters": null, 41 | "mandatory_depends_on": null, 42 | "modified": "2024-07-31 20:19:51.381515", 43 | "modified_by": "Administrator", 44 | "module": "Go1 Webshop", 45 | "name": "Website Item-custom_is_go1_webshop_item", 46 | "no_copy": 0, 47 | "non_negative": 0, 48 | "options": null, 49 | "owner": "Administrator", 50 | "permlevel": 0, 51 | "precision": "", 52 | "print_hide": 0, 53 | "print_hide_if_no_value": 0, 54 | "print_width": null, 55 | "read_only": 0, 56 | "read_only_depends_on": null, 57 | "report_hide": 0, 58 | "reqd": 0, 59 | "search_index": 0, 60 | "show_dashboard": 0, 61 | "sort_options": 0, 62 | "translatable": 0, 63 | "unique": 0, 64 | "width": null 65 | } 66 | ], 67 | "custom_perms": [], 68 | "doctype": "Website Item", 69 | "links": [], 70 | "property_setters": [], 71 | "sync_on_migrate": 1 72 | } -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/custom/website_slideshow.json: -------------------------------------------------------------------------------- 1 | { 2 | "custom_fields": [ 3 | { 4 | "_assign": null, 5 | "_comments": null, 6 | "_liked_by": null, 7 | "_user_tags": null, 8 | "allow_in_quick_entry": 0, 9 | "allow_on_submit": 0, 10 | "bold": 0, 11 | "collapsible": 0, 12 | "collapsible_depends_on": null, 13 | "columns": 0, 14 | "creation": "2024-07-31 20:25:55.044850", 15 | "default": null, 16 | "depends_on": null, 17 | "description": null, 18 | "docstatus": 0, 19 | "dt": "Website Slideshow", 20 | "fetch_from": null, 21 | "fetch_if_empty": 0, 22 | "fieldname": "is_go1_webshop_item", 23 | "fieldtype": "Check", 24 | "hidden": 1, 25 | "hide_border": 0, 26 | "hide_days": 0, 27 | "hide_seconds": 0, 28 | "idx": 0, 29 | "ignore_user_permissions": 0, 30 | "ignore_xss_filter": 0, 31 | "in_global_search": 0, 32 | "in_list_view": 0, 33 | "in_preview": 0, 34 | "in_standard_filter": 0, 35 | "insert_after": null, 36 | "is_system_generated": 0, 37 | "is_virtual": 0, 38 | "label": "Is Go1 Webshop Item", 39 | "length": 0, 40 | "link_filters": null, 41 | "mandatory_depends_on": null, 42 | "modified": "2024-07-31 20:26:00.849379", 43 | "modified_by": "Administrator", 44 | "module": "Go1 Webshop", 45 | "name": "Website Slideshow-custom_is_go1_webshop_item", 46 | "no_copy": 0, 47 | "non_negative": 0, 48 | "options": null, 49 | "owner": "Administrator", 50 | "permlevel": 0, 51 | "precision": "", 52 | "print_hide": 0, 53 | "print_hide_if_no_value": 0, 54 | "print_width": null, 55 | "read_only": 0, 56 | "read_only_depends_on": null, 57 | "report_hide": 0, 58 | "reqd": 0, 59 | "search_index": 0, 60 | "show_dashboard": 0, 61 | "sort_options": 0, 62 | "translatable": 0, 63 | "unique": 0, 64 | "width": null 65 | } 66 | ], 67 | "custom_perms": [], 68 | "doctype": "Website Slideshow", 69 | "links": [], 70 | "property_setters": [], 71 | "sync_on_migrate": 1 72 | } -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/custom/website_slideshow_item.json: -------------------------------------------------------------------------------- 1 | { 2 | "custom_fields": [ 3 | { 4 | "_assign": null, 5 | "_comments": null, 6 | "_liked_by": null, 7 | "_user_tags": null, 8 | "allow_in_quick_entry": 0, 9 | "allow_on_submit": 0, 10 | "bold": 0, 11 | "collapsible": 0, 12 | "collapsible_depends_on": null, 13 | "columns": 0, 14 | "creation": "2024-07-31 20:26:47.468938", 15 | "default": null, 16 | "depends_on": null, 17 | "description": null, 18 | "docstatus": 0, 19 | "dt": "Website Slideshow Item", 20 | "fetch_from": null, 21 | "fetch_if_empty": 0, 22 | "fieldname": "is_go1_webshop_item", 23 | "fieldtype": "Check", 24 | "hidden": 1, 25 | "hide_border": 0, 26 | "hide_days": 0, 27 | "hide_seconds": 0, 28 | "idx": 0, 29 | "ignore_user_permissions": 0, 30 | "ignore_xss_filter": 0, 31 | "in_global_search": 0, 32 | "in_list_view": 0, 33 | "in_preview": 0, 34 | "in_standard_filter": 0, 35 | "insert_after": null, 36 | "is_system_generated": 0, 37 | "is_virtual": 0, 38 | "label": "Is Go1 Webshop Item", 39 | "length": 0, 40 | "link_filters": null, 41 | "mandatory_depends_on": null, 42 | "modified": "2024-07-31 20:26:54.244296", 43 | "modified_by": "Administrator", 44 | "module": "Go1 Webshop", 45 | "name": "Website Slideshow Item-custom_is_go1_webshop_item", 46 | "no_copy": 0, 47 | "non_negative": 0, 48 | "options": null, 49 | "owner": "Administrator", 50 | "permlevel": 0, 51 | "precision": "", 52 | "print_hide": 0, 53 | "print_hide_if_no_value": 0, 54 | "print_width": null, 55 | "read_only": 0, 56 | "read_only_depends_on": null, 57 | "report_hide": 0, 58 | "reqd": 0, 59 | "search_index": 0, 60 | "show_dashboard": 0, 61 | "sort_options": 0, 62 | "translatable": 0, 63 | "unique": 0, 64 | "width": null 65 | } 66 | ], 67 | "custom_perms": [], 68 | "doctype": "Website Slideshow Item", 69 | "links": [], 70 | "property_setters": [], 71 | "sync_on_migrate": 1 72 | } -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/default_pages/builder_client_scripts.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "JavaScript-b2f26", 4 | "is_go1_webshop_item": 0, 5 | "script_type": "JavaScript", 6 | "script": "const domainName = window.location.origin;\r\nvar register_payload = {}\r\n\r\nfunction getRegisterInput(event) {\r\n register_payload[event.name] = event.value;\r\n}\r\nfunction changeType(type){\r\n login_type = type\r\n document.getElementById(type).classList.add(\"block\")\r\n document.getElementById(type).classList.remove(\"hide\")\r\n if(type == 'login'){\r\n document.getElementById('signup').classList.add(\"hide\")\r\n }else{\r\n document.getElementById('login').classList.add(\"hide\")\r\n }\r\n}\r\nfunction validatePassword(password) {\r\n var uppercaseRegex = /[A-Z]/;\r\n var lowercaseRegex = /[a-z]/;\r\n var numberRegex = /[0-9]/;\r\n var symbolRegex = /[$@$!%*?&/]/; \r\n return password.length >= 8 &&\r\n uppercaseRegex.test(password) &&\r\n lowercaseRegex.test(password) &&\r\n numberRegex.test(password) &&\r\n symbolRegex.test(password);\r\n}\r\n\r\nfunction validateEmail(email) { \r\n var emailRegex = /\\S+@\\S+\\.\\S+/;\r\n return emailRegex.test(email);\r\n}\r\n\r\nfunction registerError(message,type) {\r\n var existingError = document.querySelector('.reg-error-message');\r\n if (existingError) {\r\n existingError.remove();\r\n }\r\n var errorMessage = document.createElement('p');\r\n errorMessage.textContent = message;\r\n errorMessage.classList.add('reg-error-message');\r\n errorMessage.style.color = 'red';\r\n errorMessage.style.fontSize = '12px';\r\n if (type == \"Register\"){\r\n var pswdContainer = document.querySelector(\".password-input-field\");\r\n pswdContainer.parentNode.insertBefore(errorMessage, pswdContainer.nextSibling);\r\n }\r\n if (type == \"Login\"){\r\n var pswdlogin = document.querySelector(\".password-login-field\");\r\n pswdlogin.parentNode.insertBefore(errorMessage, pswdlogin.nextSibling);\r\n }\r\n}\r\n\r\nfunction clearRegErrorMessages() {\r\n \r\n var errorMessages = document.querySelectorAll('.reg-error-message');\r\n errorMessages.forEach(function(errorMessage) {\r\n errorMessage.remove();\r\n });\r\n}\r\n\r\ndocument.querySelector(\".full-name-input-field\").addEventListener('click', clearRegErrorMessages);\r\ndocument.querySelector(\".email-input-field\").addEventListener('click', clearRegErrorMessages);\r\ndocument.querySelector(\".email-login-field\").addEventListener('click', clearRegErrorMessages);\r\ndocument.querySelector(\".phone-input-field\").addEventListener('click', clearRegErrorMessages);\r\ndocument.querySelector(\".password-input-field\").addEventListener('click', clearRegErrorMessages);\r\ndocument.querySelector(\".password-login-field\").addEventListener('click', clearRegErrorMessages);\r\n\r\nasync function register(event) {\r\n const fullName = document.querySelector(\".full-name-input-field\").value;\r\n const email = document.querySelector(\".email-input-field\").value;\r\n const phone = document.querySelector(\".phone-input-field\").value;\r\n const password = document.querySelector(\".password-input-field\").value;\r\n clearRegErrorMessages();\r\n\r\n if (!fullName || !email || !phone || !password) {\r\n registerError('Please enter all the fields!',\"Register\");\r\n return; \r\n }\r\n\r\n if (!validateEmail(email)) {\r\n registerError('Please enter a valid email address!',\"Register\");\r\n return;\r\n }\r\n\r\n if (!validatePassword(password)) {\r\n registerError('Password must contain at least one uppercase letter, one lowercase letter, one number, one symbol, and be at least 8 characters long!',\"Register\");\r\n return; \r\n }\r\n\r\n console.log(\"register_payload\", { data: register_payload });\r\n let res = await postMethod(\"go1_webshop.go1_webshop.api.insert_theme_register\", {\r\n \"full_name\": fullName,\r\n \"email\": email,\r\n \"phone\": phone,\r\n \"password\": password \r\n });\r\n\r\n if (res && res.message && res.message === 'Success') {\r\n console.log(res.message);\r\n window.location.href = domainName + '/browse-go1-themes';\r\n }\r\n}\r\nasync function login(event) {\r\n const email = document.querySelector(\".email-login-field\").value;\r\n const password = document.querySelector(\".password-login-field\").value;\r\n clearRegErrorMessages();\r\n\r\n if ( !email || !password) {\r\n registerError('Please enter all the fields!!',\"Login\");\r\n return; \r\n }\r\n\r\n if (!validateEmail(email)) {\r\n registerError('Please enter a valid email address!',\"Login\");\r\n return;\r\n }\r\n\r\n\r\n console.log(\"register_payload\", { data: register_payload });\r\n let res = await postMethod(\"go1_webshop.go1_webshop.api.login_theme_registration\", {\r\n \"email\": email,\r\n \"password\": password \r\n });\r\n\r\n if (res && res.message && res.message === 'Success') {\r\n console.log(res.message);\r\n window.location.href = domainName + '/browse-go1-themes';\r\n }\r\n if (res && res.message && res.message === 'Failed') {\r\n registerError('Invalid Login Credentials',\"Login\");\r\n return;\r\n }\r\n}\r\n\r\nasync function postMethod(api, payload) {\r\n let k = await fetch(domainName + \"/api/method/\" + api, {\r\n \"body\": JSON.stringify(payload),\r\n \"method\": \"POST\",\r\n \"headers\": {\r\n \"Content-Type\": \"application/json\",\r\n \"x-frappe-csrf-token\": frappe.csrf_token\r\n }\r\n });\r\n let val = await k.json();\r\n return val;\r\n}\r\n", 7 | "public_url": "/files/page_scripts/JavaScript-b2f26-0069dd23e9.js?v=16d26dd55d", 8 | "doctype": "Builder Client Script" 9 | }, 10 | { 11 | "name": "Theme List Javascript", 12 | "is_go1_webshop_item": 0, 13 | "script_type": "JavaScript", 14 | "script": "const domainName = window.location.origin;\n\nfunction collapse(event) {\n let themesElement = event.parentNode.querySelector('.themes');\n if (themesElement.style.display === 'block' || themesElement.style.display === '') {\n themesElement.style.display = 'none';\n } else {\n themesElement.style.display = 'block';\n }\n}\n\n\nfunction setImage(event) {\n // $('.detail_theme_image').attr('src', event.querySelector('img').src);\n document.querySelector(\".detail_theme_image\").src = event.querySelector('img').src;\n // document.querySelector(\".image_title\").textContent = event.querySelector(\".category_title\").textContent;\n}\n\nasync function getTemplate(event, data) {\n document.querySelector(\".loading\").style.display = \"flex\"\n const currentUrl = window.location.href;\n const lastSegment = currentUrl.split('/').pop();\n let res = await postMethod(\"go1_webshop.go1_webshop.after_install.insert_pages\", {\n theme: lastSegment,\n nodata: data\n });\n if (res && res.message) {\n window.location.href = \"/\";\n }\n}\n\nasync function postMethod(api, payload) {\n let k = await fetch(domainName + \"/api/method/\" + api, {\n \"body\": JSON.stringify(payload),\n \"method\": \"POST\",\n \"headers\": {\n \"Content-Type\": \"application/json\",\n \"x-frappe-csrf-token\":frappe.csrf_token\n }\n });\n let val = await k.json();\n return val;\n}", 15 | "public_url": "/files/page_scripts/JavaScript-5cdd3-cee3917b54.js?v=90dbd326bb", 16 | "doctype": "Builder Client Script" 17 | }, 18 | { 19 | "name": "go1theme_login", 20 | "is_go1_webshop_item": 0, 21 | "script_type": "CSS", 22 | "script": ".block{ display: flex !important;}\n.hide{ display: none !important;}", 23 | "public_url": "/files/page_styles/CSS-1569a-b904b7a021.css?v=eb1e7f4a9d", 24 | "doctype": "Builder Client Script" 25 | } 26 | ] 27 | -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/go1_webshop/doctype/__init__.py -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/__pycache__/__init__.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/go1_webshop/doctype/__pycache__/__init__.cpython-311.pyc -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/erp_settings/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/go1_webshop/doctype/erp_settings/__init__.py -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/erp_settings/__pycache__/__init__.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/go1_webshop/doctype/erp_settings/__pycache__/__init__.cpython-311.pyc -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/erp_settings/__pycache__/erp_settings.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/go1_webshop/doctype/erp_settings/__pycache__/erp_settings.cpython-311.pyc -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/erp_settings/erp_settings.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, tridotstech and contributors 2 | // For license information, please see license.txt 3 | 4 | frappe.ui.form.on("Erp Settings", { 5 | refresh(frm) { 6 | 7 | }, 8 | import_all_pages(frm){ 9 | frappe.call({ 10 | method:'go1_webshop.go1_webshop.after_install.insert_pages', 11 | args:{ 12 | }, 13 | // freeze:true, 14 | callback: function(r) { 15 | if(r && r.message == 'success'){ 16 | // frm.set_value("publisher",r.data) 17 | // frm.refresh_field("publisher") 18 | }else{ 19 | alert('Something Went Wrong') 20 | } 21 | } 22 | }) 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/erp_settings/erp_settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "actions": [], 3 | "allow_rename": 1, 4 | "creation": "2024-02-17 15:08:49.960128", 5 | "doctype": "DocType", 6 | "engine": "InnoDB", 7 | "field_order": [ 8 | "title" 9 | ], 10 | "fields": [ 11 | { 12 | "fieldname": "title", 13 | "fieldtype": "Data", 14 | "label": "Title" 15 | } 16 | ], 17 | "index_web_pages_for_search": 1, 18 | "issingle": 1, 19 | "links": [], 20 | "modified": "2024-03-05 17:58:20.754996", 21 | "modified_by": "Administrator", 22 | "module": "Go1 Webshop", 23 | "name": "Erp Settings", 24 | "owner": "Administrator", 25 | "permissions": [ 26 | { 27 | "create": 1, 28 | "delete": 1, 29 | "email": 1, 30 | "print": 1, 31 | "read": 1, 32 | "role": "System Manager", 33 | "share": 1, 34 | "write": 1 35 | } 36 | ], 37 | "sort_field": "modified", 38 | "sort_order": "DESC", 39 | "states": [] 40 | } -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/erp_settings/test_erp_settings.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2024, tridotstech and Contributors 2 | # See license.txt 3 | 4 | # import frappe 5 | from frappe.tests.utils import FrappeTestCase 6 | 7 | 8 | class TestErpSettings(FrappeTestCase): 9 | pass 10 | -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/go1_webshop_settings/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/go1_webshop/doctype/go1_webshop_settings/__init__.py -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/go1_webshop_settings/__pycache__/__init__.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/go1_webshop/doctype/go1_webshop_settings/__pycache__/__init__.cpython-311.pyc -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/go1_webshop_settings/__pycache__/go1_webshop_settings.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/go1_webshop/doctype/go1_webshop_settings/__pycache__/go1_webshop_settings.cpython-311.pyc -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/go1_webshop_settings/go1_webshop_settings.js: -------------------------------------------------------------------------------- 1 | frappe.ui.form.on("Go1 Webshop Settings", { 2 | refresh(frm) { 3 | }, 4 | import_all_pages(frm){ 5 | // console.log("CLicked"); 6 | // fetchThemesAndShowDialog(frm); 7 | // frm.reload_doc() 8 | window.location.href = "/browse-go1-themes" 9 | } 10 | }); 11 | // function fetchThemesAndShowDialog(frm) { 12 | // frappe.call({ 13 | // method: 'go1_webshop.go1_webshop.after_install.fetch_themes_from_external_url', 14 | // callback: function(r) { 15 | // console.log("CCC",r.message) 16 | // if (r.message) { 17 | // showThemeDialog(frm, r.message); 18 | // } else { 19 | // frappe.msgprint('No theme found.'); 20 | // } 21 | // } 22 | // }); 23 | 24 | // } 25 | function fetchThemesAndShowDialog(frm) { 26 | frappe.call({ 27 | method: 'go1_webshop.go1_webshop.after_install.fetch_erp_ecommerce_themes_from_external_url', 28 | callback: function(r) { 29 | // console.log("CCC",r.message) 30 | if (r.message) { 31 | showThemeDialog(frm, r.message); 32 | } else { 33 | frappe.msgprint('No theme found.'); 34 | } 35 | } 36 | }); 37 | 38 | } 39 | 40 | 41 | function showThemeDialog(frm, themes) { 42 | let selectedThemeRoute = null; 43 | 44 | const dialog = new frappe.ui.Dialog({ 45 | title: 'Select a Theme', 46 | fields: [{ 47 | label: 'Choose Theme', 48 | fieldname: 'theme', 49 | fieldtype: 'HTML', 50 | options: generateThemeOptionsHtml(themes) 51 | }], 52 | size:"extra-large", 53 | primary_action_label: 'Import Pages', 54 | primary_action: function() { 55 | dialog.hide(); 56 | // console.log("selectedThemeRoute", selectedThemeRoute); 57 | if (selectedThemeRoute) { 58 | importPages(frm, selectedThemeRoute); 59 | 60 | } else { 61 | frappe.msgprint('Please select a theme.'); 62 | } 63 | } 64 | }); 65 | 66 | dialog.show(); 67 | window.selectTheme = function(themeName, themeRoute) { 68 | // console.log("themeName", themeName); 69 | 70 | selectedThemeRoute = themeRoute; 71 | $('.theme-container').removeClass('selected'); 72 | $(`div[data-theme-name="${themeName}"]`).addClass('selected'); 73 | }; 74 | } 75 | 76 | function generateThemeOptionsHtml(themes) { 77 | let style = ` 78 | 165 | `; 166 | 167 | let html = '
' + style; 168 | themes.forEach(theme => { 169 | html += ` 170 |
171 |
172 |
173 |

${theme.theme_name}

174 |
175 |
176 | `; 177 | }); 178 | html += '
'; 179 | return html; 180 | } 181 | 182 | 183 | 184 | function importPages(frm, theme) { 185 | // console.log("Themes", theme); 186 | frm.set_value('selected_theme', theme); 187 | // console.log(theme); 188 | 189 | frappe.call({ 190 | method: 'go1_webshop.go1_webshop.after_install.insert_pages', 191 | args: { theme: theme }, 192 | callback: function(r) { 193 | // console.log("r",r) 194 | if (r.message === 'success') { 195 | frappe.msgprint('Pages imported successfully'); 196 | frm.save(); 197 | } else { 198 | frappe.msgprint('Something went wrong during page import'); 199 | } 200 | }, 201 | freeze:true, 202 | freeze_message:"Please wait, this may take few minutes." 203 | }); 204 | 205 | // Initial progress at 0% 206 | // frappe.show_progress(__('Importing Pages'), 25, 100, 'Starting import...'); 207 | 208 | // frappe.realtime.on('import_progress', function(data) { 209 | // let progress = 0; 210 | // if (data.stage === 'items') { 211 | // console.log("60%"); 212 | // progress = 60; 213 | // } 214 | 215 | // frappe.show_progress(__('Importing Pages'), progress, 100, data.message); 216 | 217 | // if (progress >= 100) { 218 | // frappe.hide_progress(); 219 | // } 220 | // }); 221 | } -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/go1_webshop_settings/go1_webshop_settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "actions": [], 3 | "allow_rename": 1, 4 | "creation": "2024-03-05 17:56:40.216322", 5 | "default_view": "List", 6 | "doctype": "DocType", 7 | "engine": "InnoDB", 8 | "field_order": [ 9 | "section_break_auqx", 10 | "import_all_pages", 11 | "selected_theme" 12 | ], 13 | "fields": [ 14 | { 15 | "fieldname": "section_break_auqx", 16 | "fieldtype": "Section Break", 17 | "label": "Pages" 18 | }, 19 | { 20 | "fieldname": "import_all_pages", 21 | "fieldtype": "Button", 22 | "label": "Explore Themes" 23 | }, 24 | { 25 | "fieldname": "selected_theme", 26 | "fieldtype": "Data", 27 | "hidden": 1, 28 | "label": "Selected Theme" 29 | } 30 | ], 31 | "index_web_pages_for_search": 1, 32 | "issingle": 1, 33 | "links": [], 34 | "modified": "2024-09-30 17:46:38.872598", 35 | "modified_by": "Administrator", 36 | "module": "Go1 Webshop", 37 | "name": "Go1 Webshop Settings", 38 | "owner": "Administrator", 39 | "permissions": [ 40 | { 41 | "create": 1, 42 | "delete": 1, 43 | "email": 1, 44 | "print": 1, 45 | "read": 1, 46 | "role": "System Manager", 47 | "share": 1, 48 | "write": 1 49 | } 50 | ], 51 | "sort_field": "modified", 52 | "sort_order": "DESC", 53 | "states": [] 54 | } -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/go1_webshop_settings/go1_webshop_settings.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2024, tridotstech and contributors 2 | # For license information, please see license.txt 3 | 4 | # import frappe 5 | from frappe.model.document import Document 6 | 7 | 8 | class Go1WebshopSettings(Document): 9 | pass 10 | -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/go1_webshop_settings/test_go1_webshop_settings.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2024, tridotstech and Contributors 2 | # See license.txt 3 | 4 | # import frappe 5 | from frappe.tests.utils import FrappeTestCase 6 | 7 | 8 | class TestGo1WebshopSettings(FrappeTestCase): 9 | pass 10 | -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/go1_webshop_theme/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/go1_webshop/doctype/go1_webshop_theme/__init__.py -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/go1_webshop_theme/__pycache__/__init__.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/go1_webshop/doctype/go1_webshop_theme/__pycache__/__init__.cpython-311.pyc -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/go1_webshop_theme/__pycache__/go1_webshop_theme.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/go1_webshop/doctype/go1_webshop_theme/__pycache__/go1_webshop_theme.cpython-311.pyc -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/go1_webshop_theme/go1_webshop_theme.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, tridotstech and contributors 2 | // For license information, please see license.txt 3 | 4 | // frappe.ui.form.on("Go1 Webshop Theme", { 5 | // refresh(frm) { 6 | 7 | // }, 8 | // }); 9 | -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/go1_webshop_theme/go1_webshop_theme.json: -------------------------------------------------------------------------------- 1 | { 2 | "actions": [], 3 | "allow_rename": 1, 4 | "autoname": "field:theme_name", 5 | "creation": "2024-06-26 19:46:12.217974", 6 | "doctype": "DocType", 7 | "engine": "InnoDB", 8 | "field_order": [ 9 | "section_break_uive", 10 | "theme_name", 11 | "description", 12 | "column_break_191t", 13 | "theme_route", 14 | "theme_image", 15 | "section_break_cyvu", 16 | "category_details", 17 | "common_settings_tab", 18 | "primary_color", 19 | "column_break_m4qy", 20 | "secondary_color", 21 | "column_break_ngl9", 22 | "text_color", 23 | "product_info_section", 24 | "product_cards_count", 25 | "description_font_size", 26 | "description_color", 27 | "column_break_cdsi", 28 | "product_card_background_color", 29 | "price_amount_color", 30 | "price_amount_size", 31 | "product_title_color", 32 | "column_break_xndd", 33 | "product_image_size", 34 | "offer_style", 35 | "header_settings_tab", 36 | "announcement_bar_section", 37 | "enable_announcement_bar", 38 | "background", 39 | "top_bar_padding", 40 | "column_break_rnuv", 41 | "announce_text_color", 42 | "text_size", 43 | "column_break_akx2", 44 | "is_dismissible", 45 | "header_width", 46 | "header_settings_section", 47 | "header_background", 48 | "header_padding", 49 | "column_break_slbn", 50 | "logo_height", 51 | "sticky_header", 52 | "is_shadow", 53 | "header_shadow", 54 | "sticky_header_background", 55 | "is_transparent_header", 56 | "column_break_emjh", 57 | "enable_header_border", 58 | "header_border_color", 59 | "header_text_color", 60 | "web_menu_settings_section", 61 | "font_family", 62 | "line_height", 63 | "menu_hover_color", 64 | "dropdown_background_color", 65 | "dropdown_menu_hover_color", 66 | "column_break_bboq", 67 | "font_weight_web", 68 | "letter_spacing_web", 69 | "menu_background_color", 70 | "menu_item_spacing_web", 71 | "dropdown_menu_color", 72 | "column_break_70m0", 73 | "font_size_web", 74 | "menu_text_color", 75 | "menu_alignment", 76 | "dropdown_menu_hover_background_color", 77 | "apply_box_shadow", 78 | "dropdown_menu_box_shadow", 79 | "mobile_menu_section", 80 | "mobile_logo_height", 81 | "font_weight", 82 | "letter_spacing", 83 | "menu_padding", 84 | "back_button_margin", 85 | "column_break_ofmt", 86 | "mobile_menu_background", 87 | "font_size", 88 | "color", 89 | "back_button_text_color", 90 | "column_break_bt69", 91 | "font_family_mob", 92 | "line_height_mob", 93 | "hover_color", 94 | "back_button_background", 95 | "footer_settings_tab", 96 | "design_section", 97 | "footer_bg_color", 98 | "background_image", 99 | "column_break_nkpd", 100 | "link_color", 101 | "column_break_cxax", 102 | "link_hover_color", 103 | "footer_tile_style_section", 104 | "footer_font_family", 105 | "footer_line_height", 106 | "column_break_mlr7", 107 | "footer_font_weight", 108 | "footer_letter_spacing", 109 | "column_break_wav1", 110 | "footer_font_size", 111 | "footer_text_color", 112 | "footer_text_style_section", 113 | "ft_font_family", 114 | "ft_line_height", 115 | "column_break_mp7o", 116 | "ft_font_weight", 117 | "ft_letter_spacing", 118 | "column_break_hq1c", 119 | "ft_font_size", 120 | "ft_text_color", 121 | "copyright_section", 122 | "enable_copyright", 123 | "copyright_content", 124 | "copyright_content_style_section", 125 | "cr_font_size", 126 | "enable_footer_border", 127 | "footer_border_color", 128 | "cr_vertical_padding", 129 | "column_break_2ctp", 130 | "cr_background_color", 131 | "cr_text_color", 132 | "column_break_ckph", 133 | "cr_link_color", 134 | "cr_link_hover_color" 135 | ], 136 | "fields": [ 137 | { 138 | "fieldname": "section_break_uive", 139 | "fieldtype": "Tab Break", 140 | "label": "Theme Settings" 141 | }, 142 | { 143 | "fieldname": "theme_name", 144 | "fieldtype": "Data", 145 | "label": "Theme Name", 146 | "unique": 1 147 | }, 148 | { 149 | "fieldname": "theme_image", 150 | "fieldtype": "Attach", 151 | "label": "Theme Image" 152 | }, 153 | { 154 | "fieldname": "theme_route", 155 | "fieldtype": "Data", 156 | "label": "Theme Route" 157 | }, 158 | { 159 | "fieldname": "common_settings_tab", 160 | "fieldtype": "Tab Break", 161 | "hidden": 1, 162 | "label": "Common Settings" 163 | }, 164 | { 165 | "fieldname": "primary_color", 166 | "fieldtype": "Color", 167 | "label": "Primary Color" 168 | }, 169 | { 170 | "fieldname": "column_break_m4qy", 171 | "fieldtype": "Column Break" 172 | }, 173 | { 174 | "fieldname": "secondary_color", 175 | "fieldtype": "Color", 176 | "label": "Secondary Color" 177 | }, 178 | { 179 | "fieldname": "column_break_ngl9", 180 | "fieldtype": "Column Break" 181 | }, 182 | { 183 | "fieldname": "text_color", 184 | "fieldtype": "Color", 185 | "label": "Text Color" 186 | }, 187 | { 188 | "fieldname": "product_info_section", 189 | "fieldtype": "Section Break", 190 | "label": "Product Info" 191 | }, 192 | { 193 | "description": "to showcase how many product cards can be displayed.", 194 | "fieldname": "product_cards_count", 195 | "fieldtype": "Select", 196 | "label": "Product Cards Count", 197 | "options": "3\n4\n5\n6" 198 | }, 199 | { 200 | "fieldname": "description_font_size", 201 | "fieldtype": "Data", 202 | "label": "Description Font Size" 203 | }, 204 | { 205 | "fieldname": "description_color", 206 | "fieldtype": "Color", 207 | "label": "Description Color" 208 | }, 209 | { 210 | "fieldname": "column_break_cdsi", 211 | "fieldtype": "Column Break" 212 | }, 213 | { 214 | "fieldname": "product_card_background_color", 215 | "fieldtype": "Color", 216 | "label": "Product Card Background Color" 217 | }, 218 | { 219 | "fieldname": "price_amount_color", 220 | "fieldtype": "Color", 221 | "label": "Price Amount Color" 222 | }, 223 | { 224 | "fieldname": "price_amount_size", 225 | "fieldtype": "Data", 226 | "label": "Price Amount Size" 227 | }, 228 | { 229 | "fieldname": "product_title_color", 230 | "fieldtype": "Color", 231 | "label": "Product Title Color" 232 | }, 233 | { 234 | "fieldname": "column_break_xndd", 235 | "fieldtype": "Column Break" 236 | }, 237 | { 238 | "fieldname": "product_image_size", 239 | "fieldtype": "Data", 240 | "label": "Product Image Size" 241 | }, 242 | { 243 | "fieldname": "offer_style", 244 | "fieldtype": "Select", 245 | "label": "Offer Style", 246 | "options": "Band\nTag" 247 | }, 248 | { 249 | "fieldname": "header_settings_tab", 250 | "fieldtype": "Tab Break", 251 | "hidden": 1, 252 | "label": "Header Settings" 253 | }, 254 | { 255 | "fieldname": "announcement_bar_section", 256 | "fieldtype": "Section Break", 257 | "label": "Announcement Bar" 258 | }, 259 | { 260 | "default": "0", 261 | "description": "Enable a top bar above the header.", 262 | "fieldname": "enable_announcement_bar", 263 | "fieldtype": "Check", 264 | "label": "Enable Announcement Bar" 265 | }, 266 | { 267 | "depends_on": "eval:doc.enable_announcement_bar == 1", 268 | "description": "Set the background for top banner.", 269 | "fieldname": "background", 270 | "fieldtype": "Color", 271 | "label": "Background" 272 | }, 273 | { 274 | "depends_on": "eval:doc.enable_announcement_bar == 1", 275 | "description": "Set the top/bottom spacing for top banner.", 276 | "fieldname": "top_bar_padding", 277 | "fieldtype": "Data", 278 | "label": "Top Bar Padding" 279 | }, 280 | { 281 | "fieldname": "column_break_rnuv", 282 | "fieldtype": "Column Break" 283 | }, 284 | { 285 | "depends_on": "eval:doc.enable_announcement_bar == 1", 286 | "description": "Set the text color for top banner.", 287 | "fieldname": "announce_text_color", 288 | "fieldtype": "Color", 289 | "label": "Text Color" 290 | }, 291 | { 292 | "depends_on": "eval:doc.enable_announcement_bar == 1", 293 | "description": "Set the text size for top banner.", 294 | "fieldname": "text_size", 295 | "fieldtype": "Data", 296 | "label": "Text Size" 297 | }, 298 | { 299 | "fieldname": "column_break_akx2", 300 | "fieldtype": "Column Break" 301 | }, 302 | { 303 | "default": "0", 304 | "depends_on": "eval:doc.enable_announcement_bar == 1", 305 | "description": "Allow users to dismiss the banner using a close button.", 306 | "fieldname": "is_dismissible", 307 | "fieldtype": "Check", 308 | "label": "Is Dismissible" 309 | }, 310 | { 311 | "fieldname": "header_width", 312 | "fieldtype": "Data", 313 | "label": "Header Width" 314 | }, 315 | { 316 | "fieldname": "header_settings_section", 317 | "fieldtype": "Section Break", 318 | "label": "Header Settings" 319 | }, 320 | { 321 | "description": "Set the header background.", 322 | "fieldname": "header_background", 323 | "fieldtype": "Color", 324 | "label": "Header Background" 325 | }, 326 | { 327 | "description": "Set top/bottom spacing for header bar.", 328 | "fieldname": "header_padding", 329 | "fieldtype": "Data", 330 | "label": "Header Padding" 331 | }, 332 | { 333 | "fieldname": "column_break_slbn", 334 | "fieldtype": "Column Break" 335 | }, 336 | { 337 | "description": "Set the header logo height.", 338 | "fieldname": "logo_height", 339 | "fieldtype": "Data", 340 | "label": "Logo Height" 341 | }, 342 | { 343 | "default": "0", 344 | "description": "Set the header to fixed on top after scroll.", 345 | "fieldname": "sticky_header", 346 | "fieldtype": "Check", 347 | "hidden": 1, 348 | "label": "Sticky Header?" 349 | }, 350 | { 351 | "default": "0", 352 | "description": "Add a box shadow on the header.", 353 | "fieldname": "is_shadow", 354 | "fieldtype": "Check", 355 | "label": "Header Shadow?" 356 | }, 357 | { 358 | "depends_on": "eval:doc.is_shadow==1", 359 | "fieldname": "header_shadow", 360 | "fieldtype": "Data", 361 | "label": "Header Shadow" 362 | }, 363 | { 364 | "depends_on": "eval:doc.sticky_header==1", 365 | "fieldname": "sticky_header_background", 366 | "fieldtype": "Color", 367 | "label": "Sticky Header Background" 368 | }, 369 | { 370 | "default": "0", 371 | "fieldname": "is_transparent_header", 372 | "fieldtype": "Check", 373 | "label": "Is Transparent Header?" 374 | }, 375 | { 376 | "fieldname": "column_break_emjh", 377 | "fieldtype": "Column Break" 378 | }, 379 | { 380 | "default": "0", 381 | "description": "Set a 1px border bottom to header.", 382 | "fieldname": "enable_header_border", 383 | "fieldtype": "Check", 384 | "label": "Enable Header Border" 385 | }, 386 | { 387 | "depends_on": "eval:doc.enable_header_border==1", 388 | "description": "Set the header border color.", 389 | "fieldname": "header_border_color", 390 | "fieldtype": "Color", 391 | "label": "Header Border Color" 392 | }, 393 | { 394 | "fieldname": "header_text_color", 395 | "fieldtype": "Color", 396 | "label": "Header Text Color" 397 | }, 398 | { 399 | "fieldname": "web_menu_settings_section", 400 | "fieldtype": "Section Break", 401 | "label": "Web Menu Settings" 402 | }, 403 | { 404 | "fieldname": "font_family", 405 | "fieldtype": "Data", 406 | "label": "Font Family" 407 | }, 408 | { 409 | "fieldname": "line_height", 410 | "fieldtype": "Data", 411 | "label": "Line Height" 412 | }, 413 | { 414 | "fieldname": "menu_hover_color", 415 | "fieldtype": "Color", 416 | "label": "Menu Hover Color" 417 | }, 418 | { 419 | "description": "Set the dropdown menu background color.", 420 | "fieldname": "dropdown_background_color", 421 | "fieldtype": "Color", 422 | "label": "Dropdown Background Color" 423 | }, 424 | { 425 | "fieldname": "dropdown_menu_hover_color", 426 | "fieldtype": "Color", 427 | "label": "Dropdown Menu Hover Color" 428 | }, 429 | { 430 | "fieldname": "column_break_bboq", 431 | "fieldtype": "Column Break" 432 | }, 433 | { 434 | "fieldname": "font_weight_web", 435 | "fieldtype": "Data", 436 | "label": "Font Weight" 437 | }, 438 | { 439 | "fieldname": "letter_spacing_web", 440 | "fieldtype": "Data", 441 | "label": "Letter Spacing" 442 | }, 443 | { 444 | "fieldname": "menu_background_color", 445 | "fieldtype": "Color", 446 | "label": "Menu Background Color" 447 | }, 448 | { 449 | "fieldname": "menu_item_spacing_web", 450 | "fieldtype": "Data", 451 | "label": "Menu Item Spacing" 452 | }, 453 | { 454 | "description": "Set the dropdown menu text color.", 455 | "fieldname": "dropdown_menu_color", 456 | "fieldtype": "Color", 457 | "label": "Dropdown Menu Color" 458 | }, 459 | { 460 | "fieldname": "column_break_70m0", 461 | "fieldtype": "Column Break" 462 | }, 463 | { 464 | "fieldname": "font_size_web", 465 | "fieldtype": "Data", 466 | "label": "Font Size" 467 | }, 468 | { 469 | "fieldname": "menu_text_color", 470 | "fieldtype": "Color", 471 | "label": "Menu Text Color" 472 | }, 473 | { 474 | "fieldname": "menu_alignment", 475 | "fieldtype": "Select", 476 | "label": "Menu Alignment", 477 | "options": "left\ncenter\nright" 478 | }, 479 | { 480 | "fieldname": "dropdown_menu_hover_background_color", 481 | "fieldtype": "Color", 482 | "label": "Dropdown Menu Hover Background Color" 483 | }, 484 | { 485 | "default": "0", 486 | "description": "Apply box shadow for dropdown menu.", 487 | "fieldname": "apply_box_shadow", 488 | "fieldtype": "Check", 489 | "label": "Apply Box Shadow?" 490 | }, 491 | { 492 | "depends_on": "eval:doc.apply_box_shadow==1", 493 | "fieldname": "dropdown_menu_box_shadow", 494 | "fieldtype": "Data", 495 | "label": "Dropdown Menu Box Shadow" 496 | }, 497 | { 498 | "fieldname": "mobile_menu_section", 499 | "fieldtype": "Section Break", 500 | "label": "Mobile Menu" 501 | }, 502 | { 503 | "fieldname": "mobile_logo_height", 504 | "fieldtype": "Data", 505 | "label": "Mobile Logo Height" 506 | }, 507 | { 508 | "fieldname": "font_weight", 509 | "fieldtype": "Select", 510 | "label": "Font Weight", 511 | "options": "300\n400\n500\n600\n700" 512 | }, 513 | { 514 | "fieldname": "letter_spacing", 515 | "fieldtype": "Data", 516 | "label": "Letter Spacing" 517 | }, 518 | { 519 | "fieldname": "menu_padding", 520 | "fieldtype": "Data", 521 | "label": "Menu Padding" 522 | }, 523 | { 524 | "fieldname": "back_button_margin", 525 | "fieldtype": "Data", 526 | "label": "Back Button Margin" 527 | }, 528 | { 529 | "fieldname": "column_break_ofmt", 530 | "fieldtype": "Column Break" 531 | }, 532 | { 533 | "fieldname": "mobile_menu_background", 534 | "fieldtype": "Color", 535 | "label": "Mobile Menu Background" 536 | }, 537 | { 538 | "fieldname": "font_size", 539 | "fieldtype": "Data", 540 | "label": "Font Size" 541 | }, 542 | { 543 | "fieldname": "color", 544 | "fieldtype": "Color", 545 | "label": "Color" 546 | }, 547 | { 548 | "fieldname": "back_button_text_color", 549 | "fieldtype": "Color", 550 | "label": "Back Button Text Color" 551 | }, 552 | { 553 | "fieldname": "column_break_bt69", 554 | "fieldtype": "Column Break" 555 | }, 556 | { 557 | "fieldname": "font_family_mob", 558 | "fieldtype": "Data", 559 | "label": "Font Family Mob" 560 | }, 561 | { 562 | "fieldname": "line_height_mob", 563 | "fieldtype": "Data", 564 | "label": "Line Height Mob" 565 | }, 566 | { 567 | "fieldname": "hover_color", 568 | "fieldtype": "Color", 569 | "label": "Hover Color" 570 | }, 571 | { 572 | "fieldname": "back_button_background", 573 | "fieldtype": "Color", 574 | "label": "Back Button Background" 575 | }, 576 | { 577 | "fieldname": "footer_settings_tab", 578 | "fieldtype": "Tab Break", 579 | "hidden": 1, 580 | "label": "Footer Settings" 581 | }, 582 | { 583 | "fieldname": "design_section", 584 | "fieldtype": "Section Break", 585 | "label": "Design" 586 | }, 587 | { 588 | "fieldname": "footer_bg_color", 589 | "fieldtype": "Color", 590 | "label": "Background Color" 591 | }, 592 | { 593 | "fieldname": "background_image", 594 | "fieldtype": "Attach", 595 | "label": "Background Image" 596 | }, 597 | { 598 | "fieldname": "column_break_nkpd", 599 | "fieldtype": "Column Break" 600 | }, 601 | { 602 | "fieldname": "link_color", 603 | "fieldtype": "Color", 604 | "label": "Link color" 605 | }, 606 | { 607 | "fieldname": "column_break_cxax", 608 | "fieldtype": "Column Break" 609 | }, 610 | { 611 | "fieldname": "link_hover_color", 612 | "fieldtype": "Color", 613 | "label": "Link Hover Color" 614 | }, 615 | { 616 | "fieldname": "footer_tile_style_section", 617 | "fieldtype": "Section Break", 618 | "label": "Footer Title Style" 619 | }, 620 | { 621 | "fieldname": "footer_font_family", 622 | "fieldtype": "Data", 623 | "label": "Font Family" 624 | }, 625 | { 626 | "fieldname": "footer_line_height", 627 | "fieldtype": "Data", 628 | "label": "Line Height" 629 | }, 630 | { 631 | "fieldname": "column_break_mlr7", 632 | "fieldtype": "Column Break" 633 | }, 634 | { 635 | "fieldname": "footer_font_weight", 636 | "fieldtype": "Select", 637 | "label": "Font Weight", 638 | "options": "\n300\n400\n500\n600\n700" 639 | }, 640 | { 641 | "fieldname": "footer_letter_spacing", 642 | "fieldtype": "Data", 643 | "label": "Letter Spacing" 644 | }, 645 | { 646 | "fieldname": "column_break_wav1", 647 | "fieldtype": "Column Break" 648 | }, 649 | { 650 | "fieldname": "footer_font_size", 651 | "fieldtype": "Data", 652 | "label": "Font Size" 653 | }, 654 | { 655 | "fieldname": "footer_text_color", 656 | "fieldtype": "Color", 657 | "label": "Text Color" 658 | }, 659 | { 660 | "fieldname": "footer_text_style_section", 661 | "fieldtype": "Section Break", 662 | "label": "Footer Text Style" 663 | }, 664 | { 665 | "fieldname": "ft_font_family", 666 | "fieldtype": "Data", 667 | "label": "Font Family" 668 | }, 669 | { 670 | "fieldname": "ft_line_height", 671 | "fieldtype": "Data", 672 | "label": "Line Height" 673 | }, 674 | { 675 | "fieldname": "column_break_mp7o", 676 | "fieldtype": "Column Break" 677 | }, 678 | { 679 | "fieldname": "ft_font_weight", 680 | "fieldtype": "Select", 681 | "label": "Font Weight", 682 | "options": "\n300\n400\n500\n600\n700" 683 | }, 684 | { 685 | "fieldname": "ft_letter_spacing", 686 | "fieldtype": "Data", 687 | "label": "Letter Spacing" 688 | }, 689 | { 690 | "fieldname": "column_break_hq1c", 691 | "fieldtype": "Column Break" 692 | }, 693 | { 694 | "fieldname": "ft_font_size", 695 | "fieldtype": "Data", 696 | "label": "Font Size" 697 | }, 698 | { 699 | "fieldname": "ft_text_color", 700 | "fieldtype": "Color", 701 | "label": "Text Color" 702 | }, 703 | { 704 | "fieldname": "copyright_section", 705 | "fieldtype": "Section Break", 706 | "label": "Copyright" 707 | }, 708 | { 709 | "default": "0", 710 | "fieldname": "enable_copyright", 711 | "fieldtype": "Check", 712 | "label": "Enable Copyright" 713 | }, 714 | { 715 | "depends_on": "eval:doc.enable_copyright==1", 716 | "fieldname": "copyright_content", 717 | "fieldtype": "Small Text", 718 | "label": "Copyright Content" 719 | }, 720 | { 721 | "fieldname": "copyright_content_style_section", 722 | "fieldtype": "Section Break", 723 | "label": "Copyright Content Style" 724 | }, 725 | { 726 | "fieldname": "cr_font_size", 727 | "fieldtype": "Data", 728 | "label": "Font Size" 729 | }, 730 | { 731 | "default": "0", 732 | "fieldname": "enable_footer_border", 733 | "fieldtype": "Check", 734 | "label": "Enable Footer Border" 735 | }, 736 | { 737 | "depends_on": "eval:doc.enable_footer_border==1", 738 | "fieldname": "footer_border_color", 739 | "fieldtype": "Color", 740 | "label": "Footer Border Color" 741 | }, 742 | { 743 | "fieldname": "cr_vertical_padding", 744 | "fieldtype": "Data", 745 | "label": "Vertical Padding" 746 | }, 747 | { 748 | "fieldname": "column_break_2ctp", 749 | "fieldtype": "Column Break" 750 | }, 751 | { 752 | "fieldname": "cr_background_color", 753 | "fieldtype": "Color", 754 | "label": "Background Color" 755 | }, 756 | { 757 | "fieldname": "cr_text_color", 758 | "fieldtype": "Color", 759 | "label": "Text Color" 760 | }, 761 | { 762 | "fieldname": "column_break_ckph", 763 | "fieldtype": "Column Break" 764 | }, 765 | { 766 | "fieldname": "cr_link_color", 767 | "fieldtype": "Color", 768 | "label": "Link Color" 769 | }, 770 | { 771 | "fieldname": "cr_link_hover_color", 772 | "fieldtype": "Color", 773 | "label": "Link Hover Color" 774 | }, 775 | { 776 | "fieldname": "column_break_191t", 777 | "fieldtype": "Column Break" 778 | }, 779 | { 780 | "fieldname": "description", 781 | "fieldtype": "Small Text", 782 | "label": "Description" 783 | }, 784 | { 785 | "fieldname": "section_break_cyvu", 786 | "fieldtype": "Section Break" 787 | }, 788 | { 789 | "fieldname": "category_details", 790 | "fieldtype": "Table", 791 | "label": "Category Details", 792 | "options": "Theme Category Details" 793 | } 794 | ], 795 | "index_web_pages_for_search": 1, 796 | "links": [], 797 | "modified": "2024-09-21 15:30:56.977541", 798 | "modified_by": "Administrator", 799 | "module": "Go1 Webshop", 800 | "name": "Go1 Webshop Theme", 801 | "naming_rule": "By fieldname", 802 | "owner": "Administrator", 803 | "permissions": [ 804 | { 805 | "create": 1, 806 | "delete": 1, 807 | "email": 1, 808 | "export": 1, 809 | "print": 1, 810 | "read": 1, 811 | "report": 1, 812 | "role": "System Manager", 813 | "share": 1, 814 | "write": 1 815 | }, 816 | { 817 | "create": 1, 818 | "delete": 1, 819 | "email": 1, 820 | "export": 1, 821 | "print": 1, 822 | "read": 1, 823 | "report": 1, 824 | "role": "Guest", 825 | "share": 1, 826 | "write": 1 827 | } 828 | ], 829 | "sort_field": "modified", 830 | "sort_order": "DESC", 831 | "states": [] 832 | } -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/go1_webshop_theme/go1_webshop_theme.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2024, tridotstech and contributors 2 | # For license information, please see license.txt 3 | 4 | import frappe 5 | import os 6 | from frappe.model.document import Document 7 | 8 | 9 | class Go1WebshopTheme(Document): 10 | def on_update(self): 11 | css_content = log_css_template(self.name) 12 | self.create_theme_directory(css_content) 13 | 14 | def create_theme_directory(self, css_content): 15 | theme_route = self.get("theme_route") 16 | 17 | if theme_route: 18 | directory_path = os.path.join(frappe.get_module_path("go1_webshop"), theme_route.replace(' ', '_').lower()) 19 | theme_path = os.path.join(directory_path, "themes",theme_route) 20 | if not os.path.exists(theme_path): 21 | os.makedirs(theme_path) 22 | new_file_path = os.path.join(theme_path, "theme.css") 23 | if os.path.exists(new_file_path): 24 | with open(new_file_path, 'w') as css_data: 25 | css_data.write(css_content) 26 | frappe.log_error("CSS Content Updated", css_data) 27 | 28 | else: 29 | frappe.log_error("Theme route is not set for the theme", title="Theme Route Error") 30 | 31 | 32 | @frappe.whitelist() 33 | def get_curnet_doc(webshop_settings): 34 | theme = frappe.get_doc("Go1 Webshop Theme", {"theme_route":webshop_settings}) 35 | frappe.log_error("theme",theme) 36 | return theme 37 | 38 | 39 | @frappe.whitelist() 40 | def log_css_template(doc_name): 41 | doc = frappe.get_doc("Go1 Webshop Theme", doc_name) 42 | doc_values = doc.as_dict() 43 | system_fields = {"doctype", "name", "owner", "creation", "modified", "modified_by", "idx", "docstatus"} 44 | filtered_doc_values = {key: value for key, value in doc_values.items() if key not in system_fields} 45 | template_path = "go1_webshop/public/root.css" 46 | css_content = frappe.get_template(template_path).render(doc = filtered_doc_values) 47 | # frappe.log_error(message = css_content, title = "CSS Template Content") 48 | return css_content 49 | 50 | 51 | @frappe.whitelist() 52 | def get_css_content(theme): 53 | module_path = frappe.get_module_path("go1_webshop") 54 | new_file_path = os.path.join(module_path, "themes", theme, "theme.css") 55 | if os.path.exists(new_file_path): 56 | with open(new_file_path, 'r') as css_data: 57 | return css_data.read() -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/go1_webshop_theme/test_go1_webshop_theme.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2024, tridotstech and Contributors 2 | # See license.txt 3 | 4 | import frappe 5 | from frappe.tests.utils import FrappeTestCase 6 | 7 | 8 | class TestGo1WebshopTheme(FrappeTestCase): 9 | pass 10 | -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/go1_webshop_theme_settings/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/go1_webshop/doctype/go1_webshop_theme_settings/__init__.py -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/go1_webshop_theme_settings/__pycache__/__init__.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/go1_webshop/doctype/go1_webshop_theme_settings/__pycache__/__init__.cpython-311.pyc -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/go1_webshop_theme_settings/__pycache__/go1_webshop_theme_settings.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/go1_webshop/doctype/go1_webshop_theme_settings/__pycache__/go1_webshop_theme_settings.cpython-311.pyc -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/go1_webshop_theme_settings/go1_webshop_theme_settings.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, tridotstech and contributors 2 | // For license information, please see license.txt 3 | 4 | // frappe.ui.form.on("Go1 Webshop Theme Settings", { 5 | // refresh(frm) { 6 | 7 | // }, 8 | // }); 9 | -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/go1_webshop_theme_settings/go1_webshop_theme_settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "actions": [], 3 | "allow_rename": 1, 4 | "creation": "2024-08-03 11:23:34.467585", 5 | "doctype": "DocType", 6 | "engine": "InnoDB", 7 | "field_order": [ 8 | "url", 9 | "column_break_9zuw", 10 | "api_key", 11 | "column_break_u21r", 12 | "api_secret" 13 | ], 14 | "fields": [ 15 | { 16 | "default": "https://go1themes.tridotstech.com/", 17 | "fieldname": "url", 18 | "fieldtype": "Data", 19 | "in_list_view": 1, 20 | "label": "External URL", 21 | "reqd": 1 22 | }, 23 | { 24 | "fieldname": "column_break_9zuw", 25 | "fieldtype": "Column Break" 26 | }, 27 | { 28 | "fieldname": "api_key", 29 | "fieldtype": "Data", 30 | "in_list_view": 1, 31 | "label": "API Key", 32 | "read_only": 1 33 | }, 34 | { 35 | "fieldname": "column_break_u21r", 36 | "fieldtype": "Column Break" 37 | }, 38 | { 39 | "fieldname": "api_secret", 40 | "fieldtype": "Data", 41 | "in_list_view": 1, 42 | "label": "API Secret", 43 | "read_only": 1 44 | } 45 | ], 46 | "index_web_pages_for_search": 1, 47 | "issingle": 1, 48 | "links": [], 49 | "modified": "2024-10-01 14:42:08.315641", 50 | "modified_by": "Administrator", 51 | "module": "Go1 Webshop", 52 | "name": "Go1 Webshop Theme Settings", 53 | "owner": "Administrator", 54 | "permissions": [ 55 | { 56 | "create": 1, 57 | "delete": 1, 58 | "email": 1, 59 | "print": 1, 60 | "read": 1, 61 | "role": "System Manager", 62 | "share": 1, 63 | "write": 1 64 | } 65 | ], 66 | "sort_field": "modified", 67 | "sort_order": "DESC", 68 | "states": [] 69 | } -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/go1_webshop_theme_settings/go1_webshop_theme_settings.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2024, tridotstech and contributors 2 | # For license information, please see license.txt 3 | 4 | # import frappe 5 | from frappe.model.document import Document 6 | 7 | 8 | class Go1WebshopThemeSettings(Document): 9 | pass 10 | -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/go1_webshop_theme_settings/test_go1_webshop_theme_settings.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2024, tridotstech and Contributors 2 | # See license.txt 3 | 4 | # import frappe 5 | from frappe.tests.utils import FrappeTestCase 6 | 7 | 8 | class TestGo1WebshopThemeSettings(FrappeTestCase): 9 | pass 10 | -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/mobile_menu/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/go1_webshop/doctype/mobile_menu/__init__.py -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/mobile_menu/__pycache__/__init__.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/go1_webshop/doctype/mobile_menu/__pycache__/__init__.cpython-311.pyc -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/mobile_menu/__pycache__/mobile_menu.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/go1_webshop/doctype/mobile_menu/__pycache__/mobile_menu.cpython-311.pyc -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/mobile_menu/mobile_menu.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, tridotstech and contributors 2 | // For license information, please see license.txt 3 | 4 | // frappe.ui.form.on("Mobile Menu", { 5 | // refresh(frm) { 6 | 7 | // }, 8 | // }); 9 | -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/mobile_menu/mobile_menu.json: -------------------------------------------------------------------------------- 1 | { 2 | "actions": [], 3 | "allow_rename": 1, 4 | "autoname": "MENU-.###", 5 | "creation": "2024-02-22 13:20:35.144771", 6 | "doctype": "DocType", 7 | "engine": "InnoDB", 8 | "field_order": [ 9 | "label", 10 | "route", 11 | "column_break_xari", 12 | "icon", 13 | "display_order" 14 | ], 15 | "fields": [ 16 | { 17 | "fieldname": "label", 18 | "fieldtype": "Data", 19 | "label": "Label" 20 | }, 21 | { 22 | "fieldname": "route", 23 | "fieldtype": "Data", 24 | "label": "Route" 25 | }, 26 | { 27 | "fieldname": "column_break_xari", 28 | "fieldtype": "Column Break" 29 | }, 30 | { 31 | "fieldname": "icon", 32 | "fieldtype": "Attach", 33 | "label": "Icon" 34 | }, 35 | { 36 | "fieldname": "display_order", 37 | "fieldtype": "Int", 38 | "label": "Display Order" 39 | } 40 | ], 41 | "index_web_pages_for_search": 1, 42 | "links": [], 43 | "modified": "2024-03-05 17:58:35.461097", 44 | "modified_by": "Administrator", 45 | "module": "Go1 Webshop", 46 | "name": "Mobile Menu", 47 | "naming_rule": "Expression (old style)", 48 | "owner": "Administrator", 49 | "permissions": [ 50 | { 51 | "create": 1, 52 | "delete": 1, 53 | "email": 1, 54 | "export": 1, 55 | "print": 1, 56 | "read": 1, 57 | "report": 1, 58 | "role": "System Manager", 59 | "share": 1, 60 | "write": 1 61 | } 62 | ], 63 | "sort_field": "modified", 64 | "sort_order": "DESC", 65 | "states": [] 66 | } -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/mobile_menu/mobile_menu.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2024, tridotstech and contributors 2 | # For license information, please see license.txt 3 | 4 | # import frappe 5 | from frappe.model.document import Document 6 | 7 | 8 | class MobileMenu(Document): 9 | pass 10 | -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/mobile_menu/test_mobile_menu.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2024, tridotstech and Contributors 2 | # See license.txt 3 | 4 | # import frappe 5 | from frappe.tests.utils import FrappeTestCase 6 | 7 | 8 | class TestMobileMenu(FrappeTestCase): 9 | pass 10 | -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/override_doctype/__pycache__/builder_page.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/go1_webshop/doctype/override_doctype/__pycache__/builder_page.cpython-311.pyc -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/override_doctype/builder_page.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023, asdf and contributors 2 | # For license information, please see license.txt 3 | 4 | import contextlib 5 | import os 6 | import re 7 | import requests 8 | import bs4 as bs 9 | import frappe 10 | import frappe.utils 11 | from builder.html_preview_image import generate_preview 12 | from frappe.utils.caching import redis_cache 13 | from frappe.utils.jinja import render_template 14 | from frappe.utils.safe_exec import safe_exec, is_safe_exec_enabled 15 | from frappe.website.page_renderers.document_page import DocumentPage 16 | from frappe.website.path_resolver import evaluate_dynamic_routes 17 | from frappe.website.path_resolver import resolve_path as original_resolve_path 18 | from frappe.website.serve import get_response_content 19 | from frappe.website.website_generator import WebsiteGenerator 20 | from jinja2.exceptions import TemplateSyntaxError 21 | from werkzeug.routing import Rule 22 | from builder.utils import safer_exec 23 | try: 24 | from go1_webshop.go1_webshop.doctype.go1_webshop_theme.go1_webshop_theme import log_css_template, get_css_content, get_curnet_doc 25 | except ImportError: 26 | pass 27 | 28 | MOBILE_BREAKPOINT = 576 29 | TABLET_BREAKPOINT = 768 30 | DESKTOP_BREAKPOINT = 1024 31 | 32 | 33 | class BuilderPageRenderer(DocumentPage): 34 | def can_render(self): 35 | if page := find_page_with_path(self.path): 36 | self.doctype = "Builder Page" 37 | self.docname = page 38 | return True 39 | 40 | for d in get_web_pages_with_dynamic_routes(): 41 | if evaluate_dynamic_routes( 42 | [Rule(f"/{d.route}", endpoint=d.name)], self.path 43 | ): 44 | self.doctype = "Builder Page" 45 | self.docname = d.name 46 | return True 47 | 48 | return False 49 | 50 | 51 | class BuilderPage(WebsiteGenerator): 52 | def add_comment( 53 | self, 54 | comment_type="Comment", 55 | text=None, 56 | comment_email=None, 57 | comment_by=None, 58 | ): 59 | if comment_type in ["Attachment Removed", "Attachment"]: 60 | return 61 | super().add_comment( 62 | comment_type=comment_type, 63 | text=text, 64 | comment_email=comment_email, 65 | comment_by=comment_by, 66 | ) 67 | 68 | def before_insert(self): 69 | if isinstance(self.blocks, list): 70 | self.blocks = frappe.as_json(self.blocks, indent=None) 71 | if isinstance(self.draft_blocks, list): 72 | self.draft_blocks = frappe.as_json(self.draft_blocks, indent=None) 73 | if not self.blocks: 74 | self.blocks = "[]" 75 | if self.preview: 76 | self.flags.skip_preview = True 77 | else: 78 | self.preview = "/assets/builder/images/fallback.png" 79 | self.route = f"pages/{camel_case_to_kebab_case(self.page_title, True)}-{frappe.generate_hash(length=4)}" 80 | 81 | def on_update(self): 82 | if self.has_value_changed("dynamic_route") or self.has_value_changed("route"): 83 | get_web_pages_with_dynamic_routes.clear_cache() 84 | find_page_with_path.clear_cache() 85 | 86 | def autoname(self): 87 | if not self.name: 88 | self.name = f"page-{frappe.generate_hash(length=5)}" 89 | 90 | @frappe.whitelist() 91 | def publish(self, **kwargs): 92 | frappe.form_dict.update(kwargs) 93 | self.published = 1 94 | if self.draft_blocks: 95 | self.blocks = self.draft_blocks 96 | self.draft_blocks = None 97 | self.save() 98 | frappe.enqueue_doc( 99 | self.doctype, 100 | self.name, 101 | "generate_page_preview_image", 102 | queue="short", 103 | ) 104 | return self.route 105 | 106 | website = frappe._dict( 107 | template="templates/generators/webpage.html", 108 | condition_field="published", 109 | page_title_field="page_title", 110 | ) 111 | 112 | def get_context(self, context): 113 | page_data = self.get_page_data() 114 | if page_data.get("title"): 115 | context.title = page_data.get("page_title") 116 | 117 | blocks = self.blocks 118 | context.preview = frappe.flags.show_preview 119 | 120 | if self.dynamic_route or page_data: 121 | context.no_cache = 1 122 | 123 | if frappe.flags.show_preview and self.draft_blocks: 124 | blocks = self.draft_blocks 125 | 126 | css_content = '' 127 | try: 128 | webshop_settings = frappe.db.get_value("Go1 Webshop Settings", "Go1 Webshop Settings", "selected_theme") 129 | webshop_theme = get_curnet_doc(webshop_settings) 130 | if webshop_theme: 131 | css_content = get_css_content(webshop_settings) 132 | 133 | except requests.exceptions.HTTPError as e: 134 | frappe.log_error(message=e, title="Error fetching data") 135 | 136 | content, style, fonts = get_block_html(blocks) 137 | context.fonts = fonts 138 | context.content = content 139 | css_content_details = css_content 140 | frappe.log_error("css_content_details", css_content_details) 141 | context.style = style + f"" 142 | context.editor_link = f"/builder/page/{self.name}" 143 | context.base_url = frappe.utils.get_url(".") 144 | 145 | self.set_style_and_script(context) 146 | context.update(page_data) 147 | 148 | self.set_meta_tags(context=context, page_data=page_data) 149 | try: 150 | context["content"] = render_template(context.content, context) 151 | except TemplateSyntaxError: 152 | raise 153 | 154 | def set_meta_tags(self, context, page_data={}): 155 | metatags = { 156 | "title": self.page_title or "My Page", 157 | "description": self.meta_description or self.page_title, 158 | "image": self.meta_image or self.preview, 159 | } 160 | metatags.update(page_data.get("metatags", {})) 161 | context.metatags = metatags 162 | 163 | def is_component_used(self, component_id): 164 | if self.blocks and is_component_used(self.blocks, component_id): 165 | return True 166 | elif self.draft_blocks and is_component_used(self.draft_blocks, component_id): 167 | return True 168 | 169 | def set_style_and_script(self, context): 170 | for script in self.get("client_scripts", []): 171 | script_doc = frappe.get_cached_doc( 172 | "Builder Client Script", script.builder_script 173 | ) 174 | if script_doc.script_type == "JavaScript": 175 | context.setdefault("scripts", []).append(script_doc.public_url) 176 | else: 177 | context.setdefault("styles", []).append(script_doc.public_url) 178 | 179 | builder_settings = frappe.get_cached_doc("Builder Settings", "Builder Settings") 180 | if builder_settings.script: 181 | context.setdefault("scripts", []).append(builder_settings.script_public_url) 182 | if builder_settings.style: 183 | context.setdefault("styles", []).append(builder_settings.style_public_url) 184 | 185 | @frappe.whitelist() 186 | def get_page_data(self, args=None): 187 | if args: 188 | args = frappe.parse_json(args) 189 | frappe.form_dict.update(args) 190 | page_data = frappe._dict() 191 | _locals = dict(data=frappe._dict()) 192 | builder_server_script = frappe.db.get_single_value("Builder Settings","custom_server_script") 193 | frappe.log_error(title="_locals_locals",message=_locals) 194 | if builder_server_script: 195 | if is_safe_exec_enabled(): 196 | frappe.log_error("Name", self.name) 197 | safe_exec(builder_server_script, None, _locals, script_filename=self.name) 198 | else: 199 | safer_exec(builder_server_script, None, _locals, script_filename=self.name) 200 | page_data.update(_locals["data"]) 201 | if self.page_data_script: 202 | # frappe.log_error(title="_locals",message=_locals) 203 | if is_safe_exec_enabled(): 204 | safe_exec(self.page_data_script, None, _locals, script_filename=self.name) 205 | else: 206 | safer_exec(self.page_data_script, None, _locals, script_filename=self.name) 207 | page_data.update(_locals["data"]) 208 | return page_data 209 | 210 | def generate_page_preview_image(self, html=None): 211 | file_name = f"{self.name}{frappe.generate_hash()}.jpeg" 212 | generate_preview( 213 | html or get_response_content(self.route), 214 | os.path.join(frappe.local.site_path, "public", "files", file_name), 215 | ) 216 | with contextlib.suppress(frappe.DoesNotExistError): 217 | attached_files = frappe.get_all( 218 | "File", 219 | { 220 | "attached_to_field": "preview", 221 | "attached_to_doctype": "Builder Page", 222 | "attached_to_name": self.name, 223 | }, 224 | ) 225 | for file in attached_files: 226 | preview_file = frappe.get_doc("File", file.name) 227 | preview_file.delete(ignore_permissions=True) 228 | 229 | self.db_set("preview", f"/files/{file_name}", commit=True) 230 | 231 | 232 | def get_block_html(blocks, page_data={}): 233 | blocks = frappe.parse_json(blocks) 234 | if not isinstance(blocks, list): 235 | blocks = [blocks] 236 | soup = bs.BeautifulSoup("", "html.parser") 237 | style_tag = soup.new_tag("style") 238 | font_map = {} 239 | 240 | def get_html(blocks, soup): 241 | html = "" 242 | 243 | def get_tag(block, soup, data_key=None): 244 | block = extend_with_component(block) 245 | set_dynamic_content_placeholder(block, data_key) 246 | element = block.get("originalElement") or block.get("element") 247 | 248 | if not element: 249 | return "" 250 | 251 | classes = block.get("classes", []) 252 | if element in ( 253 | "span", 254 | "h1", 255 | "p", 256 | "b", 257 | "h2", 258 | "h3", 259 | "h4", 260 | "h5", 261 | "h6", 262 | "label", 263 | "a", 264 | ): 265 | classes.append("__text_block__") 266 | 267 | # temp fix: since p inside p is illegal 268 | if element in ["p", "__raw_html__"]: 269 | element = "div" 270 | 271 | # temp fix: since img src is not absolute, it doesn't load in preview 272 | image_src = block.get("attributes", {}).get("src") or "" 273 | if element == "img" and image_src.startswith("/"): 274 | block["attributes"]["src"] = frappe.utils.get_url(image_src) 275 | 276 | tag = soup.new_tag(element) 277 | tag.attrs = block.get("attributes", {}) 278 | 279 | customAttributes = block.get("customAttributes", {}) 280 | if customAttributes: 281 | for key, value in customAttributes.items(): 282 | tag[key] = value 283 | 284 | if block.get("baseStyles", {}): 285 | style_class = f"frappe-builder-{frappe.generate_hash(length=8)}" 286 | base_styles = block.get("baseStyles", {}) 287 | mobile_styles = block.get("mobileStyles", {}) 288 | tablet_styles = block.get("tabletStyles", {}) 289 | set_fonts([base_styles, mobile_styles, tablet_styles], font_map) 290 | append_style(block.get("baseStyles", {}), style_tag, style_class) 291 | plain_styles = { 292 | k: v for k, v in block.get("rawStyles", {}).items() if ":" not in k 293 | } 294 | state_styles = { 295 | k: v for k, v in block.get("rawStyles", {}).items() if ":" in k 296 | } 297 | append_style(plain_styles, style_tag, style_class) 298 | append_state_style(state_styles, style_tag, style_class) 299 | append_style( 300 | block.get("tabletStyles", {}), 301 | style_tag, 302 | style_class, 303 | device="tablet", 304 | ) 305 | append_style( 306 | block.get("mobileStyles", {}), 307 | style_tag, 308 | style_class, 309 | device="mobile", 310 | ) 311 | classes.append(style_class) 312 | 313 | tag.attrs["class"] = get_class(classes) 314 | 315 | innerContent = block.get("innerHTML") 316 | if innerContent: 317 | inner_soup = bs.BeautifulSoup(innerContent, "html.parser") 318 | set_fonts_from_html(inner_soup, font_map) 319 | tag.append(inner_soup) 320 | 321 | block_data = [] 322 | if ( 323 | block.get("isRepeaterBlock") 324 | and block.get("children") 325 | and block.get("dataKey") 326 | ): 327 | _key = block.get("dataKey").get("key") 328 | if data_key: 329 | _key = f"{data_key}.{_key}" 330 | 331 | item_key = f"key_{block.get('blockId')}" 332 | tag.append(f"{{% for {item_key} in {_key} %}}") 333 | tag.append(get_tag(block.get("children")[0], soup, item_key)) 334 | tag.append("{% endfor %}") 335 | else: 336 | for child in block.get("children", []): 337 | if child.get("visibilityCondition"): 338 | key = child.get("visibilityCondition") 339 | if data_key: 340 | key = f"{data_key}.{key}" 341 | tag.append(f"{{% if {key} %}}") 342 | tag.append(get_tag(child, soup, data_key=data_key)) 343 | if child.get("visibilityCondition"): 344 | tag.append("{% endif %}") 345 | 346 | return tag 347 | 348 | for block in blocks: 349 | html += str(get_tag(block, soup)) 350 | 351 | return html, str(style_tag), font_map 352 | 353 | data = get_html(blocks, soup) 354 | return data 355 | 356 | 357 | def get_style(style_obj): 358 | return ( 359 | "".join( 360 | f"{camel_case_to_kebab_case(key)}: {value};" 361 | for key, value in style_obj.items() if value is not None and value != "" 362 | ) 363 | if style_obj 364 | else "" 365 | ) 366 | 367 | 368 | def get_class(class_list): 369 | return " ".join(class_list) 370 | 371 | 372 | def camel_case_to_kebab_case(text, remove_spaces=False): 373 | text = re.sub(r"(? str: 563 | # to load preview without publishing 564 | frappe.form_dict.update(kwarg) 565 | renderer = BuilderPageRenderer(path="") 566 | renderer.docname = page 567 | renderer.doctype = "Builder Page" 568 | frappe.flags.show_preview = True 569 | frappe.local.no_cache = 1 570 | renderer.init_context() 571 | response = renderer.render() 572 | page = frappe.get_cached_doc("Builder Page", page) 573 | frappe.enqueue_doc( 574 | page.doctype, 575 | page.name, 576 | "generate_page_preview_image", 577 | html=str(response.data, "utf-8"), 578 | queue="short", 579 | ) 580 | return response 581 | 582 | 583 | @redis_cache(ttl=60 * 60) 584 | def find_page_with_path(route): 585 | try: 586 | return frappe.db.get_value( 587 | "Builder Page", dict(route=route, published=1), "name", cache=True 588 | ) 589 | except: 590 | pass 591 | 592 | 593 | @redis_cache(ttl=60 * 60) 594 | def get_web_pages_with_dynamic_routes() -> dict[str, str]: 595 | return frappe.get_all( 596 | "Builder Page", 597 | fields=["name", "route", "modified"], 598 | filters=dict(published=1, dynamic_route=1), 599 | update={"doctype": "Builder Page"}, 600 | ) 601 | 602 | 603 | def resolve_path(path): 604 | if find_page_with_path(path): 605 | return path 606 | elif evaluate_dynamic_routes( 607 | [ 608 | Rule(f"/{d.route}", endpoint=d.name) 609 | for d in get_web_pages_with_dynamic_routes() 610 | ], 611 | path, 612 | ): 613 | return path 614 | 615 | return original_resolve_path(path) 616 | 617 | 618 | def is_component_used(blocks, component_id): 619 | blocks = frappe.parse_json(blocks) 620 | if not isinstance(blocks, list): 621 | blocks = [blocks] 622 | 623 | for block in blocks: 624 | if not block: 625 | continue 626 | if block.get("extendedFromComponent") == component_id: 627 | return True 628 | elif block.get("children"): 629 | return is_component_used(block.get("children"), component_id) 630 | 631 | return False 632 | -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/theme_category_details/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/go1_webshop/doctype/theme_category_details/__init__.py -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/theme_category_details/__pycache__/__init__.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/go1_webshop/doctype/theme_category_details/__pycache__/__init__.cpython-311.pyc -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/theme_category_details/__pycache__/category_details.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/go1_webshop/doctype/theme_category_details/__pycache__/category_details.cpython-311.pyc -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/theme_category_details/__pycache__/theme_category_details.cpython-311.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/go1_webshop/doctype/theme_category_details/__pycache__/theme_category_details.cpython-311.pyc -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/theme_category_details/theme_category_details.json: -------------------------------------------------------------------------------- 1 | { 2 | "actions": [], 3 | "allow_rename": 1, 4 | "creation": "2024-09-21 15:23:38.491251", 5 | "doctype": "DocType", 6 | "editable_grid": 1, 7 | "engine": "InnoDB", 8 | "field_order": [ 9 | "title", 10 | "image" 11 | ], 12 | "fields": [ 13 | { 14 | "fieldname": "title", 15 | "fieldtype": "Text", 16 | "in_list_view": 1, 17 | "label": "Title", 18 | "reqd": 1 19 | }, 20 | { 21 | "fieldname": "image", 22 | "fieldtype": "Attach Image", 23 | "in_preview": 1, 24 | "label": "Image", 25 | "reqd": 1 26 | } 27 | ], 28 | "index_web_pages_for_search": 1, 29 | "istable": 1, 30 | "links": [], 31 | "modified": "2024-09-21 15:32:17.215092", 32 | "modified_by": "Administrator", 33 | "module": "Go1 Webshop", 34 | "name": "Theme Category Details", 35 | "owner": "Administrator", 36 | "permissions": [], 37 | "sort_field": "modified", 38 | "sort_order": "DESC", 39 | "states": [] 40 | } -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/doctype/theme_category_details/theme_category_details.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2024, tridotstech and contributors 2 | # For license information, please see license.txt 3 | 4 | # import frappe 5 | from frappe.model.document import Document 6 | 7 | 8 | class ThemeCategoryDetails(Document): 9 | pass 10 | -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/go1_webshop/favicon.ico -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/go1_webshop_files.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/go1_webshop/go1_webshop_files.zip -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/query.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors 2 | # License: GNU General Public License v3. See license.txt 3 | 4 | import frappe 5 | from frappe.utils import flt 6 | 7 | from webshop.webshop.doctype.item_review.item_review import get_customer 8 | from webshop.webshop.shopping_cart.product_info import get_product_info_for_website 9 | from webshop.webshop.utils.product import get_non_stock_item_status 10 | 11 | 12 | class ProductQuery: 13 | """Query engine for product listing 14 | 15 | Attributes: 16 | fields (list): Fields to fetch in query 17 | conditions (string): Conditions for query building 18 | or_conditions (string): Search conditions 19 | page_length (Int): Length of page for the query 20 | settings (Document): Webshop Settings DocType 21 | """ 22 | 23 | def __init__(self): 24 | self.settings = frappe.get_doc("Webshop Settings") 25 | self.page_length = self.settings.products_per_page or 20 26 | 27 | self.or_filters = [] 28 | self.filters = [["published", "=", 1]] 29 | self.fields = [ 30 | "web_item_name", 31 | "name", 32 | "item_name", 33 | "item_code", 34 | "website_image", 35 | "variant_of", 36 | "has_variants", 37 | "item_group", 38 | "web_long_description", 39 | "short_description", 40 | "route", 41 | "website_warehouse", 42 | "ranking", 43 | "on_backorder", 44 | ] 45 | 46 | def query(self, attributes=None, fields=None, search_term=None, start=0, item_group=None,sort_by=None): 47 | """ 48 | Args: 49 | attributes (dict, optional): Item Attribute filters 50 | fields (dict, optional): Field level filters 51 | search_term (str, optional): Search term to lookup 52 | start (int, optional): Page start 53 | 54 | Returns: 55 | dict: Dict containing items, item count & discount range 56 | """ 57 | # track if discounts included in field filters 58 | self.filter_with_discount = bool(fields.get("discount")) 59 | result, discount_list, website_item_groups, cart_items, count = [], [], [], [], 0 60 | 61 | if fields: 62 | self.build_fields_filters(fields) 63 | if item_group: 64 | self.build_item_group_filters(item_group) 65 | if search_term: 66 | self.build_search_filters(search_term) 67 | if self.settings.hide_variants: 68 | self.filters.append(["variant_of", "is", "not set"]) 69 | 70 | # query results 71 | if attributes: 72 | result, count = self.query_items_with_attributes(attributes, start,sort_by) 73 | else: 74 | result, count = self.query_items(start=start,sort_by=sort_by) 75 | 76 | # sort combined results by ranking 77 | result = sorted(result, key=lambda x: x.get("ranking"), reverse=True) 78 | 79 | if self.settings.enabled: 80 | cart_items = self.get_cart_items() 81 | 82 | result, discount_list = self.add_display_details(result, discount_list, cart_items) 83 | 84 | discounts = [] 85 | if discount_list: 86 | discounts = [min(discount_list), max(discount_list)] 87 | 88 | result = self.filter_results_by_discount(fields, result) 89 | 90 | return {"items": result, "items_count": count, "discounts": discounts} 91 | 92 | def query_items(self, start=0,sort_by=None ): 93 | """Build a query to fetch Website Items based on field filters.""" 94 | # MySQL does not support offset without limit, 95 | # frappe does not accept two parameters for limit 96 | # https://dev.mysql.com/doc/refman/8.0/en/select.html#id4651989 97 | frappe.log_error("sort_by",sort_by) 98 | count_items = frappe.db.get_all( 99 | "Website Item", 100 | filters=self.filters, 101 | or_filters=self.or_filters, 102 | limit_page_length=184467440737095516, 103 | limit_start=start, # get all items from this offset for total count ahead 104 | order_by = sort_by if sort_by else 'web_item_name desc', 105 | # order_by = 'modified desc', 106 | ) 107 | count = len(count_items) 108 | 109 | # If discounts included, return all rows. 110 | # Slice after filtering rows with discount (See `filter_results_by_discount`). 111 | # Slicing before hand will miss discounted items on the 3rd or 4th page. 112 | # Discounts are fetched on computing Pricing Rules so we cannot query them directly. 113 | page_length = 184467440737095516 if self.filter_with_discount else self.page_length 114 | 115 | items = frappe.db.get_all( 116 | "Website Item", 117 | fields=self.fields, 118 | filters=self.filters, 119 | or_filters=self.or_filters, 120 | limit_page_length=page_length, 121 | limit_start=start, 122 | order_by= sort_by if sort_by else 'web_item_name desc', 123 | ) 124 | 125 | return items, count 126 | 127 | def query_items_with_attributes(self, attributes, start=0,sort_by=None): 128 | """Build a query to fetch Website Items based on field & attribute filters.""" 129 | item_codes = [] 130 | 131 | for attribute, values in attributes.items(): 132 | if not isinstance(values, list): 133 | values = [values] 134 | 135 | # get items that have selected attribute & value 136 | item_code_list = frappe.db.get_all( 137 | "Item", 138 | fields=["item_code"], 139 | filters=[ 140 | ["published_in_website", "=", 1], 141 | ["Item Variant Attribute", "attribute", "=", attribute], 142 | ["Item Variant Attribute", "attribute_value", "in", values], 143 | ], 144 | ) 145 | item_codes.append({x.item_code for x in item_code_list}) 146 | 147 | if item_codes: 148 | item_codes = list(set.intersection(*item_codes)) 149 | self.filters.append(["item_code", "in", item_codes]) 150 | 151 | items, count = self.query_items(start=start,sort_by=sort_by) 152 | 153 | return items, count 154 | 155 | def build_fields_filters(self, filters): 156 | """Build filters for field values 157 | 158 | Args: 159 | filters (dict): Filters 160 | """ 161 | for field, values in filters.items(): 162 | if not values or field == "discount": 163 | continue 164 | 165 | # handle multiselect fields in filter addition 166 | meta = frappe.get_meta("Website Item", cached=True) 167 | df = meta.get_field(field) 168 | if df.fieldtype == "Table MultiSelect": 169 | child_doctype = df.options 170 | child_meta = frappe.get_meta(child_doctype, cached=True) 171 | fields = child_meta.get("fields") 172 | if fields: 173 | self.filters.append([child_doctype, fields[0].fieldname, "IN", values]) 174 | elif isinstance(values, list): 175 | # If value is a list use `IN` query 176 | self.filters.append([field, "in", values]) 177 | else: 178 | # `=` will be faster than `IN` for most cases 179 | self.filters.append([field, "=", values]) 180 | 181 | def build_item_group_filters(self, item_group): 182 | "Add filters for Item group page and include Website Item Groups." 183 | from webshop.webshop.doctype.override_doctype.item_group import get_child_groups_for_website 184 | 185 | item_group_filters = [] 186 | 187 | item_group_filters.append(["Website Item", "item_group", "=", item_group]) 188 | # Consider Website Item Groups 189 | item_group_filters.append(["Website Item Group", "item_group", "=", item_group]) 190 | 191 | if frappe.db.get_value("Item Group", item_group, "include_descendants"): 192 | # include child item group's items as well 193 | # eg. Group Node A, will show items of child 1 and child 2 as well 194 | # on it's web page 195 | include_groups = get_child_groups_for_website(item_group, include_self=True) 196 | include_groups = [x.name for x in include_groups] 197 | 198 | item_group_filters.append(["Website Item", "item_group", "in", include_groups]) 199 | 200 | self.or_filters.extend(item_group_filters) 201 | 202 | def build_search_filters(self, search_term): 203 | """Query search term in specified fields 204 | 205 | Args: 206 | search_term (str): Search candidate 207 | """ 208 | # Default fields to search from 209 | default_fields = {"item_code", "item_name", "web_long_description", "item_group"} 210 | 211 | # Get meta search fields 212 | meta = frappe.get_meta("Website Item") 213 | meta_fields = set(meta.get_search_fields()) 214 | 215 | # Join the meta fields and default fields set 216 | search_fields = default_fields.union(meta_fields) 217 | if frappe.db.count("Website Item", cache=True) > 50000: 218 | search_fields.discard("web_long_description") 219 | 220 | # Build or filters for query 221 | search = "%{}%".format(search_term) 222 | for field in search_fields: 223 | self.or_filters.append([field, "like", search]) 224 | 225 | def add_display_details(self, result, discount_list, cart_items): 226 | """Add price and availability details in result.""" 227 | for item in result: 228 | product_info = get_product_info_for_website(item.item_code, skip_quotation_creation=True).get( 229 | "product_info" 230 | ) 231 | 232 | if product_info and product_info["price"]: 233 | # update/mutate item and discount_list objects 234 | self.get_price_discount_info(item, product_info["price"], discount_list) 235 | 236 | if self.settings.show_stock_availability: 237 | self.get_stock_availability(item) 238 | 239 | item.in_cart = item.item_code in cart_items 240 | 241 | item.wished = False 242 | if frappe.db.exists( 243 | "Wishlist Item", {"item_code": item.item_code, "parent": frappe.session.user} 244 | ): 245 | item.wished = True 246 | 247 | return result, discount_list 248 | 249 | def get_price_discount_info(self, item, price_object, discount_list): 250 | """Modify item object and add price details.""" 251 | fields = ["formatted_mrp", "formatted_price", "price_list_rate"] 252 | for field in fields: 253 | item[field] = price_object.get(field) 254 | 255 | if price_object.get("discount_percent"): 256 | item.discount_percent = flt(price_object.discount_percent) 257 | discount_list.append(price_object.discount_percent) 258 | 259 | if item.formatted_mrp: 260 | item.discount = price_object.get("formatted_discount_percent") or price_object.get( 261 | "formatted_discount_rate" 262 | ) 263 | 264 | def get_stock_availability(self, item): 265 | """Modify item object and add stock details.""" 266 | from webshop.templates.pages.wishlist import ( 267 | get_stock_availability as get_stock_availability_from_template, 268 | ) 269 | 270 | item.in_stock = False 271 | warehouse = item.get("website_warehouse") 272 | is_stock_item = frappe.get_cached_value("Item", item.item_code, "is_stock_item") 273 | 274 | if item.get("on_backorder"): 275 | return 276 | 277 | if not is_stock_item: 278 | if warehouse: 279 | # product bundle case 280 | item.in_stock = get_non_stock_item_status(item.item_code, "website_warehouse") 281 | else: 282 | item.in_stock = True 283 | elif warehouse: 284 | # stock item and has warehouse 285 | item.in_stock = get_stock_availability_from_template(item.item_code, warehouse) 286 | 287 | def get_cart_items(self): 288 | customer = get_customer(silent=True) 289 | if customer: 290 | quotation = frappe.get_all( 291 | "Quotation", 292 | fields=["name"], 293 | filters={ 294 | "party_name": customer, 295 | "contact_email": frappe.session.user, 296 | "order_type": "Shopping Cart", 297 | "docstatus": 0, 298 | }, 299 | order_by="modified desc", 300 | limit_page_length=1, 301 | ) 302 | if quotation: 303 | items = frappe.get_all( 304 | "Quotation Item", fields=["item_code"], filters={"parent": quotation[0].get("name")} 305 | ) 306 | items = [row.item_code for row in items] 307 | return items 308 | 309 | return [] 310 | 311 | def filter_results_by_discount(self, fields, result): 312 | if fields and fields.get("discount"): 313 | discount_percent = frappe.utils.flt(fields["discount"][0]) 314 | result = [ 315 | row 316 | for row in result 317 | if row.get("discount_percent") and row.discount_percent <= discount_percent 318 | ] 319 | 320 | if self.filter_with_discount: 321 | # no limit was added to results while querying 322 | # slice results manually 323 | result[: self.page_length] 324 | 325 | return result 326 | -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/themes/fashion_theme/theme.css: -------------------------------------------------------------------------------- 1 | body{ 2 | font-family:"InterVariable", 3 | "Inter", 4 | "-apple-system", 5 | "BlinkMacSystemFont", 6 | "Segoe UI", 7 | "Roboto", 8 | "Oxygen", 9 | "Ubuntu", 10 | "Cantarell", 11 | "Fira Sans", 12 | "Droid Sans", 13 | "Helvetica Neue", 14 | sans-serif !important; 15 | } 16 | 17 | body { 18 | -webkit-font-smoothing: antialiased; 19 | -moz-osx-font-smoothing: grayscale; 20 | font-size: var(--text-lg); 21 | font-weight: var(--weight-regular); 22 | letter-spacing: 0.02em; 23 | color: #525252; 24 | display: flex; 25 | flex-direction: column; 26 | }html, body { 27 | font-family: var(--font-stack); 28 | font-variation-settings: "opsz" 24; 29 | } 30 | .stock_not_avail { 31 | display: none; 32 | } 33 | .stock_avail { 34 | visibility: hidden; 35 | margin-bottom: -12px; 36 | } 37 | .cart_btn { 38 | width: calc(100% - 30px); 39 | margin-left: 15px; 40 | } 41 | .related_item{ 42 | height:auto !important; 43 | } 44 | .search_categories { 45 | padding: 10px 15px; 46 | float: left; 47 | width: 100%; 48 | border-bottom: 1px solid #f3f3f3; 49 | } 50 | .search_cat_title { 51 | font-size: 14px; 52 | color: #222; 53 | 54 | float: left; 55 | width: 100%; 56 | } 57 | .search_category { 58 | float: left; 59 | margin-right: 10px; 60 | background: #f3f3f3; 61 | margin-top: 10px; 62 | font-size: 13px; 63 | color: #222; 64 | padding: 3px 10px; 65 | font-weight: 500; 66 | border-radius: 5px;cursor:pointer; 67 | } 68 | /*cart*/ 69 | .flex-1{ 70 | flex: 1; 71 | } 72 | .d_flex{ 73 | display: flex; 74 | align-items: center; 75 | gap:10px; 76 | } 77 | .w-full{ 78 | width: 100%; 79 | } 80 | .cart-item{ 81 | border-bottom: 1px solid #ddd; 82 | padding:10px; 83 | } 84 | .img-info img{ 85 | max-width: 65px; 86 | 87 | } 88 | .item_name { 89 | font-size: 14px; 90 | margin-bottom: 5px; 91 | color:#222; 92 | 93 | } 94 | .item_code { 95 | display:none; 96 | } 97 | .add_button,.remove_button,.delete_button{ 98 | height: 35px; 99 | width: 35px; 100 | border-radius: 5px; 101 | display: flex; 102 | justify-content: center; 103 | align-items: center; 104 | 105 | } 106 | .remove_button{ 107 | border: 1px solid #ddd; 108 | } 109 | .add_button{ 110 | background-color:#976563; 111 | color:#fff; 112 | } 113 | .delete_button{ 114 | background-color: #ff000014; 115 | padding: 5px; 116 | height: 25px !important; 117 | width: 25px !important; 118 | } 119 | .remove_wish_button, .add_wish_button{ 120 | font-size:12px; 121 | border-radius:5px; 122 | padding:5px; 123 | gap:10px; 124 | } 125 | .remove_wish_button{ 126 | background-color: #ff000014; 127 | color:#ef4444; 128 | } 129 | .add_wish_button{ 130 | background-color:#0080001c; 131 | color:#008000; 132 | } 133 | #right-cart-container{ 134 | padding:0 !important; 135 | display: block; 136 | } 137 | .right_cart_nav.active{ 138 | color: #976563; 139 | border-color: #976563; 140 | } 141 | #side-wish-list{ 142 | display:none; 143 | } 144 | .pointer-div{ 145 | cursor:pointer; 146 | } 147 | .side-empty-item{ 148 | align-items: center; 149 | display: flex; 150 | position: absolute; 151 | top: 25%; 152 | flex-direction: column; 153 | gap: 10px; 154 | height: 200px; 155 | justify-content: center; 156 | width: 100%; 157 | } 158 | .side-empty-item img{ 159 | height: 137px; 160 | left: auto; 161 | object-fit: cover; 162 | position: static; 163 | top: auto; 164 | width: 111px; 165 | } 166 | .side-empty-item .title_text{ 167 | font-size: 14px; 168 | height: fit-content; 169 | left: auto; 170 | line-height: 1; 171 | min-width: 10px; 172 | position: static; 173 | top: auto; 174 | width: fit-content; 175 | } 176 | 177 | input:focus{ 178 | --tw-ring-color: #976563; 179 | --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); 180 | --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) #9765634f; 181 | box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow); 182 | border-color: #976563; 183 | } 184 | 185 | .go1_header_bg { 186 | 187 | background: #ffffff; 188 | 189 | 190 | max-width: 100%; 191 | padding: 20px 18px !important; 192 | 193 | 194 | 195 | 196 | padding: 20px 0px; 197 | 198 | height: 125px !important; 199 | } 200 | .go1_header_bg a img{ 201 | 202 | height: 26px; 203 | 204 | } 205 | 206 | .go1_header_bg div p{ 207 | 208 | color: #000000; 209 | 210 | } 211 | 212 | /* WEB MENU */ 213 | .header-menu{ 214 | 215 | background: #faf2f1; 216 | border-color: #faf2f1; 217 | 218 | } 219 | /* .header-menu .menu-title a div{ 220 | 221 | font-family: Inter; 222 | 223 | 224 | 225 | font-size: 14px; 226 | 227 | 228 | 229 | letter-spacing: 1px; 230 | 231 | 232 | color: #976563; 233 | 234 | } */ 235 | .header-menu .menu-title a div:hover{ 236 | 237 | color: #976563; 238 | 239 | } 240 | .active_parent:after, .hoverMenuSec:after{ 241 | 242 | background: #976563 !important; 243 | 244 | } 245 | .hoverMenuSec:hover:after { 246 | width: 65% !important; 247 | } 248 | .header-menu-items{ 249 | 250 | gap: 120px; 251 | 252 | 253 | justify-content: center; 254 | 255 | } 256 | /* #nav-drop-down, .profile_menu { 257 | 258 | background: #ffffff; 259 | 260 | 261 | box-shadow: 0 0 8px #4c4c4c; 262 | 263 | } */ 264 | 265 | 266 | .sort-label:hover{ 267 | 268 | background: #ebf8ff !important; 269 | 270 | } 271 | 272 | 273 | .sort-label:hover div p { 274 | 275 | color: #000000; 276 | 277 | } 278 | 279 | .sort-label div p{ 280 | 281 | color: #000000; 282 | 283 | } 284 | 285 | #sort-web-container { 286 | background: transparent !important; 287 | border: 0 !important; 288 | border-radius : 4px !important; 289 | padding: 0px !important; 290 | 291 | box-shadow: 0 0 8px #4c4c4c; 292 | 293 | } 294 | 295 | .sort-label { 296 | border: 0 !important; 297 | 298 | background: #ffffff !important; 299 | 300 | } 301 | 302 | 303 | .dismiss{ 304 | 305 | display: none; 306 | 307 | } 308 | .announce_bar { 309 | 310 | display: flex; 311 | background: #976563; 312 | .announce_bar .__text_block__ { 313 | color: #000000; 314 | font-size: 12px; 315 | } 316 | 317 | } 318 | .announce_bar .__text_block__ { 319 | 320 | display: flex; 321 | 322 | } 323 | .go1_header_bg p{ 324 | 325 | color: #ffffff; 326 | 327 | } 328 | .go1_header_bg div{ 329 | padding-top: 0px; 330 | } 331 | 332 | .loader{ 333 | background: linear-gradient(0deg, var(--go1-primary-color)63 33%, var(--go1-secondary-color) 100%); 334 | } 335 | 336 | 337 | .footer-tile{ 338 | 339 | padding: 5px; 340 | } 341 | .footer_title p{ 342 | 343 | font-family: 1px solid; 344 | 345 | 346 | font-weight: 900; 347 | 348 | 349 | font-size: 15px; 350 | 351 | 352 | line-height: 20px; 353 | 354 | 355 | letter-spacing: 1; 356 | 357 | 358 | color: #976563; 359 | 360 | } 361 | .footer_component{ 362 | 363 | background: #fff6f4; 364 | 365 | } 366 | .footer_text{ 367 | 368 | font-family: Inter; 369 | 370 | 371 | 372 | font-size: 14px; 373 | 374 | 375 | line-height: 30px; 376 | 377 | 378 | letter-spacing: 0px; 379 | 380 | 381 | color: #000000; 382 | 383 | 384 | transition: .2s; 385 | } 386 | .footer_text:hover{ 387 | 388 | color: #976563; 389 | 390 | transition: .2s; 391 | font-weight: 700; 392 | font-size: 14.5px; 393 | } 394 | .footer_component .cpright{ 395 | 396 | background: #976563; 397 | 398 | } 399 | .cpright .__text_block__ p{ 400 | 401 | color: #ffffff !important; 402 | 403 | 404 | } 405 | 406 | .right_cart_nav.active{ 407 | 408 | color: #976563 !important; 409 | 410 | 411 | border-color: #976563 !important; 412 | 413 | 414 | } 415 | .w-count, .c-count{ 416 | display: flex; 417 | color: #FFFFFF; 418 | align-items: center; 419 | justify-content: center; 420 | 421 | background: #976563 !important; 422 | 423 | } 424 | #side-cart-count, 425 | #right-wish-count, 426 | #move-cart-button, 427 | #checkout-button, 428 | .add_button.pointer-div{ 429 | 430 | background: #976563 !important; 431 | 432 | } 433 | 434 | 435 | .cart_btn, 436 | .plus_btn, 437 | .add_cart_btn, 438 | .place-order, 439 | .add-address, 440 | .save_btn, 441 | #order_payment, 442 | #login-btn, 443 | .login-form a, 444 | .my-order button{ 445 | 446 | background: #976563 !important; 447 | 448 | } 449 | 450 | .image_container, .minus_btn{ 451 | 452 | background: #f5f5f5 !important; 453 | 454 | } 455 | input:focus{ 456 | 457 | border-color: #976563 !important; 458 | 459 | } 460 | 461 | /* PRODUCT INFO */ 462 | 463 | .image_container{ 464 | 465 | background-color: #ffebe7 !important; 466 | 467 | } 468 | div.owl-wrapper div.owl-item { 469 | 470 | width: 308px !important; 471 | 472 | } 473 | .off_container{ 474 | 475 | width: 49% !important; 476 | transform: translateX(-22%) translateY(-68%) rotate(-46deg); 477 | 478 | 479 | } 480 | #login{ 481 | background:#ffffff !important; 482 | } 483 | #login_email,#login_password{ 484 | background: #f5f5f5; 485 | } 486 | .offer{ 487 | 488 | margin-right: 37px; 489 | 490 | } 491 | .description, .description div p{ 492 | overflow: hidden; 493 | width: 100%; 494 | text-wrap: nowrap; 495 | display: flow; 496 | height: 33px; 497 | font-weight: 200; 498 | margin-bottom: 3px; 499 | 500 | color: #818181; 501 | 502 | text-overflow: ellipsis; 503 | 504 | font-size: small; 505 | 506 | } 507 | .card_amount div{ 508 | margin-bottom: 30px; 509 | } 510 | .card_amount{ 511 | font-weight: 600; 512 | height: 30px !important; 513 | 514 | font-size: 14px; 515 | 516 | 517 | color: #976563; 518 | 519 | } 520 | @media screen and (min-width: 700px){ 521 | #home-sliders .owl-item{ 522 | width: 1366px !important; 523 | } 524 | } 525 | 526 | .image_container img{ 527 | 528 | height: 80% important; 529 | 530 | } 531 | .line_2_text_36{ 532 | overflow: hidden; 533 | width: 100%; 534 | text-wrap: wrap; 535 | display: -webkit-box; 536 | height: 40px; 537 | -webkit-line-clamp: 2; 538 | -webkit-box-orient: vertical; 539 | 540 | color: #000000; 541 | 542 | 543 | } 544 | 545 | /* MOBILE VIEW */ 546 | @media screen and (max-width: 700px){ 547 | 548 | .cart_btn_list{ 549 | position: relative !important; 550 | } 551 | .line_2_text_36{ 552 | min-height: 38px !important; 553 | } 554 | .related_item{ 555 | padding-top: 10px; 556 | } 557 | .filter_btn{ 558 | align-items: center; 559 | background: #FFFFFF; 560 | border: 0 solid #E2E8F0; 561 | box-shadow: rgba(0, 0, 0, .18) 0px 2px 7px; 562 | box-sizing: border-box; 563 | color: #1A202C; 564 | display: inline-flex; 565 | font-family: Inter, sans-serif; 566 | font-size: 1rem; 567 | font-weight: 700; 568 | height: 42px; 569 | justify-content: center; 570 | line-height: 24px; 571 | overflow-wrap: break-word; 572 | padding: 24px; 573 | text-decoration: none; 574 | width: auto; 575 | border-radius: 8px; 576 | cursor: pointer; 577 | user-select: none; 578 | -webkit-user-select: none; 579 | touch-action: manipulation; 580 | } 581 | .description, .description div p{ 582 | margin-left: 0px; 583 | } 584 | .card_amount { 585 | width: 75%; 586 | left: -50px !important; 587 | } 588 | div.owl-wrapper div.owl-item { 589 | width: 450px !important; 590 | } 591 | .image_container { 592 | padding: 0 10px !important; 593 | height: 150px; 594 | } 595 | .image_container img { 596 | object-fit: contain !important; 597 | 598 | } 599 | 600 | .go1_header_bg { 601 | 602 | background: #ffffff; 603 | 604 | height: 55px !important; 605 | padding: 10px 5px !important; 606 | } 607 | .header_back_icon ,.mobile-header-cart-count{ 608 | 609 | background: #976563; 610 | 611 | } 612 | } 613 | 614 | 615 | :root { 616 | /* GLOBAL STYLES */ 617 | --go1-primary-color: #976563 important; 618 | --go1-secondary-color: #f5f5f5 important; 619 | } 620 | 621 | -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/themes/furniture_theme/theme.css: -------------------------------------------------------------------------------- 1 | body{ 2 | font-family:"InterVariable", 3 | "Inter", 4 | "-apple-system", 5 | "BlinkMacSystemFont", 6 | "Segoe UI", 7 | "Roboto", 8 | "Oxygen", 9 | "Ubuntu", 10 | "Cantarell", 11 | "Fira Sans", 12 | "Droid Sans", 13 | "Helvetica Neue", 14 | sans-serif !important; 15 | } 16 | 17 | body { 18 | -webkit-font-smoothing: antialiased; 19 | -moz-osx-font-smoothing: grayscale; 20 | font-size: var(--text-lg); 21 | font-weight: var(--weight-regular); 22 | letter-spacing: 0.02em; 23 | color: #525252; 24 | display: flex; 25 | flex-direction: column; 26 | }html, body { 27 | font-family: var(--font-stack); 28 | font-variation-settings: "opsz" 24; 29 | } 30 | .stock_not_avail { 31 | display: none; 32 | } 33 | .stock_avail { 34 | visibility: hidden; 35 | margin-bottom: -12px; 36 | } 37 | .cart_btn { 38 | width: calc(100% - 30px); 39 | margin-left: 15px; 40 | } 41 | .related_item{ 42 | height:auto !important; 43 | } 44 | .search_categories { 45 | padding: 10px 15px; 46 | float: left; 47 | width: 100%; 48 | border-bottom: 1px solid #f3f3f3; 49 | } 50 | .search_cat_title { 51 | font-size: 14px; 52 | color: #222; 53 | 54 | float: left; 55 | width: 100%; 56 | } 57 | .search_category { 58 | float: left; 59 | margin-right: 10px; 60 | background: #f3f3f3; 61 | margin-top: 10px; 62 | font-size: 13px; 63 | color: #222; 64 | padding: 3px 10px; 65 | font-weight: 500; 66 | border-radius: 5px;cursor:pointer; 67 | } 68 | /*cart*/ 69 | .flex-1{ 70 | flex: 1; 71 | } 72 | .d_flex{ 73 | display: flex; 74 | align-items: center; 75 | gap:10px; 76 | } 77 | .w-full{ 78 | width: 100%; 79 | } 80 | .cart-item{ 81 | border-bottom: 1px solid #ddd; 82 | padding:10px; 83 | } 84 | .img-info img{ 85 | max-width: 65px; 86 | 87 | } 88 | .item_name { 89 | font-size: 14px; 90 | margin-bottom: 5px; 91 | color:#222; 92 | 93 | } 94 | .item_code { 95 | display:none; 96 | } 97 | .add_button,.remove_button,.delete_button{ 98 | height: 35px; 99 | width: 35px; 100 | border-radius: 5px; 101 | display: flex; 102 | justify-content: center; 103 | align-items: center; 104 | 105 | } 106 | .remove_button{ 107 | border: 1px solid #ddd; 108 | } 109 | .add_button{ 110 | background-color:#976563; 111 | color:#fff; 112 | } 113 | .delete_button{ 114 | background-color: #ff000014; 115 | padding: 5px; 116 | height: 25px !important; 117 | width: 25px !important; 118 | } 119 | .remove_wish_button, .add_wish_button{ 120 | font-size:12px; 121 | border-radius:5px; 122 | padding:5px; 123 | gap:10px; 124 | } 125 | .remove_wish_button{ 126 | background-color: #ff000014; 127 | color:#ef4444; 128 | } 129 | .add_wish_button{ 130 | background-color:#0080001c; 131 | color:#008000; 132 | } 133 | #right-cart-container{ 134 | padding:0 !important; 135 | display: block; 136 | } 137 | .right_cart_nav.active{ 138 | color: #976563; 139 | border-color: #976563; 140 | } 141 | #side-wish-list{ 142 | display:none; 143 | } 144 | .pointer-div{ 145 | cursor:pointer; 146 | } 147 | .side-empty-item{ 148 | align-items: center; 149 | display: flex; 150 | position: absolute; 151 | top: 25%; 152 | flex-direction: column; 153 | gap: 10px; 154 | height: 200px; 155 | justify-content: center; 156 | width: 100%; 157 | } 158 | .side-empty-item img{ 159 | height: 137px; 160 | left: auto; 161 | object-fit: cover; 162 | position: static; 163 | top: auto; 164 | width: 111px; 165 | } 166 | .side-empty-item .title_text{ 167 | font-size: 14px; 168 | height: fit-content; 169 | left: auto; 170 | line-height: 1; 171 | min-width: 10px; 172 | position: static; 173 | top: auto; 174 | width: fit-content; 175 | } 176 | 177 | input:focus{ 178 | --tw-ring-color: #976563; 179 | --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); 180 | --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) #9765634f; 181 | box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow); 182 | border-color: #976563; 183 | } 184 | 185 | 186 | .header-menu-items { 187 | gap: 54px !important; 188 | justify-content: space-between !important; 189 | } 190 | .go1_header_bg a img { 191 | height: 40px !important; 192 | } 193 | .description, .description div p{ 194 | display: none !important; 195 | } 196 | .cart_btn{ 197 | width: calc(100% - 30px) !important; 198 | z-index: 1; 199 | display: flex; 200 | position: relative; 201 | height: 35px; 202 | bottom: 0px; 203 | } 204 | .cart_btn div{ 205 | 206 | font-size: 16px !important; 207 | 208 | } 209 | .card_amount{ 210 | left: 11px !important; 211 | top: 10px; 212 | margin-top: 10px; 213 | } 214 | .button_env { 215 | display: none; 216 | gap: 0 !important; 217 | position: relative; 218 | justify-content: space-around; 219 | } 220 | .related_item { 221 | width: calc(33% - 10px); 222 | } 223 | 224 | .go1_header_bg { 225 | 226 | background: #ffffff; 227 | 228 | 229 | max-width: 100%; 230 | padding: 20px 18px !important; 231 | 232 | 233 | 234 | 235 | padding: 20px 0px; 236 | 237 | height: 125px !important; 238 | } 239 | .go1_header_bg a img{ 240 | 241 | height: 26px; 242 | 243 | } 244 | 245 | .go1_header_bg div p{ 246 | 247 | color: #363e51; 248 | 249 | } 250 | 251 | /* WEB MENU */ 252 | .header-menu{ 253 | 254 | background: #ffffff; 255 | border-color: #ffffff; 256 | 257 | } 258 | /* .header-menu .menu-title a div{ 259 | 260 | font-family: Inter; 261 | 262 | 263 | 264 | font-size: 14px; 265 | 266 | 267 | 268 | letter-spacing: 0px; 269 | 270 | 271 | color: #363e51; 272 | 273 | } */ 274 | .header-menu .menu-title a div:hover{ 275 | 276 | color: #363e51; 277 | 278 | } 279 | .active_parent:after, .hoverMenuSec:after{ 280 | 281 | background: #363e51 !important; 282 | 283 | } 284 | .hoverMenuSec:hover:after { 285 | width: 65% !important; 286 | } 287 | .header-menu-items{ 288 | 289 | gap: 47px; 290 | 291 | 292 | justify-content: center; 293 | 294 | } 295 | /* #nav-drop-down, .profile_menu { 296 | 297 | background: #363e51; 298 | 299 | 300 | box-shadow: 0 0 8px #4c4c4c; 301 | 302 | } */ 303 | 304 | 305 | .sort-label:hover{ 306 | 307 | background: #dff2f2 !important; 308 | 309 | } 310 | 311 | 312 | .sort-label:hover div p { 313 | 314 | color: #363e51; 315 | 316 | } 317 | 318 | .sort-label div p{ 319 | 320 | color: #ffffff; 321 | 322 | } 323 | 324 | #sort-web-container { 325 | background: transparent !important; 326 | border: 0 !important; 327 | border-radius : 4px !important; 328 | padding: 0px !important; 329 | 330 | box-shadow: 0 0 8px #4c4c4c; 331 | 332 | } 333 | 334 | .sort-label { 335 | border: 0 !important; 336 | 337 | background: #363e51 !important; 338 | 339 | } 340 | 341 | 342 | .dismiss{ 343 | 344 | display: none; 345 | 346 | } 347 | .announce_bar { 348 | 349 | display: flex; 350 | background: #363e51; 351 | .announce_bar .__text_block__ { 352 | color: #363e51; 353 | font-size: 12px; 354 | } 355 | 356 | } 357 | .announce_bar .__text_block__ { 358 | 359 | display: flex; 360 | 361 | } 362 | .go1_header_bg p{ 363 | 364 | color: #0a0a0a; 365 | 366 | } 367 | .go1_header_bg div{ 368 | padding-top: 0px; 369 | } 370 | 371 | .loader{ 372 | background: linear-gradient(0deg, var(--go1-primary-color)63 33%, var(--go1-secondary-color) 100%); 373 | } 374 | 375 | 376 | .footer-tile{ 377 | 378 | padding: 5px; 379 | } 380 | .footer_title p{ 381 | 382 | font-family: 1px solid; 383 | 384 | 385 | font-weight: 900; 386 | 387 | 388 | font-size: 15px; 389 | 390 | 391 | line-height: 20px; 392 | 393 | 394 | 395 | color: #363e51; 396 | 397 | } 398 | .footer_component{ 399 | 400 | background: #f5f5f5; 401 | 402 | } 403 | .footer_text{ 404 | 405 | font-family: Inter; 406 | 407 | 408 | 409 | font-size: 14px; 410 | 411 | 412 | line-height: 30px; 413 | 414 | 415 | letter-spacing: 0px; 416 | 417 | 418 | color: #000000; 419 | 420 | 421 | transition: .2s; 422 | } 423 | .footer_text:hover{ 424 | 425 | color: #363e51; 426 | 427 | transition: .2s; 428 | font-weight: 700; 429 | font-size: 14.5px; 430 | } 431 | .footer_component .cpright{ 432 | 433 | background: #f5f5f5; 434 | 435 | } 436 | .cpright .__text_block__ p{ 437 | 438 | color: #000000 !important; 439 | 440 | 441 | content: © 2024 Go1Furniture All Rights Reserved.; 442 | 443 | } 444 | 445 | .right_cart_nav.active{ 446 | 447 | color: #363e51 !important; 448 | 449 | 450 | border-color: #363e51 !important; 451 | 452 | 453 | } 454 | .w-count, .c-count{ 455 | display: flex; 456 | color: #FFFFFF; 457 | align-items: center; 458 | justify-content: center; 459 | 460 | background: #363e51 !important; 461 | 462 | } 463 | #side-cart-count, 464 | #right-wish-count, 465 | #move-cart-button, 466 | #checkout-button, 467 | .add_button.pointer-div{ 468 | 469 | background: #363e51 !important; 470 | 471 | } 472 | 473 | 474 | .cart_btn, 475 | .plus_btn, 476 | .add_cart_btn, 477 | .place-order, 478 | .add-address, 479 | .save_btn, 480 | #order_payment, 481 | #login-btn, 482 | .login-form a, 483 | .my-order button{ 484 | 485 | background: #363e51 !important; 486 | 487 | } 488 | 489 | .image_container, .minus_btn{ 490 | 491 | background: #f2f2f2 !important; 492 | 493 | } 494 | input:focus{ 495 | 496 | border-color: #363e51 !important; 497 | 498 | } 499 | 500 | /* PRODUCT INFO */ 501 | 502 | .image_container{ 503 | 504 | background-color: #f0f0f0 !important; 505 | 506 | } 507 | div.owl-wrapper div.owl-item { 508 | 509 | width: 308px !important; 510 | 511 | } 512 | .off_container{ 513 | 514 | 515 | } 516 | #login{ 517 | background:#ffffff !important; 518 | } 519 | #login_email,#login_password{ 520 | background: #f2f2f2; 521 | } 522 | .offer{ 523 | 524 | } 525 | .description, .description div p{ 526 | overflow: hidden; 527 | width: 100%; 528 | text-wrap: nowrap; 529 | display: flow; 530 | height: 33px; 531 | font-weight: 200; 532 | margin-bottom: 3px; 533 | 534 | text-overflow: ellipsis; 535 | 536 | } 537 | .card_amount div{ 538 | margin-bottom: 30px; 539 | } 540 | .card_amount{ 541 | font-weight: 600; 542 | height: 30px !important; 543 | 544 | font-size: 16px; 545 | 546 | 547 | color: #363e51; 548 | 549 | } 550 | @media screen and (min-width: 700px){ 551 | #home-sliders .owl-item{ 552 | width: 1366px !important; 553 | } 554 | } 555 | 556 | .image_container img{ 557 | 558 | } 559 | .line_2_text_36{ 560 | overflow: hidden; 561 | width: 100%; 562 | text-wrap: wrap; 563 | display: -webkit-box; 564 | height: 40px; 565 | -webkit-line-clamp: 2; 566 | -webkit-box-orient: vertical; 567 | 568 | color: #030303; 569 | 570 | 571 | } 572 | 573 | /* MOBILE VIEW */ 574 | @media screen and (max-width: 700px){ 575 | 576 | .cart_btn_list{ 577 | position: relative !important; 578 | } 579 | .line_2_text_36{ 580 | min-height: 38px !important; 581 | } 582 | .related_item{ 583 | padding-top: 10px; 584 | } 585 | .filter_btn{ 586 | align-items: center; 587 | background: #FFFFFF; 588 | border: 0 solid #E2E8F0; 589 | box-shadow: rgba(0, 0, 0, .18) 0px 2px 7px; 590 | box-sizing: border-box; 591 | color: #1A202C; 592 | display: inline-flex; 593 | font-family: Inter, sans-serif; 594 | font-size: 1rem; 595 | font-weight: 700; 596 | height: 42px; 597 | justify-content: center; 598 | line-height: 24px; 599 | overflow-wrap: break-word; 600 | padding: 24px; 601 | text-decoration: none; 602 | width: auto; 603 | border-radius: 8px; 604 | cursor: pointer; 605 | user-select: none; 606 | -webkit-user-select: none; 607 | touch-action: manipulation; 608 | } 609 | .description, .description div p{ 610 | margin-left: 0px; 611 | } 612 | .card_amount { 613 | width: 75%; 614 | left: -50px !important; 615 | } 616 | div.owl-wrapper div.owl-item { 617 | width: 450px !important; 618 | } 619 | .image_container { 620 | padding: 0 10px !important; 621 | height: 150px; 622 | } 623 | .image_container img { 624 | object-fit: contain !important; 625 | 626 | } 627 | 628 | .go1_header_bg { 629 | 630 | background: #ffffff; 631 | 632 | height: 55px !important; 633 | padding: 10px 5px !important; 634 | } 635 | .header_back_icon ,.mobile-header-cart-count{ 636 | 637 | background: #363e51; 638 | 639 | } 640 | } 641 | 642 | 643 | :root { 644 | /* GLOBAL STYLES */ 645 | --go1-primary-color: #363e51 important; 646 | --go1-secondary-color: #f2f2f2 important; 647 | } 648 | 649 | -------------------------------------------------------------------------------- /go1_webshop/go1_webshop/workspace/go1_webshop/go1_webshop.json: -------------------------------------------------------------------------------- 1 | { 2 | "charts": [ 3 | { 4 | "chart_name": "Sales Order Trends", 5 | "label": "Sales Order Trends" 6 | } 7 | ], 8 | "content": "[{\"id\":\"rfdw9FaPlG\",\"type\":\"custom_block\",\"data\":{\"custom_block_name\":\"Explore Go1 Webshop Themes\",\"col\":12}},{\"id\":\"izy3qGHF-_\",\"type\":\"number_card\",\"data\":{\"number_card_name\":\"Active Customers\",\"col\":4}},{\"id\":\"62Mw17GP5R\",\"type\":\"number_card\",\"data\":{\"number_card_name\":\"Annual Sales\",\"col\":4}},{\"id\":\"Yf3aSmd-NB\",\"type\":\"number_card\",\"data\":{\"number_card_name\":\"Sales Orders to Bill\",\"col\":4}},{\"id\":\"p58jwAX8pQ\",\"type\":\"number_card\",\"data\":{\"number_card_name\":\"Sales Orders to Deliver\",\"col\":4}},{\"id\":\"hCqhWjttfs\",\"type\":\"number_card\",\"data\":{\"number_card_name\":\"Total Outgoing Bills\",\"col\":4}},{\"id\":\"b2D78rtlNj\",\"type\":\"chart\",\"data\":{\"chart_name\":\"Sales Order Trends\",\"col\":12}},{\"id\":\"9Q6nNmy2ly\",\"type\":\"header\",\"data\":{\"text\":\"Quick Links\",\"col\":12}},{\"id\":\"NcaMrviFQg\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Item Group\",\"col\":3}},{\"id\":\"3opNgE_yuJ\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Item\",\"col\":3}},{\"id\":\"Or5w9ZzLOX\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Website Item\",\"col\":3}},{\"id\":\"reOTKGL--1\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Dashboard\",\"col\":3}},{\"id\":\"CeGhZhvVja\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Sales Order\",\"col\":3}},{\"id\":\"Wwy2avj6FE\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Sales Invoice\",\"col\":3}},{\"id\":\"rTWnlsX35C\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Customer\",\"col\":3}},{\"id\":\"euzPqiIJpb\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Contact\",\"col\":3}},{\"id\":\"25WXkQfysI\",\"type\":\"header\",\"data\":{\"text\":\"Settings\",\"col\":12}},{\"id\":\"-DFERRN5yQ\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Go1 Webshop Settings\",\"col\":3}},{\"id\":\"nDzzTxBJLr\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Webshop Settings\",\"col\":3}},{\"id\":\"Q9xD7g8ait\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Selling Settings\",\"col\":3}},{\"id\":\"R_JjFxdpQq\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Builder Settings\",\"col\":3}},{\"id\":\"zXrxQsocq1\",\"type\":\"header\",\"data\":{\"text\":\"Builder\",\"col\":12}},{\"id\":\"BQ1cYRPtyq\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Builder Page\",\"col\":3}},{\"id\":\"Tmg6hd2Sr9\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Builder Settings\",\"col\":3}},{\"id\":\"p5KVVvChnj\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Builder Component\",\"col\":3}},{\"id\":\"6u5tlbcpNk\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Builder Client Script\",\"col\":3}}]", 9 | "creation": "2024-08-30 14:02:39.826697", 10 | "custom_blocks": [ 11 | { 12 | "custom_block_name": "Explore Go1 Webshop Themes", 13 | "label": "Explore Go1 Webshop Themes" 14 | } 15 | ], 16 | "docstatus": 0, 17 | "doctype": "Workspace", 18 | "for_user": "", 19 | "hide_custom": 0, 20 | "icon": "image-view", 21 | "idx": 0, 22 | "indicator_color": "green", 23 | "is_hidden": 0, 24 | "label": "Go1 Webshop", 25 | "links": [], 26 | "modified": "2024-10-15 15:34:21.809060", 27 | "modified_by": "Administrator", 28 | "module": "Go1 Webshop", 29 | "name": "Go1 Webshop", 30 | "number_cards": [ 31 | { 32 | "label": "Active Customers", 33 | "number_card_name": "Active Customers" 34 | }, 35 | { 36 | "label": "Annual Sales", 37 | "number_card_name": "Annual Sales" 38 | }, 39 | { 40 | "label": "Sales Orders to Bill", 41 | "number_card_name": "Sales Orders to Bill" 42 | }, 43 | { 44 | "label": "Sales Orders to Deliver", 45 | "number_card_name": "Sales Orders to Deliver" 46 | }, 47 | { 48 | "label": "Total Outgoing Bills", 49 | "number_card_name": "Total Outgoing Bills" 50 | } 51 | ], 52 | "owner": "Administrator", 53 | "parent_page": "", 54 | "public": 1, 55 | "quick_lists": [], 56 | "roles": [], 57 | "sequence_id": 1.0, 58 | "shortcuts": [ 59 | { 60 | "color": "Grey", 61 | "doc_view": "List", 62 | "label": "Item Group", 63 | "link_to": "Item Group", 64 | "stats_filter": "[]", 65 | "type": "DocType" 66 | }, 67 | { 68 | "color": "Grey", 69 | "doc_view": "List", 70 | "label": "Dashboard", 71 | "link_to": "Selling", 72 | "type": "Dashboard" 73 | }, 74 | { 75 | "color": "Grey", 76 | "doc_view": "List", 77 | "label": "Go1 Webshop Settings", 78 | "link_to": "Go1 Webshop Settings", 79 | "type": "DocType" 80 | }, 81 | { 82 | "color": "Grey", 83 | "doc_view": "List", 84 | "label": "Contact", 85 | "link_to": "Contact", 86 | "stats_filter": "[]", 87 | "type": "DocType" 88 | }, 89 | { 90 | "color": "Grey", 91 | "doc_view": "List", 92 | "label": "Item", 93 | "link_to": "Item", 94 | "stats_filter": "[]", 95 | "type": "DocType" 96 | }, 97 | { 98 | "color": "Grey", 99 | "doc_view": "List", 100 | "label": "Webshop Settings", 101 | "link_to": "Webshop Settings", 102 | "type": "DocType" 103 | }, 104 | { 105 | "color": "Grey", 106 | "doc_view": "List", 107 | "label": "Builder Page", 108 | "link_to": "Builder Page", 109 | "stats_filter": "[]", 110 | "type": "DocType" 111 | }, 112 | { 113 | "color": "Grey", 114 | "doc_view": "List", 115 | "label": "Website Item", 116 | "link_to": "Website Item", 117 | "stats_filter": "[]", 118 | "type": "DocType" 119 | }, 120 | { 121 | "color": "Grey", 122 | "doc_view": "List", 123 | "label": "Sales Invoice", 124 | "link_to": "Sales Invoice", 125 | "stats_filter": "[]", 126 | "type": "DocType" 127 | }, 128 | { 129 | "color": "Grey", 130 | "doc_view": "List", 131 | "label": "Selling Settings", 132 | "link_to": "Selling Settings", 133 | "type": "DocType" 134 | }, 135 | { 136 | "color": "Grey", 137 | "doc_view": "List", 138 | "label": "Builder Settings", 139 | "link_to": "Builder Settings", 140 | "type": "DocType" 141 | }, 142 | { 143 | "color": "Grey", 144 | "doc_view": "List", 145 | "label": "Sales Order", 146 | "link_to": "Sales Order", 147 | "stats_filter": "[]", 148 | "type": "DocType" 149 | }, 150 | { 151 | "color": "Grey", 152 | "doc_view": "List", 153 | "label": "Customer", 154 | "link_to": "Customer", 155 | "stats_filter": "[]", 156 | "type": "DocType" 157 | }, 158 | { 159 | "color": "Grey", 160 | "doc_view": "List", 161 | "label": "Builder Component", 162 | "link_to": "Builder Component", 163 | "stats_filter": "[]", 164 | "type": "DocType" 165 | }, 166 | { 167 | "color": "Grey", 168 | "doc_view": "List", 169 | "label": "Builder Client Script", 170 | "link_to": "Builder Client Script", 171 | "stats_filter": "[]", 172 | "type": "DocType" 173 | } 174 | ], 175 | "title": "Go1 Webshop" 176 | } -------------------------------------------------------------------------------- /go1_webshop/hooks.py: -------------------------------------------------------------------------------- 1 | app_name = "go1_webshop" 2 | app_title = "Go1 Webshop" 3 | app_publisher = "tridotstech" 4 | app_description = "Ecommerce app" 5 | app_email = "info@tridotstech.com" 6 | app_license = "mit" 7 | required_apps = ["erpnext","webshop","builder"] 8 | # Includes in 9 | # ------------------ 10 | # include js, css files in header of desk.html 11 | # app_include_css = "/assets/go1_webshop/css/go1_webshop.css" 12 | # app_include_js = "/assets/go1_webshop/js/go1_webshop.js" 13 | 14 | # include js, css files in header of web template 15 | # web_include_css = "/assets/go1_webshop/css/go1_webshop.css" 16 | # web_include_js = "/assets/go1_webshop/js/go1_webshop.js" 17 | 18 | # include custom scss in every website theme (without file extension ".scss") 19 | # website_theme_scss = "go1_webshop/public/scss/website" 20 | 21 | # include js, css files in header of web form 22 | # webform_include_js = {"doctype": "public/js/doctype.js"} 23 | # webform_include_css = {"doctype": "public/css/doctype.css"} 24 | 25 | # include js in page 26 | # page_js = {"page" : "public/js/file.js"} 27 | 28 | # include js in doctype views 29 | # doctype_js = {"doctype" : "public/js/doctype.js"} 30 | # doctype_list_js = {"doctype" : "public/js/doctype_list.js"} 31 | # doctype_tree_js = {"doctype" : "public/js/doctype_tree.js"} 32 | # doctype_calendar_js = {"doctype" : "public/js/doctype_calendar.js"} 33 | # override_doctype_class = { 34 | # "Builder Page": "go1_webshop.go1_webshop.doctype.override_doctype.builder_page.BuilderPage", 35 | # } 36 | 37 | doc_events = { 38 | "Builder Page":{ 39 | "on_update":"go1_webshop.go1_webshop.api.update_global_script" 40 | }, 41 | "Builder Settings":{ 42 | "on_update":"go1_webshop.go1_webshop.api.update_global_script_builder_page" 43 | }, 44 | "Website Item":{ 45 | "validate":"go1_webshop.go1_webshop.api.update_website_item_route" 46 | }, 47 | "Item Group":{ 48 | "validate":"go1_webshop.go1_webshop.api.update_website_item_route" 49 | } 50 | } 51 | 52 | 53 | after_migrate = [ 54 | "go1_webshop.go1_webshop.after_install.insert_theme_selection_details", 55 | "go1_webshop.go1_webshop.after_install.insert_custom_block" 56 | ] 57 | 58 | # fixtures = [ 59 | # { 60 | # "doctype": "Custom Field", 61 | # "filters": [ 62 | # ["name", "in", ( 63 | # "Builder Settings-custom_server_script" 64 | # )] 65 | # ] 66 | # } 67 | # ] 68 | # Svg Icons 69 | # ------------------ 70 | # include app icons in desk 71 | # app_include_icons = "go1_webshop/public/icons.svg" 72 | 73 | # Home Pages 74 | # ---------- 75 | 76 | # application home page (will override Website Settings) 77 | # home_page = "login" 78 | 79 | # website user home page (by Role) 80 | # role_home_page = { 81 | # "Role": "home_page" 82 | # } 83 | 84 | # Generators 85 | # ---------- 86 | 87 | # automatically create page for each record of this doctype 88 | # website_generators = ["Web Page"] 89 | 90 | # Jinja 91 | # ---------- 92 | 93 | # add methods and filters to jinja environment 94 | # jinja = { 95 | # "methods": "go1_webshop.utils.jinja_methods", 96 | # "filters": "go1_webshop.utils.jinja_filters" 97 | # } 98 | 99 | # Installation 100 | # ------------ 101 | 102 | # before_install = "go1_webshop.install.before_install" 103 | # after_install = "go1_webshop.install.after_install" 104 | # after_install = "go1_webshop.go1_webshop.after_install.insert_theme_selection_details" 105 | # Uninstallation 106 | # ------------ 107 | 108 | # before_uninstall = "go1_webshop.uninstall.before_uninstall" 109 | # after_uninstall = "go1_webshop.uninstall.after_uninstall" 110 | 111 | # Integration Setup 112 | # ------------------ 113 | # To set up dependencies/integrations with other apps 114 | # Name of the app being installed is passed as an argument 115 | 116 | # before_app_install = "go1_webshop.utils.before_app_install" 117 | # after_app_install = "go1_webshop.utils.after_app_install" 118 | 119 | # Integration Cleanup 120 | # ------------------- 121 | # To clean up dependencies/integrations with other apps 122 | # Name of the app being uninstalled is passed as an argument 123 | 124 | # before_app_uninstall = "go1_webshop.utils.before_app_uninstall" 125 | # after_app_uninstall = "go1_webshop.utils.after_app_uninstall" 126 | 127 | # Desk Notifications 128 | # ------------------ 129 | # See frappe.core.notifications.get_notification_config 130 | 131 | # notification_config = "go1_webshop.notifications.get_notification_config" 132 | 133 | # Permissions 134 | # ----------- 135 | # Permissions evaluated in scripted ways 136 | 137 | # permission_query_conditions = { 138 | # "Event": "frappe.desk.doctype.event.event.get_permission_query_conditions", 139 | # } 140 | # 141 | # has_permission = { 142 | # "Event": "frappe.desk.doctype.event.event.has_permission", 143 | # } 144 | 145 | # DocType Class 146 | # --------------- 147 | # Override standard doctype classes 148 | 149 | # override_doctype_class = { 150 | # "ToDo": "custom_app.overrides.CustomToDo" 151 | # } 152 | 153 | # Document Events 154 | # --------------- 155 | # Hook on document methods and events 156 | 157 | # doc_events = { 158 | # "*": { 159 | # "on_update": "method", 160 | # "on_cancel": "method", 161 | # "on_trash": "method" 162 | # } 163 | # } 164 | 165 | # Scheduled Tasks 166 | # --------------- 167 | 168 | # scheduler_events = { 169 | # "all": [ 170 | # "go1_webshop.tasks.all" 171 | # ], 172 | # "daily": [ 173 | # "go1_webshop.tasks.daily" 174 | # ], 175 | # "hourly": [ 176 | # "go1_webshop.tasks.hourly" 177 | # ], 178 | # "weekly": [ 179 | # "go1_webshop.tasks.weekly" 180 | # ], 181 | # "monthly": [ 182 | # "go1_webshop.tasks.monthly" 183 | # ], 184 | # } 185 | 186 | # Testing 187 | # ------- 188 | 189 | # before_tests = "go1_webshop.install.before_tests" 190 | 191 | # Overriding Methods 192 | # ------------------------------ 193 | # 194 | # override_whitelisted_methods = { 195 | # "frappe.desk.doctype.event.event.get_events": "go1_webshop.event.get_events" 196 | # } 197 | # 198 | # each overriding function accepts a `data` argument; 199 | # generated from the base implementation of the doctype dashboard, 200 | # along with any modifications made in other Frappe apps 201 | # override_doctype_dashboards = { 202 | # "Task": "go1_webshop.task.get_dashboard_data" 203 | # } 204 | 205 | # exempt linked doctypes from being automatically cancelled 206 | # 207 | # auto_cancel_exempted_doctypes = ["Auto Repeat"] 208 | 209 | # Ignore links to specified DocTypes when deleting documents 210 | # ----------------------------------------------------------- 211 | 212 | # ignore_links_on_delete = ["Communication", "ToDo"] 213 | 214 | # Request Events 215 | # ---------------- 216 | # before_request = ["go1_webshop.utils.before_request"] 217 | # after_request = ["go1_webshop.utils.after_request"] 218 | 219 | # Job Events 220 | # ---------- 221 | # before_job = ["go1_webshop.utils.before_job"] 222 | # after_job = ["go1_webshop.utils.after_job"] 223 | 224 | # User Data Protection 225 | # -------------------- 226 | 227 | # user_data_fields = [ 228 | # { 229 | # "doctype": "{doctype_1}", 230 | # "filter_by": "{filter_by}", 231 | # "redact_fields": ["{field_1}", "{field_2}"], 232 | # "partial": 1, 233 | # }, 234 | # { 235 | # "doctype": "{doctype_2}", 236 | # "filter_by": "{filter_by}", 237 | # "partial": 1, 238 | # }, 239 | # { 240 | # "doctype": "{doctype_3}", 241 | # "strict": False, 242 | # }, 243 | # { 244 | # "doctype": "{doctype_4}" 245 | # } 246 | # ] 247 | 248 | # Authentication and authorization 249 | # -------------------------------- 250 | 251 | # auth_hooks = [ 252 | # "go1_webshop.auth.validate" 253 | # ] 254 | 255 | # Automatically update python controller files with type annotations for this app. 256 | # export_python_type_annotations = True 257 | 258 | # default_log_clearing_doctypes = { 259 | # "Logging DocType Name": 30 # days to retain logs 260 | # } 261 | 262 | -------------------------------------------------------------------------------- /go1_webshop/modules.txt: -------------------------------------------------------------------------------- 1 | Go1 Webshop -------------------------------------------------------------------------------- /go1_webshop/patches.txt: -------------------------------------------------------------------------------- 1 | [pre_model_sync] 2 | # Patches added in this section will be executed before doctypes are migrated 3 | # Read docs to understand patches: https://frappeframework.com/docs/v14/user/en/database-migrations 4 | 5 | [post_model_sync] 6 | # Patches added in this section will be executed after doctypes are migrated -------------------------------------------------------------------------------- /go1_webshop/public/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/public/.gitkeep -------------------------------------------------------------------------------- /go1_webshop/public/images/User Profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/public/images/User Profile.png -------------------------------------------------------------------------------- /go1_webshop/public/root.css: -------------------------------------------------------------------------------- 1 | body{ 2 | font-family:"InterVariable", 3 | "Inter", 4 | "-apple-system", 5 | "BlinkMacSystemFont", 6 | "Segoe UI", 7 | "Roboto", 8 | "Oxygen", 9 | "Ubuntu", 10 | "Cantarell", 11 | "Fira Sans", 12 | "Droid Sans", 13 | "Helvetica Neue", 14 | sans-serif !important; 15 | } 16 | 17 | body { 18 | -webkit-font-smoothing: antialiased; 19 | -moz-osx-font-smoothing: grayscale; 20 | font-size: var(--text-lg); 21 | font-weight: var(--weight-regular); 22 | letter-spacing: 0.02em; 23 | color: #525252; 24 | display: flex; 25 | flex-direction: column; 26 | }html, body { 27 | font-family: var(--font-stack); 28 | font-variation-settings: "opsz" 24; 29 | } 30 | .stock_not_avail { 31 | display: none; 32 | } 33 | .stock_avail { 34 | visibility: hidden; 35 | margin-bottom: -12px; 36 | } 37 | .cart_btn { 38 | width: calc(100% - 30px); 39 | margin-left: 15px; 40 | } 41 | .related_item{ 42 | height:auto !important; 43 | } 44 | .search_categories { 45 | padding: 10px 15px; 46 | float: left; 47 | width: 100%; 48 | border-bottom: 1px solid #f3f3f3; 49 | } 50 | .search_cat_title { 51 | font-size: 14px; 52 | color: #222; 53 | 54 | float: left; 55 | width: 100%; 56 | } 57 | .search_category { 58 | float: left; 59 | margin-right: 10px; 60 | background: #f3f3f3; 61 | margin-top: 10px; 62 | font-size: 13px; 63 | color: #222; 64 | padding: 3px 10px; 65 | font-weight: 500; 66 | border-radius: 5px;cursor:pointer; 67 | } 68 | /*cart*/ 69 | .flex-1{ 70 | flex: 1; 71 | } 72 | .d_flex{ 73 | display: flex; 74 | align-items: center; 75 | gap:10px; 76 | } 77 | .w-full{ 78 | width: 100%; 79 | } 80 | .cart-item{ 81 | border-bottom: 1px solid #ddd; 82 | padding:10px; 83 | } 84 | .img-info img{ 85 | max-width: 65px; 86 | 87 | } 88 | .item_name { 89 | font-size: 14px; 90 | margin-bottom: 5px; 91 | color:#222; 92 | 93 | } 94 | .item_code { 95 | display:none; 96 | } 97 | .add_button,.remove_button,.delete_button{ 98 | height: 35px; 99 | width: 35px; 100 | border-radius: 5px; 101 | display: flex; 102 | justify-content: center; 103 | align-items: center; 104 | 105 | } 106 | .remove_button{ 107 | border: 1px solid #ddd; 108 | } 109 | .add_button{ 110 | background-color:#976563; 111 | color:#fff; 112 | } 113 | .delete_button{ 114 | background-color: #ff000014; 115 | padding: 5px; 116 | height: 25px !important; 117 | width: 25px !important; 118 | } 119 | .remove_wish_button, .add_wish_button{ 120 | font-size:12px; 121 | border-radius:5px; 122 | padding:5px; 123 | gap:10px; 124 | } 125 | .remove_wish_button{ 126 | background-color: #ff000014; 127 | color:#ef4444; 128 | } 129 | .add_wish_button{ 130 | background-color:#0080001c; 131 | color:#008000; 132 | } 133 | #right-cart-container{ 134 | padding:0 !important; 135 | display: block; 136 | } 137 | .right_cart_nav.active{ 138 | color: #976563; 139 | border-color: #976563; 140 | } 141 | #side-wish-list{ 142 | display:none; 143 | } 144 | .pointer-div{ 145 | cursor:pointer; 146 | } 147 | .side-empty-item{ 148 | align-items: center; 149 | display: flex; 150 | position: absolute; 151 | top: 25%; 152 | flex-direction: column; 153 | gap: 10px; 154 | height: 200px; 155 | justify-content: center; 156 | width: 100%; 157 | } 158 | .side-empty-item img{ 159 | height: 137px; 160 | left: auto; 161 | object-fit: cover; 162 | position: static; 163 | top: auto; 164 | width: 111px; 165 | } 166 | .side-empty-item .title_text{ 167 | font-size: 14px; 168 | height: fit-content; 169 | left: auto; 170 | line-height: 1; 171 | min-width: 10px; 172 | position: static; 173 | top: auto; 174 | width: fit-content; 175 | } 176 | 177 | input:focus{ 178 | --tw-ring-color: #976563; 179 | --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); 180 | --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) #9765634f; 181 | box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow); 182 | border-color: #976563; 183 | } 184 | {% if doc.theme_route == "furniture_theme" %} 185 | 186 | .header-menu-items { 187 | gap: 54px !important; 188 | justify-content: space-between !important; 189 | } 190 | .go1_header_bg a img { 191 | height: 40px !important; 192 | } 193 | .description, .description div p{ 194 | display: none !important; 195 | } 196 | .cart_btn{ 197 | width: calc(100% - 30px) !important; 198 | z-index: 1; 199 | display: flex; 200 | position: relative; 201 | height: 35px; 202 | bottom: 0px; 203 | } 204 | .cart_btn div{ 205 | {% if doc.price_amount_size %} 206 | font-size: {{ doc.price_amount_size }} !important; 207 | {% endif %} 208 | } 209 | .card_amount{ 210 | left: 11px !important; 211 | top: 10px; 212 | margin-top: 10px; 213 | } 214 | .button_env { 215 | display: none; 216 | gap: 0 !important; 217 | position: relative; 218 | justify-content: space-around; 219 | } 220 | .related_item { 221 | width: calc(33% - 10px); 222 | } 223 | {% endif %} 224 | .go1_header_bg { 225 | {% if doc.header_background %} 226 | background: {{ doc.header_background }}; 227 | {% endif %} 228 | {% if doc.header_width %} 229 | max-width: {{ doc.header_width}}; 230 | padding: 20px 18px !important; 231 | {% endif %} 232 | {% if doc.is_shadow and doc.is_shadow==1 %} 233 | box-shadow: {{ doc.header_shadow}}; 234 | {% endif %} 235 | {% if doc.enable_header_border and doc.enable_header_border == 1 %} 236 | border: 1px solid {{ doc.header_border_color }}; 237 | {% endif %} 238 | {% if doc.header_padding %} 239 | padding: {{ doc.header_padding }} 0px; 240 | {% endif %} 241 | height: 125px !important; 242 | } 243 | .go1_header_bg a img{ 244 | {% if doc.logo_height %} 245 | height: {{ doc.logo_height }}; 246 | {% endif %} 247 | } 248 | 249 | .go1_header_bg div p{ 250 | {% if doc.header_text_color %} 251 | color: {{ doc.header_text_color }}; 252 | {% endif %} 253 | } 254 | 255 | /* WEB MENU */ 256 | .header-menu{ 257 | {% if doc.menu_background_color %} 258 | background: {{ doc.menu_background_color }}; 259 | border-color: {{ doc.menu_background_color }}; 260 | {% endif %} 261 | } 262 | /* .header-menu .menu-title a div{ 263 | {% if doc.font_family %} 264 | font-family: {{ doc.font_family }}; 265 | {% endif %} 266 | {% if doc.font_weight_web %} 267 | font-weight: {{ doc.font_weight_web }}; 268 | {% endif %} 269 | {% if doc.font_size_web %} 270 | font-size: {{ doc.font_size_web }}; 271 | {% endif %} 272 | {% if doc.line_height %} 273 | line-height: {{ doc.line_height }}; 274 | {% endif %} 275 | {% if doc.letter_spacing_web %} 276 | letter-spacing: {{ doc.letter_spacing_web }}; 277 | {% endif %} 278 | {% if doc.menu_text_color %} 279 | color: {{ doc.menu_text_color }}; 280 | {% endif %} 281 | } */ 282 | .header-menu .menu-title a div:hover{ 283 | {% if doc.menu_hover_color %} 284 | color: {{ doc.menu_hover_color }}; 285 | {% endif %} 286 | } 287 | .active_parent:after, .hoverMenuSec:after{ 288 | {% if doc.menu_hover_color %} 289 | background: {{ doc.menu_hover_color }} !important; 290 | {% endif %} 291 | } 292 | .hoverMenuSec:hover:after { 293 | width: 65% !important; 294 | } 295 | .header-menu-items{ 296 | {% if doc.menu_item_spacing_web %} 297 | gap: {{ doc.menu_item_spacing_web }}; 298 | {% endif %} 299 | {% if doc.menu_alignment %} 300 | justify-content: {{ doc.menu_alignment }}; 301 | {% endif %} 302 | } 303 | /* #nav-drop-down, .profile_menu { 304 | {% if doc.dropdown_background_color %} 305 | background: {{ doc.dropdown_background_color }}; 306 | {% endif %} 307 | {% if doc.apply_box_shadow and doc.apply_box_shadow==1 %} 308 | box-shadow: {{ doc.dropdown_menu_box_shadow }}; 309 | {% endif %} 310 | } */ 311 | 312 | 313 | .sort-label:hover{ 314 | {% if doc.dropdown_menu_hover_background_color %} 315 | background: {{ doc.dropdown_menu_hover_background_color }} !important; 316 | {% endif %} 317 | } 318 | 319 | 320 | .sort-label:hover div p { 321 | {% if doc.dropdown_menu_hover_color %} 322 | color: {{ doc.dropdown_menu_hover_color }}; 323 | {% endif %} 324 | } 325 | 326 | .sort-label div p{ 327 | {% if doc.dropdown_menu_color %} 328 | color: {{ doc.dropdown_menu_color }}; 329 | {% endif %} 330 | } 331 | 332 | #sort-web-container { 333 | background: transparent !important; 334 | border: 0 !important; 335 | border-radius : 4px !important; 336 | padding: 0px !important; 337 | {% if doc.apply_box_shadow and doc.apply_box_shadow == 1 %} 338 | box-shadow: {{ doc.dropdown_menu_box_shadow }}; 339 | {% endif %} 340 | } 341 | 342 | .sort-label { 343 | border: 0 !important; 344 | {% if doc.dropdown_background_color %} 345 | background: {{ doc.dropdown_background_color }} !important; 346 | {% endif %} 347 | } 348 | 349 | 350 | .dismiss{ 351 | {% if doc.is_dismissible == 1 %} 352 | display: flex; 353 | {% else %} 354 | display: none; 355 | {% endif %} 356 | } 357 | .announce_bar { 358 | {% if doc.enable_announcement_bar and doc.enable_announcement_bar == 1 %} 359 | display: flex; 360 | background: {{ doc.background }}; 361 | .announce_bar .__text_block__ { 362 | color: {{ doc.header_text_color }}; 363 | font-size: {{ doc.text_size }}; 364 | } 365 | {% else %} 366 | display: none; 367 | {% endif %} 368 | } 369 | .announce_bar .__text_block__ { 370 | {% if doc.enable_announcement_bar and doc.enable_announcement_bar == 1 %} 371 | display: flex; 372 | {% else %} 373 | display: none; 374 | {% endif %} 375 | } 376 | .go1_header_bg p{ 377 | {% if doc.text_color %} 378 | color: {{ doc.text_color }}; 379 | {% endif %} 380 | } 381 | .go1_header_bg div{ 382 | padding-top: 0px; 383 | } 384 | 385 | .loader{ 386 | background: linear-gradient(0deg, var(--go1-primary-color)63 33%, var(--go1-secondary-color) 100%); 387 | } 388 | 389 | 390 | .footer-tile{ 391 | {% if doc.enable_border_for_title and enable_border_for_title==1 %} 392 | border: {{ doc.tile_border }}; 393 | {% endif %} 394 | padding: 5px; 395 | } 396 | .footer_title p{ 397 | {% if doc.footer_font_family %} 398 | font-family: {{ doc.footer_font_family }}; 399 | {% endif %} 400 | {% if doc.footer_font_weight %} 401 | font-weight: 900; 402 | {% endif %} 403 | {% if doc.footer_font_size %} 404 | font-size: {{ doc.footer_font_size }}; 405 | {% endif %} 406 | {% if doc.footer_line_height %} 407 | line-height: {{ doc.footer_line_height }}; 408 | {% endif %} 409 | {% if doc.footer_letter_spacing %} 410 | letter-spacing: {{ doc.footer_letter_spacing }}; 411 | {% endif %} 412 | {% if doc.footer_text_color %} 413 | color: {{ doc.footer_text_color }}; 414 | {% endif %} 415 | } 416 | .footer_component{ 417 | {% if doc.footer_bg_color %} 418 | background: {{ doc.footer_bg_color }}; 419 | {% endif %} 420 | } 421 | .footer_text{ 422 | {% if doc.footer_font_family %} 423 | font-family: {{ doc.ft_font_family }}; 424 | {% endif %} 425 | {% if doc.ft_font_weight %} 426 | font-weight: 900; 427 | {% endif %} 428 | {% if doc.ft_font_size %} 429 | font-size: {{ doc.ft_font_size }}; 430 | {% endif %} 431 | {% if doc.ft_line_height %} 432 | line-height: {{ doc.ft_line_height }}; 433 | {% endif %} 434 | {% if doc.ft_letter_spacing %} 435 | letter-spacing: {{ doc.ft_letter_spacing }}; 436 | {% endif %} 437 | {% if doc.ft_text_color %} 438 | color: {{ doc.ft_text_color }}; 439 | {% endif %} 440 | 441 | transition: .2s; 442 | } 443 | .footer_text:hover{ 444 | {% if doc.link_hover_color %} 445 | color: {{ doc.link_hover_color }}; 446 | {% endif %} 447 | transition: .2s; 448 | font-weight: 700; 449 | font-size: 14.5px; 450 | } 451 | .footer_component .cpright{ 452 | {% if doc.cr_background_color %} 453 | background: {{ doc.cr_background_color }}; 454 | {% endif %} 455 | } 456 | .cpright .__text_block__ p{ 457 | {% if doc.cr_text_color %} 458 | color: {{ doc.cr_text_color }} !important; 459 | {% endif %} 460 | {% if doc.copyright_content %} 461 | content: {{ doc.copyright_content }}; 462 | {% endif %} 463 | } 464 | 465 | .right_cart_nav.active{ 466 | {% if doc.primary_color %} 467 | color: {{ doc.primary_color }} !important; 468 | {% endif %} 469 | {% if doc.primary_color %} 470 | border-color: {{ doc.primary_color }} !important; 471 | {% endif %} 472 | 473 | } 474 | .w-count, .c-count{ 475 | display: flex; 476 | color: #FFFFFF; 477 | align-items: center; 478 | justify-content: center; 479 | {% if doc.primary_color %} 480 | background: {{ doc.primary_color }} !important; 481 | {% endif %} 482 | } 483 | #side-cart-count, 484 | #right-wish-count, 485 | #move-cart-button, 486 | #checkout-button, 487 | .add_button.pointer-div{ 488 | {% if doc.primary_color %} 489 | background: {{ doc.primary_color }} !important; 490 | {% endif %} 491 | } 492 | 493 | 494 | .cart_btn, 495 | .plus_btn, 496 | .add_cart_btn, 497 | .place-order, 498 | .add-address, 499 | .save_btn, 500 | #order_payment, 501 | #login-btn, 502 | .login-form a, 503 | .my-order button{ 504 | {% if doc.primary_color %} 505 | background: {{ doc.primary_color }} !important; 506 | {% endif %} 507 | } 508 | 509 | .image_container, .minus_btn{ 510 | {% if doc.secondary_color %} 511 | background: {{ doc.secondary_color }} !important; 512 | {% endif %} 513 | } 514 | input:focus{ 515 | {% if doc.primary_color %} 516 | border-color: {{ doc.primary_color }} !important; 517 | {% endif %} 518 | } 519 | 520 | /* PRODUCT INFO */ 521 | 522 | .image_container{ 523 | {% if doc.product_card_background_color %} 524 | background-color: {{ doc.product_card_background_color }} !important; 525 | {% endif %} 526 | } 527 | div.owl-wrapper div.owl-item { 528 | {% if doc.product_cards_count == '3' %} 529 | width: 410px !important; 530 | {% elif doc.product_cards_count == '4' %} 531 | width: 308px !important; 532 | {% elif doc.product_cards_count == '5' %} 533 | width: 246px !important; 534 | {% elif doc.product_cards_count == '6' %} 535 | width: 205px !important; 536 | {% endif %} 537 | } 538 | .off_container{ 539 | {% if doc.offer_style == 'Band'%} 540 | width: 49% !important; 541 | transform: translateX(-22%) translateY(-68%) rotate(-46deg); 542 | {% endif %} 543 | 544 | } 545 | #login{ 546 | background:#ffffff !important; 547 | } 548 | #login_email,#login_password{ 549 | {% if doc.secondary_color %} background: {{ doc.secondary_color }}; {% endif %} 550 | } 551 | .offer{ 552 | {% if doc.offer_style == 'Band'%} 553 | margin-right: 37px; 554 | {% endif %} 555 | } 556 | .description, .description div p{ 557 | overflow: hidden; 558 | width: 100%; 559 | text-wrap: nowrap; 560 | display: flow; 561 | height: 33px; 562 | font-weight: 200; 563 | margin-bottom: 3px; 564 | {% if doc.description_color %} 565 | color: {{doc.description_color}}; 566 | {% endif %} 567 | text-overflow: ellipsis; 568 | {% if doc.description_font_size %} 569 | font-size: {{doc.description_font_size}}; 570 | {% endif %} 571 | } 572 | .card_amount div{ 573 | margin-bottom: 30px; 574 | } 575 | .card_amount{ 576 | font-weight: 600; 577 | height: 30px !important; 578 | {% if doc.price_amount_size %} 579 | font-size: {{doc.price_amount_size}}; 580 | {% endif %} 581 | {% if doc.price_amount_color %} 582 | color: {{doc.price_amount_color}}; 583 | {% endif %} 584 | } 585 | @media screen and (min-width: 700px){ 586 | #home-sliders .owl-item{ 587 | width: 1366px !important; 588 | } 589 | } 590 | 591 | .image_container img{ 592 | {% if doc.product_image_size %} 593 | height: {{ doc.product_image_size }} important; 594 | {% endif %} 595 | } 596 | .line_2_text_36{ 597 | overflow: hidden; 598 | width: 100%; 599 | text-wrap: wrap; 600 | display: -webkit-box; 601 | height: 40px; 602 | -webkit-line-clamp: 2; 603 | -webkit-box-orient: vertical; 604 | {% if doc.product_title_color %} 605 | color: {{doc.product_title_color}}; 606 | {% endif %} 607 | 608 | } 609 | 610 | /* MOBILE VIEW */ 611 | @media screen and (max-width: 700px){ 612 | 613 | .cart_btn_list{ 614 | position: relative !important; 615 | } 616 | .line_2_text_36{ 617 | min-height: 38px !important; 618 | } 619 | .related_item{ 620 | padding-top: 10px; 621 | } 622 | .filter_btn{ 623 | align-items: center; 624 | background: #FFFFFF; 625 | border: 0 solid #E2E8F0; 626 | box-shadow: rgba(0, 0, 0, .18) 0px 2px 7px; 627 | box-sizing: border-box; 628 | color: #1A202C; 629 | display: inline-flex; 630 | font-family: Inter, sans-serif; 631 | font-size: 1rem; 632 | font-weight: 700; 633 | height: 42px; 634 | justify-content: center; 635 | line-height: 24px; 636 | overflow-wrap: break-word; 637 | padding: 24px; 638 | text-decoration: none; 639 | width: auto; 640 | border-radius: 8px; 641 | cursor: pointer; 642 | user-select: none; 643 | -webkit-user-select: none; 644 | touch-action: manipulation; 645 | } 646 | .description, .description div p{ 647 | margin-left: 0px; 648 | } 649 | .card_amount { 650 | width: 75%; 651 | left: -50px !important; 652 | } 653 | div.owl-wrapper div.owl-item { 654 | width: 450px !important; 655 | } 656 | .image_container { 657 | padding: 0 10px !important; 658 | height: 150px; 659 | } 660 | .image_container img { 661 | object-fit: contain !important; 662 | 663 | } 664 | 665 | .go1_header_bg { 666 | {% if doc.header_background %} 667 | background: {{ doc.header_background }}; 668 | {% endif %} 669 | height: 55px !important; 670 | padding: 10px 5px !important; 671 | } 672 | .header_back_icon ,.mobile-header-cart-count{ 673 | {% if doc.primary_color %} 674 | background: {{ doc.primary_color }}; 675 | {% endif %} 676 | } 677 | } 678 | 679 | 680 | :root { 681 | /* GLOBAL STYLES */ 682 | {% if doc.primary_color %} --go1-primary-color: {{ doc.primary_color }} important; {% endif %} 683 | {% if doc.secondary_color %} --go1-secondary-color: {{ doc.secondary_color }} important; {% endif %} 684 | } 685 | 686 | 687 | -------------------------------------------------------------------------------- /go1_webshop/templates/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/templates/__init__.py -------------------------------------------------------------------------------- /go1_webshop/templates/js/custom_html_block.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "Explore Go1 Webshop Themes", 4 | "private": 0, 5 | "html": "
\n \n
\n", 6 | "style": ".explore_theme{\n background-color:white;\n padding:5px;\n border-radius: 12px;\n}", 7 | "doctype": "Custom HTML Block", 8 | "roles": [] 9 | } 10 | ] -------------------------------------------------------------------------------- /go1_webshop/templates/pages/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/templates/pages/__init__.py -------------------------------------------------------------------------------- /go1_webshop/www/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TridotsTech/Go1-Webshop/7f22eea54b1d66c10a22adf75bdac77a3ea2c6cf/go1_webshop/www/__init__.py -------------------------------------------------------------------------------- /license.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) [year] [fullname] 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "go1_webshop" 3 | authors = [ 4 | { name = "tridotstech", email = "info@tridotstech.com"} 5 | ] 6 | description = "Ecommerce app" 7 | requires-python = ">=3.10" 8 | readme = "README.md" 9 | dynamic = ["version"] 10 | dependencies = [ 11 | # "frappe~=15.0.0" # Installed and managed by bench. 12 | ] 13 | 14 | [build-system] 15 | requires = ["flit_core >=3.4,<4"] 16 | build-backend = "flit_core.buildapi" 17 | 18 | # These dependencies are only installed when developer mode is enabled 19 | [tool.bench.dev-dependencies] 20 | # package_name = "~=1.1.0" 21 | --------------------------------------------------------------------------------