diff --git a/ecommerce_quick_view/README.rst b/ecommerce_quick_view/README.rst new file mode 100644 index 000000000..a1f921a7b --- /dev/null +++ b/ecommerce_quick_view/README.rst @@ -0,0 +1,46 @@ +.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg + :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +Product Quickview in e-Commerce +=============================== +* A Module for showing quickview popup for products in products listing page. + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Credits +------- +* Developer: (V16) Naveen Krishna, 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/ecommerce_quick_view/__init__.py b/ecommerce_quick_view/__init__.py new file mode 100644 index 000000000..f77bd64ca --- /dev/null +++ b/ecommerce_quick_view/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import controller diff --git a/ecommerce_quick_view/__manifest__.py b/ecommerce_quick_view/__manifest__.py new file mode 100644 index 000000000..8f302192c --- /dev/null +++ b/ecommerce_quick_view/__manifest__.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': 'Product Quickview in e-Commerce', + 'version': '16.0.1.0.0', + 'category': 'Website', + 'summary': 'Quick View of Products in Product-listing Page.', + 'description': """ Website Product Quickview module is used for enable + the quickview option in eCommerce product listing, So that the visitors + can load product info without redirected to another page """, + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['website_sale'], + 'data': [ + 'views/templates.xml', + ], + 'assets': { + 'web.assets_frontend': [ + '/ecommerce_quick_view/static/src/js/quick_view_modal.js', + ], + }, + 'images': ['static/description/banner.jpg'], + 'license': 'LGPL-3', + 'installable': True, + 'application': False, + 'auto_install': False, +} diff --git a/ecommerce_quick_view/controller/__init__.py b/ecommerce_quick_view/controller/__init__.py new file mode 100644 index 000000000..8b480afcd --- /dev/null +++ b/ecommerce_quick_view/controller/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import ecommerce_quick_view diff --git a/ecommerce_quick_view/controller/ecommerce_quick_view.py b/ecommerce_quick_view/controller/ecommerce_quick_view.py new file mode 100644 index 000000000..00a4062ec --- /dev/null +++ b/ecommerce_quick_view/controller/ecommerce_quick_view.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import http +from odoo.addons.website_sale.controllers.main import WebsiteSale +from odoo.http import request + + +class QuickViewWebsiteSale(WebsiteSale): + """ Controller for quick view functionality """ + @http.route('/c_quick_view/get_quick_view_html', type='json', + auth='public', website=True) + def get_quick_view_html(self, category='', search='', **kwargs): + """ Generate quick view page based on given attributes """ + product_id = kwargs.get('product_id') + product = request.env['product.template'].browse([product_id]) \ + if product_id else False + if not product: + return False + value = request.env["ir.ui.view"]._render_template( + "ecommerce_quick_view.c_product_quick_view", + self._prepare_product_values(product, category, + search, **kwargs)) + return value diff --git a/ecommerce_quick_view/doc/RELEASE_NOTES.md b/ecommerce_quick_view/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..78e9c8a97 --- /dev/null +++ b/ecommerce_quick_view/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 03.11.2023 +#### Version 16.0.1.0.0 +#### ADD +- Initial commit for Product Quickview in e-Commerce diff --git a/ecommerce_quick_view/static/description/assets/icons/check.png b/ecommerce_quick_view/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/icons/check.png differ diff --git a/ecommerce_quick_view/static/description/assets/icons/chevron.png b/ecommerce_quick_view/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/icons/chevron.png differ diff --git a/ecommerce_quick_view/static/description/assets/icons/cogs.png b/ecommerce_quick_view/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/icons/cogs.png differ diff --git a/ecommerce_quick_view/static/description/assets/icons/consultation.png b/ecommerce_quick_view/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/icons/consultation.png differ diff --git a/ecommerce_quick_view/static/description/assets/icons/ecom-black.png b/ecommerce_quick_view/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/icons/ecom-black.png differ diff --git a/ecommerce_quick_view/static/description/assets/icons/education-black.png b/ecommerce_quick_view/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/icons/education-black.png differ diff --git a/ecommerce_quick_view/static/description/assets/icons/hotel-black.png b/ecommerce_quick_view/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/icons/hotel-black.png differ diff --git a/ecommerce_quick_view/static/description/assets/icons/license.png b/ecommerce_quick_view/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/icons/license.png differ diff --git a/ecommerce_quick_view/static/description/assets/icons/lifebuoy.png b/ecommerce_quick_view/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/icons/lifebuoy.png differ diff --git a/ecommerce_quick_view/static/description/assets/icons/manufacturing-black.png b/ecommerce_quick_view/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/icons/manufacturing-black.png differ diff --git a/ecommerce_quick_view/static/description/assets/icons/pos-black.png b/ecommerce_quick_view/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/icons/pos-black.png differ diff --git a/ecommerce_quick_view/static/description/assets/icons/puzzle.png b/ecommerce_quick_view/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/icons/puzzle.png differ diff --git a/ecommerce_quick_view/static/description/assets/icons/restaurant-black.png b/ecommerce_quick_view/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/icons/restaurant-black.png differ diff --git a/ecommerce_quick_view/static/description/assets/icons/service-black.png b/ecommerce_quick_view/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/icons/service-black.png differ diff --git a/ecommerce_quick_view/static/description/assets/icons/trading-black.png b/ecommerce_quick_view/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/icons/trading-black.png differ diff --git a/ecommerce_quick_view/static/description/assets/icons/training.png b/ecommerce_quick_view/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/icons/training.png differ diff --git a/ecommerce_quick_view/static/description/assets/icons/update.png b/ecommerce_quick_view/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/icons/update.png differ diff --git a/ecommerce_quick_view/static/description/assets/icons/user.png b/ecommerce_quick_view/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/icons/user.png differ diff --git a/ecommerce_quick_view/static/description/assets/icons/wrench.png b/ecommerce_quick_view/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/icons/wrench.png differ diff --git a/ecommerce_quick_view/static/description/assets/misc/categories.png b/ecommerce_quick_view/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/misc/categories.png differ diff --git a/ecommerce_quick_view/static/description/assets/misc/check-box.png b/ecommerce_quick_view/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/misc/check-box.png differ diff --git a/ecommerce_quick_view/static/description/assets/misc/compass.png b/ecommerce_quick_view/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/misc/compass.png differ diff --git a/ecommerce_quick_view/static/description/assets/misc/corporate.png b/ecommerce_quick_view/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/misc/corporate.png differ diff --git a/ecommerce_quick_view/static/description/assets/misc/customer-support.png b/ecommerce_quick_view/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/misc/customer-support.png differ diff --git a/ecommerce_quick_view/static/description/assets/misc/cybrosys-logo.png b/ecommerce_quick_view/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/misc/cybrosys-logo.png differ diff --git a/ecommerce_quick_view/static/description/assets/misc/features.png b/ecommerce_quick_view/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/misc/features.png differ diff --git a/ecommerce_quick_view/static/description/assets/misc/logo.png b/ecommerce_quick_view/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/misc/logo.png differ diff --git a/ecommerce_quick_view/static/description/assets/misc/pictures.png b/ecommerce_quick_view/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/misc/pictures.png differ diff --git a/ecommerce_quick_view/static/description/assets/misc/pie-chart.png b/ecommerce_quick_view/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/misc/pie-chart.png differ diff --git a/ecommerce_quick_view/static/description/assets/misc/right-arrow.png b/ecommerce_quick_view/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/misc/right-arrow.png differ diff --git a/ecommerce_quick_view/static/description/assets/misc/star.png b/ecommerce_quick_view/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/misc/star.png differ diff --git a/ecommerce_quick_view/static/description/assets/misc/support.png b/ecommerce_quick_view/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/misc/support.png differ diff --git a/ecommerce_quick_view/static/description/assets/misc/whatsapp.png b/ecommerce_quick_view/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/misc/whatsapp.png differ diff --git a/ecommerce_quick_view/static/description/assets/modules/l1.png b/ecommerce_quick_view/static/description/assets/modules/l1.png new file mode 100644 index 000000000..ed175b076 Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/modules/l1.png differ diff --git a/ecommerce_quick_view/static/description/assets/modules/l2.png b/ecommerce_quick_view/static/description/assets/modules/l2.png new file mode 100644 index 000000000..a3194264c Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/modules/l2.png differ diff --git a/ecommerce_quick_view/static/description/assets/modules/l3.png b/ecommerce_quick_view/static/description/assets/modules/l3.png new file mode 100644 index 000000000..e894393ef Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/modules/l3.png differ diff --git a/ecommerce_quick_view/static/description/assets/modules/l4.png b/ecommerce_quick_view/static/description/assets/modules/l4.png new file mode 100644 index 000000000..f3c986fc1 Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/modules/l4.png differ diff --git a/ecommerce_quick_view/static/description/assets/modules/l5.png b/ecommerce_quick_view/static/description/assets/modules/l5.png new file mode 100644 index 000000000..b21837312 Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/modules/l5.png differ diff --git a/ecommerce_quick_view/static/description/assets/modules/l6.png b/ecommerce_quick_view/static/description/assets/modules/l6.png new file mode 100644 index 000000000..e64a5b55c Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/modules/l6.png differ diff --git a/ecommerce_quick_view/static/description/assets/screenshots/hero.gif b/ecommerce_quick_view/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..b7d408a53 Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/screenshots/hero.gif differ diff --git a/ecommerce_quick_view/static/description/assets/screenshots/image_1.png b/ecommerce_quick_view/static/description/assets/screenshots/image_1.png new file mode 100644 index 000000000..4769336f3 Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/screenshots/image_1.png differ diff --git a/ecommerce_quick_view/static/description/assets/screenshots/image_2.png b/ecommerce_quick_view/static/description/assets/screenshots/image_2.png new file mode 100644 index 000000000..a4731c37c Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/screenshots/image_2.png differ diff --git a/ecommerce_quick_view/static/description/banner.jpg b/ecommerce_quick_view/static/description/banner.jpg new file mode 100644 index 000000000..eebddea63 Binary files /dev/null and b/ecommerce_quick_view/static/description/banner.jpg differ diff --git a/ecommerce_quick_view/static/description/icon.png b/ecommerce_quick_view/static/description/icon.png new file mode 100644 index 000000000..284eaf514 Binary files /dev/null and b/ecommerce_quick_view/static/description/icon.png differ diff --git a/ecommerce_quick_view/static/description/index.html b/ecommerce_quick_view/static/description/index.html new file mode 100644 index 000000000..217c6c4dd --- /dev/null +++ b/ecommerce_quick_view/static/description/index.html @@ -0,0 +1,537 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ + +
+
+
+ +

+ Product Quickview in e-Commerce

+

Module for Showing Quickview Popup for Products in Products-listing Page.

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

Explore This + Module

+
+ + + +
+
+ +
+

Overview +

+
+
+
+ This module adds a "Quick View" button to the product listing on a website. + By adding the "Quick View" button, users can view additional product information, + such as a product description, specifications, reviews, and more, without having to navigate to a separate product detail page. + This saves users time and effort and allows them to quickly assess whether the product meets their needs. +
+
+
+ + +
+
+ +
+

Features +

+
+
+
+
+ + Enables quick view mode for both Mobile and Desktop Clients. +
+ +
+ + + Loads up all Product information in quick view. + +
+
+ + + Reduces UI refresh time to load Product information. + +
+
+ + + All major functionalities of the Product info Page is added in quick view. + +
+
+
+ + +
+
+ +
+

Screenshots +

+
+
+
+
+

Quickview button

+

Enable the button to open quickview for the selected product.

+ +
+ +
+

Quickview window

+

Quickview window contains most of the product information and operation without reloading the page.

+ +
+
+
+ + +
+
+ +
+

Related + Products +

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

Our Services +

+
+
+
+
+
+ +
+
+ Odoo + Customization
+
+
+
+ +
+
+ Odoo + Implementation
+
+
+
+ +
+
+ Odoo + Support
+
+
+
+ +
+
+ Hire + Odoo + Developer
+
+
+
+ +
+
+ Odoo + Integration
+
+
+
+ +
+
+ Odoo + Migration
+
+
+
+ +
+
+ Odoo + Consultancy
+
+
+
+ +
+
+ Odoo + Implementation
+
+
+
+ +
+
+ Odoo + Licensing Consultancy
+
+
+
+ + +
+
+ +
+

Our + Industries +

+
+
+
+
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

+
+
+
+
+ +
+ E-commerce & Website +
+

+ Mobile + friendly, + awe-inspiring product pages

+
+
+
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

+
+
+
+
+ + +
+
+ +
+

Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need help? Get in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on WhatsApp!

+ +

+91 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ diff --git a/ecommerce_quick_view/static/src/js/quick_view_modal.js b/ecommerce_quick_view/static/src/js/quick_view_modal.js new file mode 100644 index 000000000..5e0634d7a --- /dev/null +++ b/ecommerce_quick_view/static/src/js/quick_view_modal.js @@ -0,0 +1,40 @@ +/** @odoo-module **/ + +var core = require('web.core'); +var rpc = require('web.rpc'); +var publicWidget = require('web.public.widget'); +require('website_sale.website_sale'); + +var QuickViewModal = publicWidget.Widget.extend({ + selector: '.oe_website_sale', + events: {'click a.c-product-quick-view-action': '_onQuickViewClick',}, + init(params) { + this._super(... arguments); + }, + show_modal(template) { + var $modal = $(template).appendTo($(this.selector)); + $modal.modal('show'); + core.bus.trigger('DOM_updated'); + // get the DOM element from the jQuery object + // attach an event listener to remove the modal from the DOM when it is hidden + $modal.get(0).addEventListener('hidden.bs.modal', function (event) { + $modal.remove(); + }, {once: true}); + }, + async _onQuickViewClick(ev) { + ev.preventDefault(); + var product_id = $(ev.currentTarget).data('product-id'); + var self = this; + try { + var result = await rpc.query({ + route: '/c_quick_view/get_quick_view_html', + params: {product_id: product_id}, + }); + self.show_modal(result); + } catch (err) { + reject(err); + } + }, +}); +publicWidget.registry.quick_view_modal = QuickViewModal; +return QuickViewModal; diff --git a/ecommerce_quick_view/views/templates.xml b/ecommerce_quick_view/views/templates.xml new file mode 100644 index 000000000..02593be4f --- /dev/null +++ b/ecommerce_quick_view/views/templates.xml @@ -0,0 +1,138 @@ + + + + + + +