diff --git a/website_add_multiple_items_to_cart/README.rst b/website_add_multiple_items_to_cart/README.rst new file mode 100644 index 000000000..e93fb8d33 --- /dev/null +++ b/website_add_multiple_items_to_cart/README.rst @@ -0,0 +1,46 @@ +.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +Add Multiple Items To Cart +========================== +* This module allows to Add Multiple Items To Cart in website. + +Installation +============ + - www.odoo.com/documentation/16.0/setup/install.html + - Install our custom addon + +License +------- +General Public License, Version 3 (LGPL v3). +(http://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Company +------- +* 'Cybrosys Techno Solutions '__ + +Credits +------- +Developer: (V16) Swaroop N P, 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 https://www.cybrosys.com + +Further information +=================== +HTML Description: ``__ diff --git a/website_add_multiple_items_to_cart/__init__.py b/website_add_multiple_items_to_cart/__init__.py new file mode 100644 index 000000000..edb501af8 --- /dev/null +++ b/website_add_multiple_items_to_cart/__init__.py @@ -0,0 +1,21 @@ +############################################################################# +# +# 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 controllers diff --git a/website_add_multiple_items_to_cart/__manifest__.py b/website_add_multiple_items_to_cart/__manifest__.py new file mode 100644 index 000000000..064e6b1c1 --- /dev/null +++ b/website_add_multiple_items_to_cart/__manifest__.py @@ -0,0 +1,48 @@ +############################################################################# +# +# 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': " Add Multiple Items To Cart", + 'version': '16.0.1.0.0', + 'category': 'Website', + 'summary': """This app is helpful to add products to cart.""", + 'description': """In this app, we can introduce a convenient functionality + that allows users to easily Select Multiple Products and Add them to their + cart with just a single click. This enhancement aims to simplify the + shopping experience and save valuable time for our users.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['website_sale'], + 'data': [ + 'views/website_templates.xml', + ], + 'assets': { + 'web.assets_frontend': [ + 'website_add_multiple_items_to_cart/static/src/js/addMultiItem.js', + ], + }, + 'images': ['static/description/banner.png'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/website_add_multiple_items_to_cart/controllers/__init__.py b/website_add_multiple_items_to_cart/controllers/__init__.py new file mode 100644 index 000000000..17a454b01 --- /dev/null +++ b/website_add_multiple_items_to_cart/controllers/__init__.py @@ -0,0 +1,21 @@ +############################################################################# +# +# 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 website_add_multiple_items_to_cart diff --git a/website_add_multiple_items_to_cart/controllers/website_add_multiple_items_to_cart.py b/website_add_multiple_items_to_cart/controllers/website_add_multiple_items_to_cart.py new file mode 100644 index 000000000..32e4020b8 --- /dev/null +++ b/website_add_multiple_items_to_cart/controllers/website_add_multiple_items_to_cart.py @@ -0,0 +1,58 @@ +############################################################################# +# +# 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.http import request + + +class WebsiteAddMultiProduct(http.Controller): + """Controller for adding multiple products to the cart on the website.""" + @http.route('/shop/cart/add_multi_product', type='http', auth="public", + methods=['GET'], website=True) + def cart_add_multi_product(self, **kw): + """Add selected products to cart""" + sale_order = request.website.sale_get_order(force_create=True) + for product_ids in kw.values(): + if product_ids: + product_id = int(product_ids) + # Check if the product is already in the cart + order_line = sale_order.order_line.filtered( + lambda line: line.product_id.id == product_id) + if order_line: + # If the product is already in the cart, increase the + # quantity by 1 + order_line.product_uom_qty += 1 + else: + # If the product is not in the cart, add it with quantity 1 + sale_order._cart_update( + product_id=product_id, + add_qty=1, + set_qty=1, + ) + request.session['website_sale_cart_quantity'] = ( + sale_order.cart_quantity) + + @http.route(['/shop/cart/qty'], type='json', auth="public", + methods=['POST'], website=True, csrf=False) + def cart_qty_check(self): + """Check cart quantity and update the value in session storage""" + cart_qty = request.website.sale_get_order().cart_quantity + request.session['website_sale_cart_quantity'] = cart_qty + return request.session['website_sale_cart_quantity'] diff --git a/website_add_multiple_items_to_cart/doc/RELEASE_NOTES.md b/website_add_multiple_items_to_cart/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..a031b0cbe --- /dev/null +++ b/website_add_multiple_items_to_cart/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 28.09.2023 +#### Version 16.0.1.0.0 +#### ADD + +- Initial Commit for Add Multiple Items To Cart diff --git a/website_add_multiple_items_to_cart/static/description/assets/icons/check.png b/website_add_multiple_items_to_cart/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/icons/check.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/icons/chevron.png b/website_add_multiple_items_to_cart/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/icons/chevron.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/icons/cogs.png b/website_add_multiple_items_to_cart/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/icons/cogs.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/icons/consultation.png b/website_add_multiple_items_to_cart/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/icons/consultation.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/icons/ecom-black.png b/website_add_multiple_items_to_cart/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/icons/ecom-black.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/icons/education-black.png b/website_add_multiple_items_to_cart/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/icons/education-black.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/icons/hotel-black.png b/website_add_multiple_items_to_cart/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/icons/hotel-black.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/icons/license.png b/website_add_multiple_items_to_cart/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/icons/license.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/icons/lifebuoy.png b/website_add_multiple_items_to_cart/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/icons/lifebuoy.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/icons/manufacturing-black.png b/website_add_multiple_items_to_cart/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/icons/manufacturing-black.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/icons/pos-black.png b/website_add_multiple_items_to_cart/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/icons/pos-black.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/icons/puzzle.png b/website_add_multiple_items_to_cart/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/icons/puzzle.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/icons/restaurant-black.png b/website_add_multiple_items_to_cart/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/icons/restaurant-black.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/icons/service-black.png b/website_add_multiple_items_to_cart/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/icons/service-black.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/icons/trading-black.png b/website_add_multiple_items_to_cart/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/icons/trading-black.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/icons/training.png b/website_add_multiple_items_to_cart/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/icons/training.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/icons/update.png b/website_add_multiple_items_to_cart/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/icons/update.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/icons/user.png b/website_add_multiple_items_to_cart/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/icons/user.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/icons/wrench.png b/website_add_multiple_items_to_cart/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/icons/wrench.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/misc/categories.png b/website_add_multiple_items_to_cart/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/misc/categories.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/misc/check-box.png b/website_add_multiple_items_to_cart/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/misc/check-box.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/misc/compass.png b/website_add_multiple_items_to_cart/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/misc/compass.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/misc/corporate.png b/website_add_multiple_items_to_cart/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/misc/corporate.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/misc/customer-support.png b/website_add_multiple_items_to_cart/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/misc/customer-support.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/misc/cybrosys-logo.png b/website_add_multiple_items_to_cart/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/misc/cybrosys-logo.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/misc/features.png b/website_add_multiple_items_to_cart/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/misc/features.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/misc/logo.png b/website_add_multiple_items_to_cart/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/misc/logo.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/misc/pictures.png b/website_add_multiple_items_to_cart/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/misc/pictures.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/misc/pie-chart.png b/website_add_multiple_items_to_cart/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/misc/pie-chart.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/misc/right-arrow.png b/website_add_multiple_items_to_cart/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/misc/right-arrow.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/misc/star.png b/website_add_multiple_items_to_cart/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/misc/star.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/misc/support.png b/website_add_multiple_items_to_cart/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/misc/support.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/misc/whatsapp.png b/website_add_multiple_items_to_cart/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/misc/whatsapp.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/modules/11.png b/website_add_multiple_items_to_cart/static/description/assets/modules/11.png new file mode 100644 index 000000000..df65629bf Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/modules/11.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/modules/22.png b/website_add_multiple_items_to_cart/static/description/assets/modules/22.png new file mode 100644 index 000000000..6058f6c3b Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/modules/22.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/modules/33.png b/website_add_multiple_items_to_cart/static/description/assets/modules/33.png new file mode 100644 index 000000000..163485cfd Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/modules/33.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/modules/44.png b/website_add_multiple_items_to_cart/static/description/assets/modules/44.png new file mode 100644 index 000000000..618e3e6c4 Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/modules/44.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/modules/55.png b/website_add_multiple_items_to_cart/static/description/assets/modules/55.png new file mode 100644 index 000000000..2a722d66e Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/modules/55.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/modules/66.png b/website_add_multiple_items_to_cart/static/description/assets/modules/66.png new file mode 100644 index 000000000..a44d454aa Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/modules/66.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/screenshots/hero1.gif b/website_add_multiple_items_to_cart/static/description/assets/screenshots/hero1.gif new file mode 100644 index 000000000..971fa9372 Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/screenshots/hero1.gif differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/screenshots/multi1.png b/website_add_multiple_items_to_cart/static/description/assets/screenshots/multi1.png new file mode 100644 index 000000000..12e7ebff0 Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/screenshots/multi1.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/screenshots/multi2.png b/website_add_multiple_items_to_cart/static/description/assets/screenshots/multi2.png new file mode 100644 index 000000000..84d87282c Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/screenshots/multi2.png differ diff --git a/website_add_multiple_items_to_cart/static/description/assets/screenshots/multi3.png b/website_add_multiple_items_to_cart/static/description/assets/screenshots/multi3.png new file mode 100644 index 000000000..bd96e1e37 Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/assets/screenshots/multi3.png differ diff --git a/website_add_multiple_items_to_cart/static/description/banner.png b/website_add_multiple_items_to_cart/static/description/banner.png new file mode 100644 index 000000000..d681799b7 Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/banner.png differ diff --git a/website_add_multiple_items_to_cart/static/description/icon.png b/website_add_multiple_items_to_cart/static/description/icon.png new file mode 100644 index 000000000..382b23978 Binary files /dev/null and b/website_add_multiple_items_to_cart/static/description/icon.png differ diff --git a/website_add_multiple_items_to_cart/static/description/index.html b/website_add_multiple_items_to_cart/static/description/index.html new file mode 100644 index 000000000..ec36f0ebe --- /dev/null +++ b/website_add_multiple_items_to_cart/static/description/index.html @@ -0,0 +1,581 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ + +
+
+
+ +

+ Add Multiple Items To Cart +

+

+ This App Allows us to Select and Add Multiple Products to + Cart in One Single Button Click.

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

Explore This + Module

+
+ + + + +
+
+ +
+

Overview +

+
+
+
This App Allows us to Select and Add Multiple Products to + Cart in One Single Button Click. +
+
+ + + +
+
+ +
+

Features +

+
+
+
+
+ +
+ Select Multiple Product And Add To Cart On Single Button Click + +
+
+
+
+ + + +
+
+ +
+

Screenshots +

+
+
+
+ +
+

+ Checkbox On Each Product

+

+ Here We can See Checkbox on Each Product, and We can Choose + Multiple Products by Checking that Checkbox.

+ +
+ +
+

+ Add To Cart Button

+

+ Here on the left side we can see the Add button on add + Multiple Product to Cart Section, after we chose the Products we + can Click on the Add button.

+ +
+ +
+

+ Updated The Cart

+

+ Here we can see the Selected Products are Updated on the + Cart.

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

+ 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

+
+
+
+
+
+
+
+ +
+
+
+ \ No newline at end of file diff --git a/website_add_multiple_items_to_cart/static/src/js/addMultiItem.js b/website_add_multiple_items_to_cart/static/src/js/addMultiItem.js new file mode 100644 index 000000000..b8269d1c3 --- /dev/null +++ b/website_add_multiple_items_to_cart/static/src/js/addMultiItem.js @@ -0,0 +1,61 @@ +odoo.define('website_add_multiple_items_to_cart.addMultiItem', function(require) { + "use strict"; + + // Import required modules + var ajax = require('web.ajax'); + var publicWidget = require('web.public.widget'); + // Define a public widget to enhance cart functionality + publicWidget.registry.WebsiteCart = publicWidget.Widget.extend({ + selector: '.o_wsale_products_main_row', + + events: { + 'click .confirm_check': '_onClickCartQuantity', + }, + + // Event handler for adding multiple items to the cart. + _onClickCartQuantity: function(ev) { + let self = this; + // Retrieve current cart quantity using AJAX request + ajax.jsonRpc('/shop/cart/qty', 'call', {}).then(function(qtyCart) { + sessionStorage.setItem('website_sale_cart_quantity', qtyCart); + var crtQty = sessionStorage.getItem('website_sale_cart_quantity'); + // Update displayed cart quantity based on retrieved value + if (crtQty === 'undefined') { + self.$el.find('.my_cart_quantity').text(0); + } else { + self.$el.find(".my_cart_quantity").text(qtyCart); + } + // Collect selected product IDs using checkboxes + ev.preventDefault(); + var result = []; + var checkBoxes = self.$el[0].querySelectorAll('.mycheckbox'); + checkBoxes.forEach(item => { + if (item.checked) { + result.push(item.value); + } + }); + // Prepare data for adding selected products to cart using AJAX + var res = result.map(x => ({ + product_id: x + })); + $.ajax({ + type: "get", + url: "/shop/cart/add_multi_product", + data: { + 'data': res + }, + success: function(response) { + return true; + } + }); + // Update total cart quantity in sessionStorage + if ('website_sale_cart_quantity' in sessionStorage) { + var currentCartQty = sessionStorage.getItem('website_sale_cart_quantity'); + sessionStorage.setItem('website_sale_cart_quantity', JSON.stringify(Number(currentCartQty) + result.length)); + } + // Redirect to the '/shop' page after adding items to cart + window.location = '/shop'; + }); + }, + }); +}); diff --git a/website_add_multiple_items_to_cart/views/website_templates.xml b/website_add_multiple_items_to_cart/views/website_templates.xml new file mode 100644 index 000000000..03cfe2d39 --- /dev/null +++ b/website_add_multiple_items_to_cart/views/website_templates.xml @@ -0,0 +1,121 @@ + + + + + + + +