diff --git a/call_for_price_website/README.rst b/call_for_price_website/README.rst new file mode 100644 index 000000000..1e13fddc5 --- /dev/null +++ b/call_for_price_website/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 + +Website Call For Price +====================== +This module helps hide specific products prices from the shop and using 'Call for Price' button customer can sent their details, the user will follow up the details and get the product price. + +Configuration +============= +No additional configuration required + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (AGPL v3). +https://www.gnu.org/licenses/agpl-3.0-standalone.html + +Credits +------- +Developer:(V15) Mruthul, Muhsina V, 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/call_for_price_website/__init__.py b/call_for_price_website/__init__.py new file mode 100644 index 000000000..776678cb3 --- /dev/null +++ b/call_for_price_website/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Mruthul (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 . +# +############################################################################### +from . import models diff --git a/call_for_price_website/__manifest__.py b/call_for_price_website/__manifest__.py new file mode 100644 index 000000000..f79b7d6b7 --- /dev/null +++ b/call_for_price_website/__manifest__.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Mruthul (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 Call For Price', + 'version': '15.0.1.1.0', + 'category': 'Website', + 'summary': """Helps to hide price of specified product from shop""", + 'description': "Hide price and add to cart item button of All page stores" + "and user must ask for a call for price", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['base', 'website_sale', 'website_sale_wishlist', + 'website_sale_comparison'], + 'data': ['security/ir.model.access.csv', + 'views/shop_hide_call_price_templates.xml', + 'views/wishlist_hide_price_templates.xml', + 'views/compare_hide_price_templates.xml', + 'views/call_for_price_views.xml', + 'views/product_product_views.xml'], + 'assets': { + 'web.assets_frontend': [ + '/call_for_price_website/static/src/js/create_call_form.js', + '/call_for_price_website/static/src/js/variant_mixin.js' + ] + }, + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/call_for_price_website/doc/RELEASE_NOTES.md b/call_for_price_website/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..ad5cabe1a --- /dev/null +++ b/call_for_price_website/doc/RELEASE_NOTES.md @@ -0,0 +1,11 @@ +## Module + +#### 16.07.2023 +#### Version 15.0.1.0.0 +#### ADD +- Initial Commit for Website Call For Price + +#### 27.11.2023 +#### Version 15.0.1.1.0 +#### UPDT +- Updated the "Call for Price" option for the product variant; originally, it was at the product level. diff --git a/call_for_price_website/models/__init__.py b/call_for_price_website/models/__init__.py new file mode 100644 index 000000000..ee5a578fa --- /dev/null +++ b/call_for_price_website/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Mruthul (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 . +# +############################################################################### +from . import call_price +from . import product_product diff --git a/call_for_price_website/models/call_price.py b/call_for_price_website/models/call_price.py new file mode 100644 index 000000000..1fc70e152 --- /dev/null +++ b/call_for_price_website/models/call_price.py @@ -0,0 +1,72 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Mruthul (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 . +# +############################################################################### +from odoo import api, fields, models + + +class CallForPrice(models.Model): + """Creating a model to record all the request the get from website.""" + _name = 'call.price' + _description = 'Call for Price' + _rec_name = 'product_id' + + first_name = fields.Char(string="First Name", help="First Name of user") + last_name = fields.Char(string="Last Name", help="Last Name of user") + product_id = fields.Many2one('product.template', string="Product", + help="In which product " + "they are requesting price") + email = fields.Char(string="Email", help="Users email for contact") + phone = fields.Char(string="Contact No.", + help="Users contact number for contacting") + quantity = fields.Integer(string="Quantity", + help="How much quantity of product price " + "they want know") + message = fields.Char(string="Message", + help="If any messages for referring") + state = fields.Selection( + [('draft', 'Draft'), ('done', 'Done'), ('cancel', 'Cancel')], + default="draft", help="Call for price requests stage") + + def action_done(self): + """the price of the requested product will be updated for them, + form state is done""" + self.write({'state': 'done'}) + + def action_cancel(self): + """ cancel the form or change the state to cancel""" + self.write({'state': 'cancel'}) + + def action_reset(self): + """ reset the form to draft""" + self.write({'state': 'draft'}) + + @api.model + def create_form(self, first, last, product_id, phone, email, message, qty): + """ create the request from the users to backend for teams""" + self.create({ + 'product_id': product_id, + 'first_name': first, + 'last_name': last, + 'phone': phone, + 'email': email, + 'quantity': qty, + 'message': message + }) diff --git a/call_for_price_website/models/product_product.py b/call_for_price_website/models/product_product.py new file mode 100644 index 000000000..1fd8c8291 --- /dev/null +++ b/call_for_price_website/models/product_product.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Mruthul (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 . +# +############################################################################### +from odoo import fields, models + + +class ProductTemplate(models.Model): + """Inheriting product template model for adding the field value of + price_call to the combination_info""" + _inherit = 'product.template' + + def _get_combination_info(self, combination=False, product_id=False, + add_qty=1, pricelist=False, + parent_combination=False, + only_template=False): + # Call the parent method to get the initial combination_info + combination_info = super(ProductTemplate, + self)._get_combination_info( + combination=combination, product_id=product_id, + add_qty=add_qty, pricelist=pricelist, + parent_combination=parent_combination, + only_template=only_template) + + if combination_info.get('product_id'): + product = self.env['product.product'].browse( + combination_info['product_id']) + combination_info['price_call'] = product.price_call + return combination_info + + +class ProductProduct(models.Model): + """Inheriting product variants model for adding a field + that will hide price from website""" + _inherit = 'product.product' + + price_call = fields.Boolean(string="Call for Price", + help="This will hide the price and cart button" + "from shop and customer can request by " + "calling for price") diff --git a/call_for_price_website/security/ir.model.access.csv b/call_for_price_website/security/ir.model.access.csv new file mode 100644 index 000000000..1896ea717 --- /dev/null +++ b/call_for_price_website/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_call_price_user,access.call.price.user,model_call_price,base.group_user,1,1,1,1 diff --git a/call_for_price_website/static/description/assets/icons/check.png b/call_for_price_website/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/call_for_price_website/static/description/assets/icons/check.png differ diff --git a/call_for_price_website/static/description/assets/icons/chevron.png b/call_for_price_website/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/call_for_price_website/static/description/assets/icons/chevron.png differ diff --git a/call_for_price_website/static/description/assets/icons/cogs.png b/call_for_price_website/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/call_for_price_website/static/description/assets/icons/cogs.png differ diff --git a/call_for_price_website/static/description/assets/icons/consultation.png b/call_for_price_website/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/call_for_price_website/static/description/assets/icons/consultation.png differ diff --git a/call_for_price_website/static/description/assets/icons/ecom-black.png b/call_for_price_website/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/call_for_price_website/static/description/assets/icons/ecom-black.png differ diff --git a/call_for_price_website/static/description/assets/icons/education-black.png b/call_for_price_website/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/call_for_price_website/static/description/assets/icons/education-black.png differ diff --git a/call_for_price_website/static/description/assets/icons/hotel-black.png b/call_for_price_website/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/call_for_price_website/static/description/assets/icons/hotel-black.png differ diff --git a/call_for_price_website/static/description/assets/icons/license.png b/call_for_price_website/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/call_for_price_website/static/description/assets/icons/license.png differ diff --git a/call_for_price_website/static/description/assets/icons/lifebuoy.png b/call_for_price_website/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/call_for_price_website/static/description/assets/icons/lifebuoy.png differ diff --git a/call_for_price_website/static/description/assets/icons/manufacturing-black.png b/call_for_price_website/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/call_for_price_website/static/description/assets/icons/manufacturing-black.png differ diff --git a/call_for_price_website/static/description/assets/icons/pos-black.png b/call_for_price_website/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/call_for_price_website/static/description/assets/icons/pos-black.png differ diff --git a/call_for_price_website/static/description/assets/icons/puzzle.png b/call_for_price_website/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/call_for_price_website/static/description/assets/icons/puzzle.png differ diff --git a/call_for_price_website/static/description/assets/icons/restaurant-black.png b/call_for_price_website/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/call_for_price_website/static/description/assets/icons/restaurant-black.png differ diff --git a/call_for_price_website/static/description/assets/icons/service-black.png b/call_for_price_website/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/call_for_price_website/static/description/assets/icons/service-black.png differ diff --git a/call_for_price_website/static/description/assets/icons/trading-black.png b/call_for_price_website/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/call_for_price_website/static/description/assets/icons/trading-black.png differ diff --git a/call_for_price_website/static/description/assets/icons/training.png b/call_for_price_website/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/call_for_price_website/static/description/assets/icons/training.png differ diff --git a/call_for_price_website/static/description/assets/icons/update.png b/call_for_price_website/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/call_for_price_website/static/description/assets/icons/update.png differ diff --git a/call_for_price_website/static/description/assets/icons/user.png b/call_for_price_website/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/call_for_price_website/static/description/assets/icons/user.png differ diff --git a/call_for_price_website/static/description/assets/icons/wrench.png b/call_for_price_website/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/call_for_price_website/static/description/assets/icons/wrench.png differ diff --git a/call_for_price_website/static/description/assets/misc/categories.png b/call_for_price_website/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/call_for_price_website/static/description/assets/misc/categories.png differ diff --git a/call_for_price_website/static/description/assets/misc/check-box.png b/call_for_price_website/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/call_for_price_website/static/description/assets/misc/check-box.png differ diff --git a/call_for_price_website/static/description/assets/misc/compass.png b/call_for_price_website/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/call_for_price_website/static/description/assets/misc/compass.png differ diff --git a/call_for_price_website/static/description/assets/misc/corporate.png b/call_for_price_website/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/call_for_price_website/static/description/assets/misc/corporate.png differ diff --git a/call_for_price_website/static/description/assets/misc/customer-support.png b/call_for_price_website/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/call_for_price_website/static/description/assets/misc/customer-support.png differ diff --git a/call_for_price_website/static/description/assets/misc/cybrosys-logo.png b/call_for_price_website/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/call_for_price_website/static/description/assets/misc/cybrosys-logo.png differ diff --git a/call_for_price_website/static/description/assets/misc/features.png b/call_for_price_website/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/call_for_price_website/static/description/assets/misc/features.png differ diff --git a/call_for_price_website/static/description/assets/misc/logo.png b/call_for_price_website/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/call_for_price_website/static/description/assets/misc/logo.png differ diff --git a/call_for_price_website/static/description/assets/misc/pictures.png b/call_for_price_website/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/call_for_price_website/static/description/assets/misc/pictures.png differ diff --git a/call_for_price_website/static/description/assets/misc/pie-chart.png b/call_for_price_website/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/call_for_price_website/static/description/assets/misc/pie-chart.png differ diff --git a/call_for_price_website/static/description/assets/misc/right-arrow.png b/call_for_price_website/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/call_for_price_website/static/description/assets/misc/right-arrow.png differ diff --git a/call_for_price_website/static/description/assets/misc/star.png b/call_for_price_website/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/call_for_price_website/static/description/assets/misc/star.png differ diff --git a/call_for_price_website/static/description/assets/misc/support.png b/call_for_price_website/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/call_for_price_website/static/description/assets/misc/support.png differ diff --git a/call_for_price_website/static/description/assets/misc/whatsapp.png b/call_for_price_website/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/call_for_price_website/static/description/assets/misc/whatsapp.png differ diff --git a/call_for_price_website/static/description/assets/modules/1.png b/call_for_price_website/static/description/assets/modules/1.png new file mode 100644 index 000000000..5238bdeab Binary files /dev/null and b/call_for_price_website/static/description/assets/modules/1.png differ diff --git a/call_for_price_website/static/description/assets/modules/2.png b/call_for_price_website/static/description/assets/modules/2.png new file mode 100644 index 000000000..1ae7cfe3b Binary files /dev/null and b/call_for_price_website/static/description/assets/modules/2.png differ diff --git a/call_for_price_website/static/description/assets/modules/3.png b/call_for_price_website/static/description/assets/modules/3.png new file mode 100644 index 000000000..3c3ff1afb Binary files /dev/null and b/call_for_price_website/static/description/assets/modules/3.png differ diff --git a/call_for_price_website/static/description/assets/modules/4.png b/call_for_price_website/static/description/assets/modules/4.png new file mode 100644 index 000000000..3fae4631e Binary files /dev/null and b/call_for_price_website/static/description/assets/modules/4.png differ diff --git a/call_for_price_website/static/description/assets/modules/5.gif b/call_for_price_website/static/description/assets/modules/5.gif new file mode 100644 index 000000000..2a5f8e659 Binary files /dev/null and b/call_for_price_website/static/description/assets/modules/5.gif differ diff --git a/call_for_price_website/static/description/assets/modules/6.png b/call_for_price_website/static/description/assets/modules/6.png new file mode 100644 index 000000000..7f2815273 Binary files /dev/null and b/call_for_price_website/static/description/assets/modules/6.png differ diff --git a/call_for_price_website/static/description/assets/screenshots/1.png b/call_for_price_website/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..28c2e9a39 Binary files /dev/null and b/call_for_price_website/static/description/assets/screenshots/1.png differ diff --git a/call_for_price_website/static/description/assets/screenshots/2.png b/call_for_price_website/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..d75b07c8c Binary files /dev/null and b/call_for_price_website/static/description/assets/screenshots/2.png differ diff --git a/call_for_price_website/static/description/assets/screenshots/3.png b/call_for_price_website/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..91322a8e6 Binary files /dev/null and b/call_for_price_website/static/description/assets/screenshots/3.png differ diff --git a/call_for_price_website/static/description/assets/screenshots/4.png b/call_for_price_website/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..6fbd5faac Binary files /dev/null and b/call_for_price_website/static/description/assets/screenshots/4.png differ diff --git a/call_for_price_website/static/description/assets/screenshots/5.png b/call_for_price_website/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..00346afe8 Binary files /dev/null and b/call_for_price_website/static/description/assets/screenshots/5.png differ diff --git a/call_for_price_website/static/description/assets/screenshots/6.png b/call_for_price_website/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..6cc85d4e2 Binary files /dev/null and b/call_for_price_website/static/description/assets/screenshots/6.png differ diff --git a/call_for_price_website/static/description/assets/screenshots/7.png b/call_for_price_website/static/description/assets/screenshots/7.png new file mode 100644 index 000000000..96d808f31 Binary files /dev/null and b/call_for_price_website/static/description/assets/screenshots/7.png differ diff --git a/call_for_price_website/static/description/assets/screenshots/8.png b/call_for_price_website/static/description/assets/screenshots/8.png new file mode 100644 index 000000000..01ce26342 Binary files /dev/null and b/call_for_price_website/static/description/assets/screenshots/8.png differ diff --git a/call_for_price_website/static/description/assets/screenshots/hero.gif b/call_for_price_website/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..36cc118fd Binary files /dev/null and b/call_for_price_website/static/description/assets/screenshots/hero.gif differ diff --git a/call_for_price_website/static/description/banner.jpg b/call_for_price_website/static/description/banner.jpg new file mode 100644 index 000000000..62f98f0ea Binary files /dev/null and b/call_for_price_website/static/description/banner.jpg differ diff --git a/call_for_price_website/static/description/icon.png b/call_for_price_website/static/description/icon.png new file mode 100644 index 000000000..5761c1ea5 Binary files /dev/null and b/call_for_price_website/static/description/icon.png differ diff --git a/call_for_price_website/static/description/index.html b/call_for_price_website/static/description/index.html new file mode 100644 index 000000000..44a72e268 --- /dev/null +++ b/call_for_price_website/static/description/index.html @@ -0,0 +1,698 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ + + +
+
+
+

+ Website Call For Price

+

+ Website Call for Price for + Specific Products

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

+ Explore This + Module

+
+ + + + +
+
+ +
+

+ Overview +

+
+
+
+ In certain situations, it becomes necessary to conceal the price of a + product or one of its variants. These instances may arise due to + various reasons such as customization, availability issues, or when + the product is offered for free. This module facilitates the hiding of + prices and the addition of a "Add to Cart" button for designated + products. The "Call for Price" option enables customers to send a + price inquiry to the merchant. +
+
+ + + +
+
+ +
+

+ Features +

+
+
+
+
+ + Hide specific product price. +
+
+ + Hide add to cart button. +
+
+ + Adds a button for price requests from merchants. +
+
+ + Track all requests from the backend. +
+
+
+ + + +
+
+ +
+

+ Screenshots +

+
+
+
+
+

+ Enable Call for Price + from the Product Sales tab

+

+ Go to Product Variants -> Sales -> + Enable Call for Price. After enabling this, the price and add + to + cart button will hide from the website.

+ +
+ +
+

+ Hide product price from list of products

+ +
+ +
+

+ Wishlist page

+

+ Hide the price and add to cart button from wishlist page.

+ +
+ +
+

+ Product Compare Page

+

+ If the user needs to compare the products, then they need to + request the price.

+ +
+ +
+

+ Call For Price Button

+

+ Hides the price and add to cart button from product item and + adds button for price request, on clicking a popup will + open.

+ +
+ +
+

+ Call For Price Request

+

+ User need to enter these details inorder to get the price of + the + product. The request will send to merchant by clicking send + button.

+ +
+ +
+

+ Request Sent

+

+ After sending the request a success message will show there, + and + merchant can access the request from backend.

+ +
+ +
+

+ The Backend View

+

+ Initially, a draft request is created; after merchant + verification, the sales team contacts the customer.

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

+ 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/call_for_price_website/static/src/js/create_call_form.js b/call_for_price_website/static/src/js/create_call_form.js new file mode 100644 index 000000000..06646eaff --- /dev/null +++ b/call_for_price_website/static/src/js/create_call_form.js @@ -0,0 +1,121 @@ +/** + * This file is used to give a success alert after requesting a call for price. + */ +odoo.define('call_for_price_website.create_call_form', function(require) { + "use strict"; + const rpc = require('web.rpc'); + var core = require('web.core'); + var Dialog = require('web.Dialog'); + var publicWidget = require('web.public.widget'); + + publicWidget.registry.CallForPrice = publicWidget.Widget.extend({ + selector: '.oe_website_sale', + events: { + 'click #send_btn': 'callForPrice', + 'click #button_call_for_price': 'modalShow', + 'click #call_modal_close': 'modalHide' + }, + callForPrice: function() { + var self = this; + var first = self.$el.find('#first_name').val(); + var last = self.$el.find('#last_name').val(); + var product_id = self.$el.find('#product_id').val(); + var phone = self.$el.find('#phone').val(); + var email = self.$el.find('#email').val(); + var message = self.$el.find('#message').val(); + var qty = self.$el.find('#quantity').val(); + /** + * Validate email address format using a regular expression. + * email - The email address to validate. + * returns - True if the email is valid, false otherwise. + */ + function validateEmail(email) { + // Email validation regex pattern + var emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; + return emailPattern.test(email); + } + /** + * Validate phone number format using a regular expression. + * phone - The phone number to validate. + * returns - True if the phone number is valid, false otherwise. + */ + function validatePhoneNumber(phone) { + // Phone number validation regex pattern (without alphabets) + var phonePattern = /^[^A-Za-z]*$/ + return phonePattern.test(phone); + } + if (first && phone) { + if (!$.isNumeric(qty)) { + var modal = new Dialog(null, { + title: "Warning", + $content: $('
').text("Quantity should be a numeric value."), + buttons: [{ + text: "Close", + close: true + }], + }); + modal.open(); + return; + } + if (!validateEmail(email)) { + var modal = new Dialog(null, { + title: "Warning", + $content: $('
').text("Please enter a valid email address."), + buttons: [{ + text: "Close", + close: true + }], + }); + modal.open(); + return; + } + if (!validatePhoneNumber(phone)) { + var modal = new Dialog(null, { + title: "Warning", + $content: $('
').text("Please enter a valid phone number."), + buttons: [{ + text: "Close", + close: true + }], + }); + modal.open(); + return; + } + rpc.query({ + model: "call.price", + method: "create_form", + args: [first, last, product_id, phone, email, message, qty] + }).then(function(result) { + self.$el.find('#alert_message')[0].style.display = "block" + self.$el.find('#call_for_price')[0].style.display = 'none'; + }); + } else { + var modal = new Dialog(null, { + title: "Warning", + $content: $('
').text("Please enter the required information."), + buttons: [{ + text: "Close", + close: true + }], + }); + modal.open(); + } + }, + modalShow: function() { + this.resetFormFields(); + this.$el.find('#call_for_price')[0].style.display = 'block'; + }, + modalHide: function() { + this.$el.find('#call_for_price')[0].style.display = 'none'; + }, + resetFormFields: function() { + this.$el.find('#first_name').val(''); + this.$el.find('#last_name').val(''); + this.$el.find('#email').val(''); + this.$el.find('#phone').val(''); + this.$el.find('#quantity').val(''); + this.$el.find('#message').val(''); + }, + }); + return publicWidget.registry.CallForPrice; +}); diff --git a/call_for_price_website/static/src/js/variant_mixin.js b/call_for_price_website/static/src/js/variant_mixin.js new file mode 100644 index 000000000..2b4acf18e --- /dev/null +++ b/call_for_price_website/static/src/js/variant_mixin.js @@ -0,0 +1,45 @@ +odoo.define('call_for_price_website.CustomVariantMixin', function(require) { + 'use strict'; + + var VariantMixin = require('website_sale.VariantMixin'); + const originalOnChangeCombination = VariantMixin._onChangeCombination; + VariantMixin._onChangeCombination = function(ev, $parent, combination) { + const $pricePerUom = $parent.find(".o_base_unit_price:first .oe_currency_value"); + if ($pricePerUom) { + if (combination.is_combination_possible !== false && combination.base_unit_price != 0) { + $pricePerUom.parents(".o_base_unit_price_wrapper").removeClass("d-none"); + $pricePerUom.text(this._priceToStr(combination.base_unit_price)); + $parent.find(".oe_custom_base_unit:first").text(combination.base_unit_name); + } else { + $pricePerUom.parents(".o_base_unit_price_wrapper").addClass("d-none"); + } + } + // Triggers a new JS event with the correct payload, which is then handled + // by the google analytics tracking code. + // Indeed, every time another variant is selected, a new view_item event + // needs to be tracked by google analytics. + if ('product_tracking_info' in combination) { + const $product = $('#product_detail'); + $product.data('product-tracking-info', combination['product_tracking_info']); + $product.trigger('view_item_event', combination['product_tracking_info']); + } + const productPrice = $parent.find('.product_price'); + const quantity = $parent.find('.css_quantity'); + const price_call_div = $parent.find('#price_call_hide'); + + if (combination.price_call) { + quantity.removeClass('d-inline-flex').addClass('d-none'); + price_call_div.removeClass('d-none').addClass('d-flex') + this.$el.find('#add_to_cart')[0].style.display = "none"; + this.$el.find('#price_of_product')[0].style.display = "none"; + this.$el.find('#price_of_product')[0].style.display = "none"; + } else { + quantity.removeClass('d-none').addClass('d-inline-flex'); + price_call_div.removeClass('d-flex').addClass('d-none') + this.$el.find('#add_to_cart')[0].style.display = "block"; + this.$el.find('#price_of_product')[0].style.display = "block"; + this.$el.find('#price_of_product')[0].style.display = "block"; + } + originalOnChangeCombination.apply(this, [ev, $parent, combination]); + }; +}); diff --git a/call_for_price_website/views/call_for_price_views.xml b/call_for_price_website/views/call_for_price_views.xml new file mode 100644 index 000000000..1b1347d89 --- /dev/null +++ b/call_for_price_website/views/call_for_price_views.xml @@ -0,0 +1,60 @@ + + + + + call.price.view.tree + call.price + + + + + + + + + + + + + call.price.view.form + call.price + +
+
+
+ + + + + + + + + + + + + + + +
+
+
+ + + Call For Price + call.price + tree,form + + + +
diff --git a/call_for_price_website/views/compare_hide_price_templates.xml b/call_for_price_website/views/compare_hide_price_templates.xml new file mode 100644 index 000000000..340c0d7c1 --- /dev/null +++ b/call_for_price_website/views/compare_hide_price_templates.xml @@ -0,0 +1,70 @@ + + + + + + + diff --git a/call_for_price_website/views/product_product_views.xml b/call_for_price_website/views/product_product_views.xml new file mode 100644 index 000000000..98d091206 --- /dev/null +++ b/call_for_price_website/views/product_product_views.xml @@ -0,0 +1,16 @@ + + + + + + product.product.view.form.inherit.call.for.price.website + + product.product + + + + + + + + diff --git a/call_for_price_website/views/shop_hide_call_price_templates.xml b/call_for_price_website/views/shop_hide_call_price_templates.xml new file mode 100644 index 000000000..8093bca13 --- /dev/null +++ b/call_for_price_website/views/shop_hide_call_price_templates.xml @@ -0,0 +1,162 @@ + + + + + + + + + + + diff --git a/call_for_price_website/views/wishlist_hide_price_templates.xml b/call_for_price_website/views/wishlist_hide_price_templates.xml new file mode 100644 index 000000000..675526618 --- /dev/null +++ b/call_for_price_website/views/wishlist_hide_price_templates.xml @@ -0,0 +1,37 @@ + + + + +