diff --git a/ecommerce_quick_view/README.rst b/ecommerce_quick_view/README.rst new file mode 100644 index 000000000..8ef1729d3 --- /dev/null +++ b/ecommerce_quick_view/README.rst @@ -0,0 +1,47 @@ +.. 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 + +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 (AGPL v3). +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +* Developer: (V17) Bhagyadev KP +* 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..6a18c81c8 --- /dev/null +++ b/ecommerce_quick_view/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Bhagyadev KP (odoo@cybrosys.com) +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# 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..f29ba7559 --- /dev/null +++ b/ecommerce_quick_view/__manifest__.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Bhagyadev KP (odoo@cybrosys.com) +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################ +{ + 'name': 'Product Quickview in e-Commerce', + 'version': '17.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': 'AGPL-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..92ab85833 --- /dev/null +++ b/ecommerce_quick_view/controller/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Bhagyadev KP (odoo@cybrosys.com) +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# 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..c970bce2d --- /dev/null +++ b/ecommerce_quick_view/controller/ecommerce_quick_view.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2024-TODAY Cybrosys Technologies(). +# Author: Bhagyadev KP (odoo@cybrosys.com) +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# 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..1064bc499 --- /dev/null +++ b/ecommerce_quick_view/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 15.04.2024 +#### Version 17.0.1.0.0 +#### ADD +- Initial commit for Product Quickview in e-Commerce diff --git a/ecommerce_quick_view/static/description/assets/icons/capture (1).png b/ecommerce_quick_view/static/description/assets/icons/capture (1).png new file mode 100644 index 000000000..8824deafc Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/icons/capture (1).png differ 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/img.png b/ecommerce_quick_view/static/description/assets/icons/img.png new file mode 100644 index 000000000..70197f477 Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/icons/img.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/photo-capture.png b/ecommerce_quick_view/static/description/assets/icons/photo-capture.png new file mode 100644 index 000000000..06c111758 Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/icons/photo-capture.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/Cybrosys R.png b/ecommerce_quick_view/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/misc/Cybrosys R.png differ diff --git a/ecommerce_quick_view/static/description/assets/misc/email.svg b/ecommerce_quick_view/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/ecommerce_quick_view/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ecommerce_quick_view/static/description/assets/misc/phone.svg b/ecommerce_quick_view/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/ecommerce_quick_view/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/ecommerce_quick_view/static/description/assets/misc/star (1) 2.svg b/ecommerce_quick_view/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/ecommerce_quick_view/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/ecommerce_quick_view/static/description/assets/misc/support (1) 1.svg b/ecommerce_quick_view/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/ecommerce_quick_view/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/ecommerce_quick_view/static/description/assets/misc/support-email.svg b/ecommerce_quick_view/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/ecommerce_quick_view/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/ecommerce_quick_view/static/description/assets/misc/tick-mark.svg b/ecommerce_quick_view/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/ecommerce_quick_view/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/ecommerce_quick_view/static/description/assets/misc/whatsapp 1.svg b/ecommerce_quick_view/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/ecommerce_quick_view/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/ecommerce_quick_view/static/description/assets/misc/whatsapp.svg b/ecommerce_quick_view/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/ecommerce_quick_view/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ecommerce_quick_view/static/description/assets/modules/1.jpg b/ecommerce_quick_view/static/description/assets/modules/1.jpg new file mode 100644 index 000000000..08bbafeb6 Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/modules/1.jpg differ diff --git a/ecommerce_quick_view/static/description/assets/modules/2.png b/ecommerce_quick_view/static/description/assets/modules/2.png new file mode 100644 index 000000000..66730082c Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/modules/2.png differ diff --git a/ecommerce_quick_view/static/description/assets/modules/3.jpg b/ecommerce_quick_view/static/description/assets/modules/3.jpg new file mode 100644 index 000000000..3d171226b Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/modules/3.jpg differ diff --git a/ecommerce_quick_view/static/description/assets/modules/4.jpg b/ecommerce_quick_view/static/description/assets/modules/4.jpg new file mode 100644 index 000000000..1f3f2e27f Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/modules/4.jpg differ diff --git a/ecommerce_quick_view/static/description/assets/modules/5.jpg b/ecommerce_quick_view/static/description/assets/modules/5.jpg new file mode 100644 index 000000000..0db717519 Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/modules/5.jpg differ diff --git a/ecommerce_quick_view/static/description/assets/modules/6.jpg b/ecommerce_quick_view/static/description/assets/modules/6.jpg new file mode 100644 index 000000000..cd62a577c Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/modules/6.jpg 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..982c9a14c 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/s1.png b/ecommerce_quick_view/static/description/assets/screenshots/s1.png new file mode 100644 index 000000000..aa1aa6469 Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/screenshots/s1.png differ diff --git a/ecommerce_quick_view/static/description/assets/screenshots/s2.png b/ecommerce_quick_view/static/description/assets/screenshots/s2.png new file mode 100644 index 000000000..a967be8f5 Binary files /dev/null and b/ecommerce_quick_view/static/description/assets/screenshots/s2.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..f332fe9b3 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..09a33ceeb 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..1eaf32a09 --- /dev/null +++ b/ecommerce_quick_view/static/description/index.html @@ -0,0 +1,709 @@ + + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

Product Quickview in e-Commerce

+

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

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ 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. +

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

+ Go to Website > Shop. Hover on a product and + you can see the quick view button.

+
+
+
+
+
+
+ +
+
+

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

+
+
+
+
+
+
+
    +
  • + 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. +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:15th April 2024 +
+

+ + Initial Commit for Product Quickview in e-Commerce.

+
+
+
+
+
+
+
+

+ Related Products

+
+
+ +
+
+

+ Our Services

+ +
+
+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Customization

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Support

+
+
+
+
+
+
+ service-icon +
+
+

Hire + Odoo Developer

+
+
+
+
+ +
+
+ service-icon +
+
+

Odoo + Integration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Migration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Consultancy

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

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 + 99456767686 +
+
+
+
+
+
+
+
+
+ + + + + + 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..2cd99914d --- /dev/null +++ b/ecommerce_quick_view/static/src/js/quick_view_modal.js @@ -0,0 +1,31 @@ +/** @odoo-module **/ +import publicWidget from "@web/legacy/js/public/public_widget"; +import { jsonrpc } from "@web/core/network/rpc_service"; + +publicWidget.registry.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'); + // 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 jsonrpc('/c_quick_view/get_quick_view_html', {product_id: product_id}); + self.show_modal(result); + } catch (err) { + alert(err); + } + }, +}); +export default publicWidget.registry.QuickViewModal; diff --git a/ecommerce_quick_view/views/templates.xml b/ecommerce_quick_view/views/templates.xml new file mode 100644 index 000000000..f0a1bc3e1 --- /dev/null +++ b/ecommerce_quick_view/views/templates.xml @@ -0,0 +1,298 @@ + + + + + + +