diff --git a/website_product_customization/README.rst b/website_product_customization/README.rst new file mode 100644 index 000000000..8b041c2fd --- /dev/null +++ b/website_product_customization/README.rst @@ -0,0 +1,51 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Website Product Customization +============================= +This Module allows users to customize the the product they buy from website/shop +by applying individual designs. + +Configuration +============= +* Add appropriate number of designs in the product.design model for the customer +to choose from the front-end. + +License +------- +Affero General Public License v3.0 (AGPL v3) +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developers: (V16)Vivek @ cybrosys, + (V17) Gayathri V, + (V18) Busthana Shirin +Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ diff --git a/website_product_customization/__init__.py b/website_product_customization/__init__.py new file mode 100644 index 000000000..bbe14c07f --- /dev/null +++ b/website_product_customization/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import controllers +from . import models diff --git a/website_product_customization/__manifest__.py b/website_product_customization/__manifest__.py new file mode 100644 index 000000000..add32dd8a --- /dev/null +++ b/website_product_customization/__manifest__.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author:Cybrosys Techno Solutions (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': 'Website Product Customization', + 'version': '18.0.1.0.0', + 'category': 'Website', + 'summary': 'Customize products from website', + 'description': 'This module helps to customise the products from website' + 'according to the customer wish', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['website_sale'], + 'data': [ + 'security/ir.model.access.csv', + 'views/product_design_views.xml', + 'views/website_sale_templates.xml', + 'views/sale_order_views.xml', + ], + 'assets': { + 'web.assets_frontend': [ + "/website_product_customization/static/src/css/style.css", + "/website_product_customization/static/lib/fabric.js", + "/website_product_customization/static/src/js/website_product_custom.js", + "/website_product_customization/static/src/js/website_sale.js", + ], + }, + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': True, +} diff --git a/website_product_customization/controllers/__init__.py b/website_product_customization/controllers/__init__.py new file mode 100644 index 000000000..2665cff59 --- /dev/null +++ b/website_product_customization/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import website_product_customization diff --git a/website_product_customization/controllers/website_product_customization.py b/website_product_customization/controllers/website_product_customization.py new file mode 100644 index 000000000..b995ad7ab --- /dev/null +++ b/website_product_customization/controllers/website_product_customization.py @@ -0,0 +1,201 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +import re +from odoo import http +from odoo.http import request +from odoo.addons.website_sale.controllers.main import WebsiteSale +from odoo.addons.website_sale.controllers.product_configurator import ( + WebsiteSaleProductConfiguratorController, +) + + +class WebsiteProductCustomization(WebsiteSale): + """ + Inheriting 'WebsiteSale' class from 'website_sale.controllers.main' to + modify the method 'cart_update_json'. + """ + + @http.route() + def cart_update_json( + self, + product_id, + design_image=None, + line_id=None, + add_qty=None, + set_qty=None, + display=True, + product_custom_attribute_values=None, + no_variant_attribute_values=None, + **kw + ): + """ + This route is called : + - When changing quantity from the cart. + - When adding a product from the wishlist. + - When adding a product to cart on the same page + (without redirection). + """ + res = super(WebsiteProductCustomization, self).cart_update_json( + product_id=product_id, + design_image=design_image, + line_id=line_id, + add_qty=add_qty, + set_qty=set_qty, + display=display, + product_custom_attribute_values=product_custom_attribute_values, + no_variant_attribute_values=no_variant_attribute_values, + **kw + ) + order = request.website.sale_get_order(force_create=True) + if design_image: + for record in order.order_line: + if record.id == res["line_id"]: + record.product_design = str( + re.sub("^data:image\/\w+;base64,", "", design_image), + ) + record.is_customized_product = True + else: + if not order.order_line.browse(res["line_id"]).product_design: + order.order_line.browse(res["line_id"]).product_design = ( + request.env["product.product"].sudo().browse(product_id).image_1920 + ) + request.session["website_sale_cart_quantity"] = order.cart_quantity + return res + + +class WebsiteSaleStockProductConfiguratorController( + WebsiteSaleProductConfiguratorController): + + """ + Inheriting 'WebsiteSale' class from to modify the method + 'cart_options_update_json'. + """ + + @http.route() + def website_sale_product_configurator_update_cart( + self, main_product, optional_products, **kwargs + ): + """ Add the provided main and optional products to the cart. + + Main and optional products have the following shape: + ``` + { + 'product_id': int, + 'product_template_id': int, + 'parent_product_template_id': int, + 'quantity': float, + 'product_custom_attribute_values': list(dict), + 'no_variant_attribute_value_ids': list(int), + } + ``` + + Note: if product A is a parent of product B, then product A must come before product B in + the optional_products list. Otherwise, the corresponding order lines won't be linked. + + :param dict main_product: The main product to add. + :param list(dict) optional_products: The optional products to add. + :param dict kwargs: Locally unused data passed to `_cart_update`. + :rtype: dict + :return: A dict containing information about the cart update. + """ + order_sudo = request.website.sale_get_order(force_create=True) + if order_sudo.state != 'draft': + request.session['sale_order_id'] = None + order_sudo = request.website.sale_get_order(force_create=True) + + # The main product could theoretically have a parent, but we ignore it to avoid + # circularities in the linked line ids. + + design_image = ( + main_product[ + "design_image"] if "design_image" in main_product else None + ) + + values = order_sudo._cart_update( + product_id=main_product['product_id'], + add_qty=main_product['quantity'], + product_custom_attribute_values=main_product[ + 'product_custom_attribute_values'], + no_variant_attribute_value_ids=[ + int(value_id) for value_id in + main_product['no_variant_attribute_value_ids'] + ], + design_image=design_image, + **kwargs, + ) + line_ids = {main_product['product_template_id']: values['line_id']} + + if optional_products and values['line_id']: + for option in optional_products: + option_values = order_sudo._cart_update( + product_id=option['product_id'], + add_qty=option['quantity'], + product_custom_attribute_values=option[ + 'product_custom_attribute_values'], + no_variant_attribute_value_ids=[ + int(value_id) for value_id in + option['no_variant_attribute_value_ids'] + ], + # Using `line_ids[...]` instead of `line_ids.get(...)` ensures that this throws + # if an optional product contains bad data. + linked_line_id=line_ids[ + option['parent_product_template_id']], + design_image=design_image, + **kwargs, + ) + line_ids[option['product_template_id']] = option_values[ + 'line_id'] + for record in order_sudo.order_line: + if record.id == option_values["line_id"]: + record.product_design = ( + request.env["product.product"] + .sudo() + .browse(option["product_id"]) + .image_1920 + ) + if design_image: + for record in order_sudo.order_line: + if record.id == values["line_id"]: + record.product_design = str( + re.sub( + "^data:image\/\w+;base64,", + "", + main_product["design_image"], + ), + ) + record.is_customized_product = True + else: + if not order_sudo.order_line.browse(values["line_id"]).product_design: + order_sudo.order_line.browse(values["line_id"]).product_design = ( + request.env["product.product"] + .sudo() + .browse(main_product["product_id"]) + .image_1920 + ) + + values['notification_info'] = self._get_cart_notification_information( + order_sudo, line_ids.values() + ) + values['cart_quantity'] = order_sudo.cart_quantity + request.session['website_sale_cart_quantity'] = order_sudo.cart_quantity + + return values diff --git a/website_product_customization/doc/RELEASE_NOTES.md b/website_product_customization/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..486619059 --- /dev/null +++ b/website_product_customization/doc/RELEASE_NOTES.md @@ -0,0 +1,5 @@ +## Module +#### 27.11.2024 +#### Version 18.0.1.0.0 +#### ADD +- Initial Commit for Website Product Customization. diff --git a/website_product_customization/models/__init__.py b/website_product_customization/models/__init__.py new file mode 100644 index 000000000..55cb861aa --- /dev/null +++ b/website_product_customization/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import product_design +from . import sale_order_line +from . import sale_order diff --git a/website_product_customization/models/product_design.py b/website_product_customization/models/product_design.py new file mode 100644 index 000000000..b812dfabf --- /dev/null +++ b/website_product_customization/models/product_design.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class ProductDesign(models.Model): + """ + Creating the product.design model to add product designs in the back-end + """ + _name = 'product.design' + _description = "Product Design" + + name = fields.Char(string='Product Customization', + help="Name field for product design") + product_design = fields.Image(string='Design', + help="Binary field for adding product design") diff --git a/website_product_customization/models/sale_order.py b/website_product_customization/models/sale_order.py new file mode 100644 index 000000000..7d9344996 --- /dev/null +++ b/website_product_customization/models/sale_order.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import models + + +class SaleOrder(models.Model): + """Inherited the class sale.order to match the order line.""" + _inherit = "sale.order" + + def _cart_find_product_line(self, product_id, line_id=None, **kwargs): + """Find the cart line matching the given parameters. + + If a product_id is given, the line will match the product only if the + line also has the same special attributes: `no_variant` attributes and + `is_custom` values. + """ + self.ensure_one() + SaleOrderLine = self.env["sale.order.line"] + if not self.order_line: + return SaleOrderLine + product = self.env["product.product"].browse(product_id) + if not line_id and ( + product.product_tmpl_id.has_dynamic_attributes() + or product.product_tmpl_id._has_no_variant_attributes() + ): + return SaleOrderLine + design_image = kwargs.get("design_image", False) + if design_image: + return SaleOrderLine + else: + domain = [("order_id", "=", self.id), ("product_id", "=", product_id)] + if line_id: + domain += [("id", "=", line_id)] + else: + domain += [ + ("product_custom_attribute_value_ids", "=", False), + ("is_customized_product", "=", False), + ] + return SaleOrderLine.search(domain) diff --git a/website_product_customization/models/sale_order_line.py b/website_product_customization/models/sale_order_line.py new file mode 100644 index 000000000..5527e1ecd --- /dev/null +++ b/website_product_customization/models/sale_order_line.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class SaleOrderLine(models.Model): + """ + Inheriting the 'sale.order.line' model add the product_design field + """ + _inherit = 'sale.order.line' + + product_design = fields.Binary(string="Product Design", + help="Binary field to show product design") + is_customized_product = fields.Boolean(string="Customized Product" + "product", + help="Is it is a customized product" + " or not", default=False) diff --git a/website_product_customization/security/ir.model.access.csv b/website_product_customization/security/ir.model.access.csv new file mode 100644 index 000000000..308ec5225 --- /dev/null +++ b/website_product_customization/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_product_design,access.product.design,model_product_design,base.group_user,1,1,1,1 diff --git a/website_product_customization/static/description/assets/icons/arrows-repeat.svg b/website_product_customization/static/description/assets/icons/arrows-repeat.svg new file mode 100755 index 000000000..1d7efabc5 --- /dev/null +++ b/website_product_customization/static/description/assets/icons/arrows-repeat.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/website_product_customization/static/description/assets/icons/banner-1.png b/website_product_customization/static/description/assets/icons/banner-1.png new file mode 100755 index 000000000..c180db172 Binary files /dev/null and b/website_product_customization/static/description/assets/icons/banner-1.png differ diff --git a/website_product_customization/static/description/assets/icons/banner-2.svg b/website_product_customization/static/description/assets/icons/banner-2.svg new file mode 100755 index 000000000..e606d97d9 --- /dev/null +++ b/website_product_customization/static/description/assets/icons/banner-2.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/website_product_customization/static/description/assets/icons/banner-bg.png b/website_product_customization/static/description/assets/icons/banner-bg.png new file mode 100755 index 000000000..a8238d3c0 Binary files /dev/null and b/website_product_customization/static/description/assets/icons/banner-bg.png differ diff --git a/website_product_customization/static/description/assets/icons/banner-bg.svg b/website_product_customization/static/description/assets/icons/banner-bg.svg new file mode 100755 index 000000000..b1378103e --- /dev/null +++ b/website_product_customization/static/description/assets/icons/banner-bg.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/website_product_customization/static/description/assets/icons/banner-call.svg b/website_product_customization/static/description/assets/icons/banner-call.svg new file mode 100755 index 000000000..96c687e81 --- /dev/null +++ b/website_product_customization/static/description/assets/icons/banner-call.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/website_product_customization/static/description/assets/icons/banner-mail.svg b/website_product_customization/static/description/assets/icons/banner-mail.svg new file mode 100755 index 000000000..cbf0d158d --- /dev/null +++ b/website_product_customization/static/description/assets/icons/banner-mail.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/website_product_customization/static/description/assets/icons/banner-pattern.svg b/website_product_customization/static/description/assets/icons/banner-pattern.svg new file mode 100755 index 000000000..9c1c7e101 --- /dev/null +++ b/website_product_customization/static/description/assets/icons/banner-pattern.svg @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/website_product_customization/static/description/assets/icons/banner-promo.svg b/website_product_customization/static/description/assets/icons/banner-promo.svg new file mode 100755 index 000000000..d52791b11 --- /dev/null +++ b/website_product_customization/static/description/assets/icons/banner-promo.svg @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/website_product_customization/static/description/assets/icons/brand-pair.svg b/website_product_customization/static/description/assets/icons/brand-pair.svg new file mode 100755 index 000000000..d8db7fc1e --- /dev/null +++ b/website_product_customization/static/description/assets/icons/brand-pair.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/website_product_customization/static/description/assets/icons/check.png b/website_product_customization/static/description/assets/icons/check.png new file mode 100755 index 000000000..c8e85f51d Binary files /dev/null and b/website_product_customization/static/description/assets/icons/check.png differ diff --git a/website_product_customization/static/description/assets/icons/chevron.png b/website_product_customization/static/description/assets/icons/chevron.png new file mode 100755 index 000000000..2089293d6 Binary files /dev/null and b/website_product_customization/static/description/assets/icons/chevron.png differ diff --git a/website_product_customization/static/description/assets/icons/close-icon.svg b/website_product_customization/static/description/assets/icons/close-icon.svg new file mode 100755 index 000000000..df8cce37a --- /dev/null +++ b/website_product_customization/static/description/assets/icons/close-icon.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/website_product_customization/static/description/assets/icons/cogs.png b/website_product_customization/static/description/assets/icons/cogs.png new file mode 100755 index 000000000..95d0bad62 Binary files /dev/null and b/website_product_customization/static/description/assets/icons/cogs.png differ diff --git a/website_product_customization/static/description/assets/icons/collabarate-icon.svg b/website_product_customization/static/description/assets/icons/collabarate-icon.svg new file mode 100755 index 000000000..dd4e10518 --- /dev/null +++ b/website_product_customization/static/description/assets/icons/collabarate-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/website_product_customization/static/description/assets/icons/consultation.png b/website_product_customization/static/description/assets/icons/consultation.png new file mode 100755 index 000000000..8319d4baa Binary files /dev/null and b/website_product_customization/static/description/assets/icons/consultation.png differ diff --git a/website_product_customization/static/description/assets/icons/cybro-logo.png b/website_product_customization/static/description/assets/icons/cybro-logo.png new file mode 100755 index 000000000..ff4b78220 Binary files /dev/null and b/website_product_customization/static/description/assets/icons/cybro-logo.png differ diff --git a/website_product_customization/static/description/assets/icons/down.svg b/website_product_customization/static/description/assets/icons/down.svg new file mode 100755 index 000000000..f21c36271 --- /dev/null +++ b/website_product_customization/static/description/assets/icons/down.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/website_product_customization/static/description/assets/icons/ecom-black.png b/website_product_customization/static/description/assets/icons/ecom-black.png new file mode 100755 index 000000000..a9385ff13 Binary files /dev/null and b/website_product_customization/static/description/assets/icons/ecom-black.png differ diff --git a/website_product_customization/static/description/assets/icons/education-black.png b/website_product_customization/static/description/assets/icons/education-black.png new file mode 100755 index 000000000..3eb09b27b Binary files /dev/null and b/website_product_customization/static/description/assets/icons/education-black.png differ diff --git a/website_product_customization/static/description/assets/icons/faq.png b/website_product_customization/static/description/assets/icons/faq.png new file mode 100755 index 000000000..4250b5b81 Binary files /dev/null and b/website_product_customization/static/description/assets/icons/faq.png differ diff --git a/website_product_customization/static/description/assets/icons/feature-icon.svg b/website_product_customization/static/description/assets/icons/feature-icon.svg new file mode 100755 index 000000000..fa0ea6850 --- /dev/null +++ b/website_product_customization/static/description/assets/icons/feature-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/website_product_customization/static/description/assets/icons/feature.png b/website_product_customization/static/description/assets/icons/feature.png new file mode 100755 index 000000000..ac7a785c0 Binary files /dev/null and b/website_product_customization/static/description/assets/icons/feature.png differ diff --git a/website_product_customization/static/description/assets/icons/gear.svg b/website_product_customization/static/description/assets/icons/gear.svg new file mode 100755 index 000000000..0cc66b6ea --- /dev/null +++ b/website_product_customization/static/description/assets/icons/gear.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/website_product_customization/static/description/assets/icons/hero.gif b/website_product_customization/static/description/assets/icons/hero.gif new file mode 100755 index 000000000..380654dfe Binary files /dev/null and b/website_product_customization/static/description/assets/icons/hero.gif differ diff --git a/website_product_customization/static/description/assets/icons/hire-odoo.svg b/website_product_customization/static/description/assets/icons/hire-odoo.svg new file mode 100755 index 000000000..e1ac089b0 --- /dev/null +++ b/website_product_customization/static/description/assets/icons/hire-odoo.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/website_product_customization/static/description/assets/icons/hotel-black.png b/website_product_customization/static/description/assets/icons/hotel-black.png new file mode 100755 index 000000000..130f613be Binary files /dev/null and b/website_product_customization/static/description/assets/icons/hotel-black.png differ diff --git a/website_product_customization/static/description/assets/icons/license.png b/website_product_customization/static/description/assets/icons/license.png new file mode 100755 index 000000000..a5869797e Binary files /dev/null and b/website_product_customization/static/description/assets/icons/license.png differ diff --git a/website_product_customization/static/description/assets/icons/life-ring-icon.svg b/website_product_customization/static/description/assets/icons/life-ring-icon.svg new file mode 100755 index 000000000..3ae6e1d89 --- /dev/null +++ b/website_product_customization/static/description/assets/icons/life-ring-icon.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/website_product_customization/static/description/assets/icons/lifebuoy.png b/website_product_customization/static/description/assets/icons/lifebuoy.png new file mode 100755 index 000000000..658d56ccc Binary files /dev/null and b/website_product_customization/static/description/assets/icons/lifebuoy.png differ diff --git a/website_product_customization/static/description/assets/icons/mail.svg b/website_product_customization/static/description/assets/icons/mail.svg new file mode 100755 index 000000000..1eedde695 --- /dev/null +++ b/website_product_customization/static/description/assets/icons/mail.svg @@ -0,0 +1,3 @@ + + + diff --git a/website_product_customization/static/description/assets/icons/manufacturing-black.png b/website_product_customization/static/description/assets/icons/manufacturing-black.png new file mode 100755 index 000000000..697eb0e9f Binary files /dev/null and b/website_product_customization/static/description/assets/icons/manufacturing-black.png differ diff --git a/website_product_customization/static/description/assets/icons/notes.png b/website_product_customization/static/description/assets/icons/notes.png new file mode 100755 index 000000000..ee5e95404 Binary files /dev/null and b/website_product_customization/static/description/assets/icons/notes.png differ diff --git a/website_product_customization/static/description/assets/icons/notification icon.svg b/website_product_customization/static/description/assets/icons/notification icon.svg new file mode 100755 index 000000000..053189973 --- /dev/null +++ b/website_product_customization/static/description/assets/icons/notification icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/website_product_customization/static/description/assets/icons/odoo-consultancy.svg b/website_product_customization/static/description/assets/icons/odoo-consultancy.svg new file mode 100755 index 000000000..e05f65bde --- /dev/null +++ b/website_product_customization/static/description/assets/icons/odoo-consultancy.svg @@ -0,0 +1,4 @@ + + + + diff --git a/website_product_customization/static/description/assets/icons/odoo-licencing.svg b/website_product_customization/static/description/assets/icons/odoo-licencing.svg new file mode 100755 index 000000000..2606c88b0 --- /dev/null +++ b/website_product_customization/static/description/assets/icons/odoo-licencing.svg @@ -0,0 +1,3 @@ + + + diff --git a/website_product_customization/static/description/assets/icons/odoo-logo.png b/website_product_customization/static/description/assets/icons/odoo-logo.png new file mode 100755 index 000000000..0e4d0eb5a Binary files /dev/null and b/website_product_customization/static/description/assets/icons/odoo-logo.png differ diff --git a/website_product_customization/static/description/assets/icons/patter.svg b/website_product_customization/static/description/assets/icons/patter.svg new file mode 100755 index 000000000..25c9c0a8f --- /dev/null +++ b/website_product_customization/static/description/assets/icons/patter.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/website_product_customization/static/description/assets/icons/pattern1.png b/website_product_customization/static/description/assets/icons/pattern1.png new file mode 100755 index 000000000..09ab0fb2d Binary files /dev/null and b/website_product_customization/static/description/assets/icons/pattern1.png differ diff --git a/website_product_customization/static/description/assets/icons/pos-black.png b/website_product_customization/static/description/assets/icons/pos-black.png new file mode 100755 index 000000000..97c0f90c1 Binary files /dev/null and b/website_product_customization/static/description/assets/icons/pos-black.png differ diff --git a/website_product_customization/static/description/assets/icons/puzzle-piece-icon.svg b/website_product_customization/static/description/assets/icons/puzzle-piece-icon.svg new file mode 100755 index 000000000..3e9ad9373 --- /dev/null +++ b/website_product_customization/static/description/assets/icons/puzzle-piece-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/website_product_customization/static/description/assets/icons/puzzle.png b/website_product_customization/static/description/assets/icons/puzzle.png new file mode 100755 index 000000000..65cf854e7 Binary files /dev/null and b/website_product_customization/static/description/assets/icons/puzzle.png differ diff --git a/website_product_customization/static/description/assets/icons/replace-icon.svg b/website_product_customization/static/description/assets/icons/replace-icon.svg new file mode 100755 index 000000000..d0e3a7af1 --- /dev/null +++ b/website_product_customization/static/description/assets/icons/replace-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/website_product_customization/static/description/assets/icons/restaurant-black.png b/website_product_customization/static/description/assets/icons/restaurant-black.png new file mode 100755 index 000000000..4a35eb939 Binary files /dev/null and b/website_product_customization/static/description/assets/icons/restaurant-black.png differ diff --git a/website_product_customization/static/description/assets/icons/screenshot-main.png b/website_product_customization/static/description/assets/icons/screenshot-main.png new file mode 100755 index 000000000..575f8e676 Binary files /dev/null and b/website_product_customization/static/description/assets/icons/screenshot-main.png differ diff --git a/website_product_customization/static/description/assets/icons/screenshot.png b/website_product_customization/static/description/assets/icons/screenshot.png new file mode 100755 index 000000000..cef272529 Binary files /dev/null and b/website_product_customization/static/description/assets/icons/screenshot.png differ diff --git a/website_product_customization/static/description/assets/icons/service-black.png b/website_product_customization/static/description/assets/icons/service-black.png new file mode 100755 index 000000000..301ab51cb Binary files /dev/null and b/website_product_customization/static/description/assets/icons/service-black.png differ diff --git a/website_product_customization/static/description/assets/icons/skype-fill.svg b/website_product_customization/static/description/assets/icons/skype-fill.svg new file mode 100755 index 000000000..c17423639 --- /dev/null +++ b/website_product_customization/static/description/assets/icons/skype-fill.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/website_product_customization/static/description/assets/icons/skype.png b/website_product_customization/static/description/assets/icons/skype.png new file mode 100755 index 000000000..51b409fb3 Binary files /dev/null and b/website_product_customization/static/description/assets/icons/skype.png differ diff --git a/website_product_customization/static/description/assets/icons/skype.svg b/website_product_customization/static/description/assets/icons/skype.svg new file mode 100755 index 000000000..df3dad39b --- /dev/null +++ b/website_product_customization/static/description/assets/icons/skype.svg @@ -0,0 +1,3 @@ + + + diff --git a/website_product_customization/static/description/assets/icons/star-1.svg b/website_product_customization/static/description/assets/icons/star-1.svg new file mode 100755 index 000000000..7e55ab162 --- /dev/null +++ b/website_product_customization/static/description/assets/icons/star-1.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/website_product_customization/static/description/assets/icons/star-2.svg b/website_product_customization/static/description/assets/icons/star-2.svg new file mode 100755 index 000000000..5ae9f507a --- /dev/null +++ b/website_product_customization/static/description/assets/icons/star-2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/website_product_customization/static/description/assets/icons/support.png b/website_product_customization/static/description/assets/icons/support.png new file mode 100755 index 000000000..4f18b8b82 Binary files /dev/null and b/website_product_customization/static/description/assets/icons/support.png differ diff --git a/website_product_customization/static/description/assets/icons/test-1 - Copy.png b/website_product_customization/static/description/assets/icons/test-1 - Copy.png new file mode 100755 index 000000000..f6a902663 Binary files /dev/null and b/website_product_customization/static/description/assets/icons/test-1 - Copy.png differ diff --git a/website_product_customization/static/description/assets/icons/test-1.png b/website_product_customization/static/description/assets/icons/test-1.png new file mode 100755 index 000000000..0908add2b Binary files /dev/null and b/website_product_customization/static/description/assets/icons/test-1.png differ diff --git a/website_product_customization/static/description/assets/icons/test-2.png b/website_product_customization/static/description/assets/icons/test-2.png new file mode 100755 index 000000000..4671fe91e Binary files /dev/null and b/website_product_customization/static/description/assets/icons/test-2.png differ diff --git a/website_product_customization/static/description/assets/icons/trading-black.png b/website_product_customization/static/description/assets/icons/trading-black.png new file mode 100755 index 000000000..9398ba2f1 Binary files /dev/null and b/website_product_customization/static/description/assets/icons/trading-black.png differ diff --git a/website_product_customization/static/description/assets/icons/training.png b/website_product_customization/static/description/assets/icons/training.png new file mode 100755 index 000000000..884ca024d Binary files /dev/null and b/website_product_customization/static/description/assets/icons/training.png differ diff --git a/website_product_customization/static/description/assets/icons/translate.svg b/website_product_customization/static/description/assets/icons/translate.svg new file mode 100755 index 000000000..af9c8a1aa --- /dev/null +++ b/website_product_customization/static/description/assets/icons/translate.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/website_product_customization/static/description/assets/icons/update.png b/website_product_customization/static/description/assets/icons/update.png new file mode 100755 index 000000000..ecbc5a01a Binary files /dev/null and b/website_product_customization/static/description/assets/icons/update.png differ diff --git a/website_product_customization/static/description/assets/icons/user.png b/website_product_customization/static/description/assets/icons/user.png new file mode 100755 index 000000000..6ffb23d9f Binary files /dev/null and b/website_product_customization/static/description/assets/icons/user.png differ diff --git a/website_product_customization/static/description/assets/icons/video.png b/website_product_customization/static/description/assets/icons/video.png new file mode 100755 index 000000000..576705b17 Binary files /dev/null and b/website_product_customization/static/description/assets/icons/video.png differ diff --git a/website_product_customization/static/description/assets/icons/whatsapp.png b/website_product_customization/static/description/assets/icons/whatsapp.png new file mode 100755 index 000000000..d513a5356 Binary files /dev/null and b/website_product_customization/static/description/assets/icons/whatsapp.png differ diff --git a/website_product_customization/static/description/assets/icons/wrench-icon.svg b/website_product_customization/static/description/assets/icons/wrench-icon.svg new file mode 100755 index 000000000..174b5a465 --- /dev/null +++ b/website_product_customization/static/description/assets/icons/wrench-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/website_product_customization/static/description/assets/icons/wrench.png b/website_product_customization/static/description/assets/icons/wrench.png new file mode 100755 index 000000000..6c04dea0f Binary files /dev/null and b/website_product_customization/static/description/assets/icons/wrench.png differ diff --git a/website_product_customization/static/description/assets/modules/1.gif b/website_product_customization/static/description/assets/modules/1.gif new file mode 100755 index 000000000..ae3a880a2 Binary files /dev/null and b/website_product_customization/static/description/assets/modules/1.gif differ diff --git a/website_product_customization/static/description/assets/modules/2.gif b/website_product_customization/static/description/assets/modules/2.gif new file mode 100755 index 000000000..d19e2b352 Binary files /dev/null and b/website_product_customization/static/description/assets/modules/2.gif differ diff --git a/website_product_customization/static/description/assets/modules/3.png b/website_product_customization/static/description/assets/modules/3.png new file mode 100755 index 000000000..8513873ea Binary files /dev/null and b/website_product_customization/static/description/assets/modules/3.png differ diff --git a/website_product_customization/static/description/assets/modules/4.png b/website_product_customization/static/description/assets/modules/4.png new file mode 100755 index 000000000..3bedf7981 Binary files /dev/null and b/website_product_customization/static/description/assets/modules/4.png differ diff --git a/website_product_customization/static/description/assets/modules/5.png b/website_product_customization/static/description/assets/modules/5.png new file mode 100755 index 000000000..0e311ca87 Binary files /dev/null and b/website_product_customization/static/description/assets/modules/5.png differ diff --git a/website_product_customization/static/description/assets/modules/6.jpg b/website_product_customization/static/description/assets/modules/6.jpg new file mode 100755 index 000000000..67c7f7062 Binary files /dev/null and b/website_product_customization/static/description/assets/modules/6.jpg differ diff --git a/website_product_customization/static/description/assets/screenshots/1.png b/website_product_customization/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..ba8e2f0e5 Binary files /dev/null and b/website_product_customization/static/description/assets/screenshots/1.png differ diff --git a/website_product_customization/static/description/assets/screenshots/2.png b/website_product_customization/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..399d7b179 Binary files /dev/null and b/website_product_customization/static/description/assets/screenshots/2.png differ diff --git a/website_product_customization/static/description/assets/screenshots/3.png b/website_product_customization/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..83be9531d Binary files /dev/null and b/website_product_customization/static/description/assets/screenshots/3.png differ diff --git a/website_product_customization/static/description/assets/screenshots/4.png b/website_product_customization/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..ac9f95600 Binary files /dev/null and b/website_product_customization/static/description/assets/screenshots/4.png differ diff --git a/website_product_customization/static/description/assets/screenshots/5.png b/website_product_customization/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..46c5c5235 Binary files /dev/null and b/website_product_customization/static/description/assets/screenshots/5.png differ diff --git a/website_product_customization/static/description/assets/screenshots/6.png b/website_product_customization/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..d02c68c72 Binary files /dev/null and b/website_product_customization/static/description/assets/screenshots/6.png differ diff --git a/website_product_customization/static/description/assets/screenshots/7.png b/website_product_customization/static/description/assets/screenshots/7.png new file mode 100644 index 000000000..b54ba2b3a Binary files /dev/null and b/website_product_customization/static/description/assets/screenshots/7.png differ diff --git a/website_product_customization/static/description/assets/screenshots/hero.gif b/website_product_customization/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..ba0c518a0 Binary files /dev/null and b/website_product_customization/static/description/assets/screenshots/hero.gif differ diff --git a/website_product_customization/static/description/assets/screenshots/web1.png b/website_product_customization/static/description/assets/screenshots/web1.png new file mode 100644 index 000000000..4f0a8c322 Binary files /dev/null and b/website_product_customization/static/description/assets/screenshots/web1.png differ diff --git a/website_product_customization/static/description/assets/screenshots/web2.png b/website_product_customization/static/description/assets/screenshots/web2.png new file mode 100644 index 000000000..2a8620639 Binary files /dev/null and b/website_product_customization/static/description/assets/screenshots/web2.png differ diff --git a/website_product_customization/static/description/assets/screenshots/web3.png b/website_product_customization/static/description/assets/screenshots/web3.png new file mode 100644 index 000000000..4983b7878 Binary files /dev/null and b/website_product_customization/static/description/assets/screenshots/web3.png differ diff --git a/website_product_customization/static/description/assets/screenshots/web4.png b/website_product_customization/static/description/assets/screenshots/web4.png new file mode 100644 index 000000000..2804ac43e Binary files /dev/null and b/website_product_customization/static/description/assets/screenshots/web4.png differ diff --git a/website_product_customization/static/description/assets/screenshots/web5.png b/website_product_customization/static/description/assets/screenshots/web5.png new file mode 100644 index 000000000..fb74c78d8 Binary files /dev/null and b/website_product_customization/static/description/assets/screenshots/web5.png differ diff --git a/website_product_customization/static/description/assets/screenshots/web6.png b/website_product_customization/static/description/assets/screenshots/web6.png new file mode 100644 index 000000000..2071f812b Binary files /dev/null and b/website_product_customization/static/description/assets/screenshots/web6.png differ diff --git a/website_product_customization/static/description/assets/screenshots/web7.png b/website_product_customization/static/description/assets/screenshots/web7.png new file mode 100644 index 000000000..89c777814 Binary files /dev/null and b/website_product_customization/static/description/assets/screenshots/web7.png differ diff --git a/website_product_customization/static/description/banner.jpg b/website_product_customization/static/description/banner.jpg new file mode 100644 index 000000000..f64fdab00 Binary files /dev/null and b/website_product_customization/static/description/banner.jpg differ diff --git a/website_product_customization/static/description/icon.png b/website_product_customization/static/description/icon.png new file mode 100644 index 000000000..6afabf9e2 Binary files /dev/null and b/website_product_customization/static/description/icon.png differ diff --git a/website_product_customization/static/description/index.html b/website_product_customization/static/description/index.html new file mode 100644 index 000000000..cd8f9e532 --- /dev/null +++ b/website_product_customization/static/description/index.html @@ -0,0 +1,919 @@ + + + + + + Website Product Customization + + + + + + + + + + +
+
+ + + +
+
+ Community +
+
+ Enterprise +
+
+
+ +
+
+
+
+

+ Customize Product Design From Website. +

+

Website Product Customization +

+
+
+ +
+ +
+ +
+
+
+ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+

Key + Highlights

+
+
+
+
+ +
+

+ Create customized designs.

+
+
+
+
+
+ +
+

+ Allows users to customize products by choosing + the designs from front-end. +

+
+
+
+
+ +
+
+
+ Website Product Customization +

+ Are you ready to make your business more + organized? +
Improve now! +

+ +
+
+ +
+
+
+ + + + +
+
+ +
+
+
+
+ acc_bg +
+ +
+
+
+
+

+ Create designs in the back-end +

+
+
+

+ For the design to be available to the + front-end customer, create the designs in + the backend first. +

+
+
+
+ +
+
+
+
+
+
+
+
+
+

+ Click on the 'CUSTOMIZE PRODUCT' + button. + +

+
+
+

+ Click on the 'CUSTOMIZE PRODUCT' button to + customize the design of the product. +

+
+
+
+ +
+
+
+
+
+
+
+
+
+

+ Choose preferred design. + +

+
+
+

+ Select the preferred design from the + available options. +

+
+
+
+ +
+
+
+
+
+
+
+
+
+

+ Design appears on the product + + +

+
+
+

+ After choosing appropriate design, the + design will automatically appear on the + product. +

+
+
+
+ +
+
+
+
+
+
+
+
+
+

+ Save the design. + + + +

+
+
+

+ After customizing the design by moving the + design, resizing the design, or rotating the + design etc., save the changes by clicking on + the 'Save' button. +

+
+
+
+ +
+
+ +
+
+
+
+
+
+
+
+
+

+ Updated product in the back-end. + + + +

+
+
+

+ Product with design will appear on the associated + sale order in the back-end. +

+
+
+
+ +
+
+
+
+
+ +
+
+
+ +
+
+
+
+ +
+

Create customized designs

+
+ +
+
+
+
+
+
+ +
+

Allows users to customize products by choosing + the designs from front-end

+
+
+
+
+
+
+ +
+
+

+ Latest Release 18.0.1.0.0 +

+ + 27th November, 2024 + +
+
+
+
+
+ Add +
+
+
+
    +
  • + Initial Commit +
  • + +
+
+
+
+
+
+
+
+
+
+ + + +
+

+ Related Products +

+ +
+ + +
+

+ Our Services

+ +
+ +
+
+ .... +
+
+ +
+ + +
+
+ + + + + + diff --git a/website_product_customization/static/src/css/style.css b/website_product_customization/static/src/css/style.css new file mode 100644 index 000000000..25f6980a1 --- /dev/null +++ b/website_product_customization/static/src/css/style.css @@ -0,0 +1,44 @@ + +.product_customisation_image{ + width:450px; + height:500px; +} + +.drawing-area { + position: absolute; + top: 50px; + left: 50px; + z-index: 10; + width: 350px; + height: 400px; + border: 1px solid #ccc; +} + +.canvas-container { + width: 350px !important; + height: 400px !important; + position: relative; + user-select: none; +} + +#tshirt-div { + width: 450px; + height: 550px; + position: relative; + background-color: #fff; +} + +#canvas { + position: absolute; + width: 100px !important; + height: 100px !important; + left: 0px; + top: 0px; + user-select: none; + cursor: default; +} + +.oe_structure { + display: grid; + justify-content: center; +} \ No newline at end of file diff --git a/website_product_customization/static/src/js/website_product_custom.js b/website_product_customization/static/src/js/website_product_custom.js new file mode 100644 index 000000000..6a6ba9bee --- /dev/null +++ b/website_product_customization/static/src/js/website_product_custom.js @@ -0,0 +1,55 @@ +/** @odoo-module **/ +import publicWidget from "@web/legacy/js/public/public_widget"; + +var count = 0; + +document.addEventListener("keydown", function(event){ + if (event.key === "Delete" && window.canvas) { + window.canvas.remove(window.canvas.getActiveObject()); + } +}); + +publicWidget.registry.canvasWidget = publicWidget.Widget.extend({ + selector: '#product_detail', + events: { + 'change #product-design': '_onChangeSelect', + 'click .design_save': '_onSave', + 'click #product_customize_btn': '_addProductDesign', + }, + _onChangeSelect: function() { + if (typeof fabric === "undefined") { + console.error("Fabric.js is not loaded"); + return; + } + var selectedOption = this.$el.find('#product-design').val().toString(); + var design_image = new Image(); + design_image.src = '/web/image/product.design/' + selectedOption + '/product_design'; + design_image.onload = function () { + window.canvas = new fabric.Canvas('tshirt-canvas'); // Assign to window for global access + var image = new fabric.Image(design_image); + image.scaleToHeight(100); + image.scaleToWidth(100); + window.canvas.centerObject(image); + window.canvas.add(image); + window.canvas.renderAll(); + }; + }, + _onSave: function() { + var node = document.querySelector('#tshirt-div'); + domtoimage.toPng(node).then(function (dataUrl) { + var img = new Image(); + img.classList.add("design_image_doc"); + img.src = dataUrl; + document.body.appendChild(img); + alert('Saved your customized Image! Now you can add it to the cart.'); + }); + }, + _addProductDesign: function(ev) { + count++; + if (count % 2 === 0) { + ev.target.offsetParent.nextElementSibling.classList.add("d-none"); + } else { + ev.target.offsetParent.nextElementSibling.classList.remove("d-none"); + } + }, +}); diff --git a/website_product_customization/static/src/js/website_sale.js b/website_product_customization/static/src/js/website_sale.js new file mode 100644 index 000000000..811d121c3 --- /dev/null +++ b/website_product_customization/static/src/js/website_sale.js @@ -0,0 +1,35 @@ +/** @odoo-module **/ +import { WebsiteSale } from '@website_sale/js/website_sale'; +import { patch } from '@web/core/utils/patch'; + +// Patch the WebsiteSale class with custom modifications +patch(WebsiteSale.prototype,{ + + async _submitForm(){ +// Super the function to update the design image if it has customized + var image_element = document.getElementsByClassName("design_image_doc") + if (parseInt(image_element.length) == parseInt(0)) { + return super._submitForm(...arguments); + } + else { + const params = this.rootProduct; + if (document.getElementsByClassName('design_image_doc')[0]){ + var design_image = document.getElementsByClassName('design_image_doc')[0].currentSrc; + } + params.design_image = design_image; + return super._submitForm(...arguments); + }; + }, + + + _serializeProduct(product) { +// Updating the design_image value in case of the variant product + var result = super._serializeProduct(...arguments); + if (document.getElementsByClassName('design_image_doc')[0]) { + result.design_image = document.getElementsByClassName('design_image_doc')[0].currentSrc; + } + return result; + + }, + +}); diff --git a/website_product_customization/views/product_design_views.xml b/website_product_customization/views/product_design_views.xml new file mode 100644 index 000000000..cb2b4bff7 --- /dev/null +++ b/website_product_customization/views/product_design_views.xml @@ -0,0 +1,48 @@ + + + + + product.design.view.tree + product.design + + + + + + + + + Product.design.view.form + product.design + +
+ + + + + + + + +
+
+
+ + + Product Design View + product.design + list,form + + + +
diff --git a/website_product_customization/views/sale_order_views.xml b/website_product_customization/views/sale_order_views.xml new file mode 100644 index 000000000..1ef548c57 --- /dev/null +++ b/website_product_customization/views/sale_order_views.xml @@ -0,0 +1,20 @@ + + + + + + sale.order.view.tree.inherit.website.product.customisation + + sale.order + + + + + + + + + diff --git a/website_product_customization/views/website_sale_templates.xml b/website_product_customization/views/website_sale_templates.xml new file mode 100644 index 000000000..715c8bf04 --- /dev/null +++ b/website_product_customization/views/website_sale_templates.xml @@ -0,0 +1,75 @@ + + + +