diff --git a/one_page_checkout/README.rst b/one_page_checkout/README.rst new file mode 100755 index 000000000..5ed48ef9e --- /dev/null +++ b/one_page_checkout/README.rst @@ -0,0 +1,47 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +One Page Checkout +================= +* Condensed ecommerce checkout into a single page. + +Installation +============ +- https://www.odoo.com/documentation/16.0/administration/install.html +- Install our custom addon + +License +------- +AFFERO GENERAL PUBLIC LICENSE, Version 3 (AGPL v3). +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developer: (V16) Yassir Irfan, 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/one_page_checkout/__init__.py b/one_page_checkout/__init__.py new file mode 100755 index 000000000..66ed0f7a8 --- /dev/null +++ b/one_page_checkout/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Yassir Irfan() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import controllers diff --git a/one_page_checkout/__manifest__.py b/one_page_checkout/__manifest__.py new file mode 100755 index 000000000..69cf408c4 --- /dev/null +++ b/one_page_checkout/__manifest__.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Yassir Irfan() +# +# 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': 'One Page Checkout', + 'version': '16.0.1.0.0', + 'category': 'eCommerce', + 'summary': """ + Simplifies ecommerce checkout by condensing it into a single, + user-friendly page. + """, + 'description': """ + Condenses the entire ecommerce checkout process into a single, + user-friendly page, simplifying the steps and enhancing the user + experience. + """, + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'images': ['static/description/banner.jpg'], + 'depends': ['base', 'website', 'website_sale', 'payment'], + 'data': [ + 'views/address_column_templates.xml', + 'views/address_form_templates.xml', + 'views/extra_info_templates.xml', + 'views/payment_templates.xml', + 'views/website_sale_templates.xml', + ], + 'assets': { + 'web.assets_frontend': [ + 'one_page_checkout/static/src/css/style.css', + 'one_page_checkout/static/src/js/website_sale.js', + 'one_page_checkout/static/src/js/checkout_form.js', + 'one_page_checkout/static/src/js/website_sale_delivery.js', + ], + }, + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': True, +} diff --git a/one_page_checkout/controllers/__init__.py b/one_page_checkout/controllers/__init__.py new file mode 100755 index 000000000..7e2c8ea3e --- /dev/null +++ b/one_page_checkout/controllers/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Yassir Irfan() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import website_form +from . import website_sale diff --git a/one_page_checkout/controllers/website_form.py b/one_page_checkout/controllers/website_form.py new file mode 100755 index 000000000..8acdf55a5 --- /dev/null +++ b/one_page_checkout/controllers/website_form.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Yassir Irfan() +# +# 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 http +from odoo.http import request +from odoo.addons.website.controllers.form import WebsiteForm + + +class WebsiteSaleForm(WebsiteForm): + """ + Class representing a form for ecommerce checkout. + Inherits: + WebsiteForm: The base class for website forms, providing common + functionalities. + Usage: + 1. Create an instance of `WebsiteSaleForm` and customize it as needed. + 2. Use the instance to handle the checking out in your shop. + """ + @http.route('/website/form/shop.sale.order', type='http', auth="public", + methods=['POST'], website=True) + def website_form_sale_order(self, **kwargs): + """ + This function is called when the user submits the checkout form for a + sales order on the website. It first calls the parent method `website_ + form_sale_order` to handle the submission of the form and create the + sales order. Then, it retrieves the created sales order from the + website session and stores its ID in the user's session. Finally, + it redirects the user to the payment status page. + + :param kwargs: Optional keyword arguments. + :return: A redirect to the payment status page. + """ + super(WebsiteSaleForm, self).website_form_saleorder(**kwargs) + order = request.website.sale_get_order() + if request.session.get('sale_last_order_id') is None and order: + request.session['sale_last_order_id'] = order.id + return request.redirect('/payment/status') diff --git a/one_page_checkout/controllers/website_sale.py b/one_page_checkout/controllers/website_sale.py new file mode 100755 index 000000000..2fdb9d5ff --- /dev/null +++ b/one_page_checkout/controllers/website_sale.py @@ -0,0 +1,130 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies(). +# Author: Yassir Irfan() +# +# 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 http +from odoo.http import request +from odoo.addons.website_sale.controllers.main import WebsiteSale + + +class WebsiteSaleEcom(WebsiteSale): + """ + Customized version of the website sale controller for e-commerce. + This class is a subclass of `WebsiteSale` and provides additional + customizations and overrides specific to e-commerce functionality on the + website. It extends the base functionality of `WebsiteSale` to cater to the + specific needs of an e-commerce website. + + Inherits: + WebsiteSale: The base class for the website sale controller. + Usage: + 1. Create an instance of `WebsiteSaleEcom` and customize it as needed. + 2. Use the instance to handle e-commerce functionality on your website. + """ + + def _get_address_values(self, **post): + """ + This method overrides the default `address()` method of the + `WebsiteSale` class to get additional context values related to the + customer's address. + + :param post: A dictionary containing the form data submitted by the + user. + :type post: dict + + :return: A dictionary containing the updated q-context values related + to the customer's address. + :rtype: dict + """ + return super(WebsiteSaleEcom, self).address(**post).qcontext + + @http.route(['/shop/address'], type='http', methods=['GET', 'POST'], + auth="public", website=True, sitemap=False) + def address(self, **kw): + """ + Renders the checkout address page for the current website sale order. + If the request is a POST, updates the current order's delivery and + invoice addresses with the provided data. + + If the current user is authenticated and the order's partner matches + the authenticated user's partner, redirects to the payment page. + + :return: An HTTP response with the rendered checkout address page or a + redirection to the login or payment page. + :rtype: werkzeug.wrappers.Response + """ + res = super(WebsiteSaleEcom, self).address(**kw) + order = res.qcontext.get('website_sale_order') + if order: + user = request.website.user_id.sudo() + if order.partner_id.id == user.partner_id.id: + return request.redirect('/shop/payment') + else: + return res + return res + + @http.route(['/shop/extra_info'], type='http', auth="public", website=True, + sitemap=False) + def extra_info(self): + """ + Overwrites the existing extra_info function. + Redirects the current request to the checkout payment page. + + :return: An HTTP response redirecting to the checkout payment page. + :rtype: werkzeug.wrappers.Response + """ + return request.redirect('/shop/payment') + + @http.route('/shop/payment', type='http', auth='public', website=True, + sitemap=False) + def shop_payment(self, **post): + """ + Overwrites the existing shop_payment function. + Removed the redirection if there is no address for user. + This page proposes several payment means based on available + payment.provider. State at this point : + + - a draft sales order with lines; otherwise, clean context / session + and back to the shop + - no transaction in context / session, or only a draft one, if the + customer did go to a payment.provider webshop_paymentsite but + closed the tab without paying / canceling + """ + order = request.website.sale_get_order() + render_values = self._get_shop_payment_values(order, **post) + render_values['only_services'] = order and order.only_services or False + address_values = self._get_address_values(**post) + # Included /address values to the /payment and its template + render_values.update({ + 'account_on_checkout': address_values.get('account_on_checkout'), + 'country_states': address_values.get('country_states', []), + 'is_public_user': address_values.get('is_public_user'), + 'only_services': address_values.get('only_services'), + 'countries': address_values.get('countries', []), + 'country': address_values.get('country', []), + 'checkout': address_values.get('checkout'), + 'error': address_values.get('error'), + 'mode': address_values.get('mode'), + }) + if render_values['errors']: + render_values.pop('providers', '') + render_values.pop('tokens', '') + + return request.render("website_sale.payment", render_values) diff --git a/one_page_checkout/doc/RELEASE_NOTES.md b/one_page_checkout/doc/RELEASE_NOTES.md new file mode 100755 index 000000000..678f16dc3 --- /dev/null +++ b/one_page_checkout/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 18.11.2023 +#### Version 16.0.1.0.0 +#### ADD + +- Initial Commit for One Page Checkout diff --git a/one_page_checkout/static/description/assets/icons/check.png b/one_page_checkout/static/description/assets/icons/check.png new file mode 100755 index 000000000..c8e85f51d Binary files /dev/null and b/one_page_checkout/static/description/assets/icons/check.png differ diff --git a/one_page_checkout/static/description/assets/icons/chevron.png b/one_page_checkout/static/description/assets/icons/chevron.png new file mode 100755 index 000000000..2089293d6 Binary files /dev/null and b/one_page_checkout/static/description/assets/icons/chevron.png differ diff --git a/one_page_checkout/static/description/assets/icons/cogs.png b/one_page_checkout/static/description/assets/icons/cogs.png new file mode 100755 index 000000000..95d0bad62 Binary files /dev/null and b/one_page_checkout/static/description/assets/icons/cogs.png differ diff --git a/one_page_checkout/static/description/assets/icons/consultation.png b/one_page_checkout/static/description/assets/icons/consultation.png new file mode 100755 index 000000000..8319d4baa Binary files /dev/null and b/one_page_checkout/static/description/assets/icons/consultation.png differ diff --git a/one_page_checkout/static/description/assets/icons/ecom-black.png b/one_page_checkout/static/description/assets/icons/ecom-black.png new file mode 100755 index 000000000..a9385ff13 Binary files /dev/null and b/one_page_checkout/static/description/assets/icons/ecom-black.png differ diff --git a/one_page_checkout/static/description/assets/icons/education-black.png b/one_page_checkout/static/description/assets/icons/education-black.png new file mode 100755 index 000000000..3eb09b27b Binary files /dev/null and b/one_page_checkout/static/description/assets/icons/education-black.png differ diff --git a/one_page_checkout/static/description/assets/icons/hotel-black.png b/one_page_checkout/static/description/assets/icons/hotel-black.png new file mode 100755 index 000000000..130f613be Binary files /dev/null and b/one_page_checkout/static/description/assets/icons/hotel-black.png differ diff --git a/one_page_checkout/static/description/assets/icons/license.png b/one_page_checkout/static/description/assets/icons/license.png new file mode 100755 index 000000000..a5869797e Binary files /dev/null and b/one_page_checkout/static/description/assets/icons/license.png differ diff --git a/one_page_checkout/static/description/assets/icons/lifebuoy.png b/one_page_checkout/static/description/assets/icons/lifebuoy.png new file mode 100755 index 000000000..658d56ccc Binary files /dev/null and b/one_page_checkout/static/description/assets/icons/lifebuoy.png differ diff --git a/one_page_checkout/static/description/assets/icons/manufacturing-black.png b/one_page_checkout/static/description/assets/icons/manufacturing-black.png new file mode 100755 index 000000000..697eb0e9f Binary files /dev/null and b/one_page_checkout/static/description/assets/icons/manufacturing-black.png differ diff --git a/one_page_checkout/static/description/assets/icons/pos-black.png b/one_page_checkout/static/description/assets/icons/pos-black.png new file mode 100755 index 000000000..97c0f90c1 Binary files /dev/null and b/one_page_checkout/static/description/assets/icons/pos-black.png differ diff --git a/one_page_checkout/static/description/assets/icons/puzzle.png b/one_page_checkout/static/description/assets/icons/puzzle.png new file mode 100755 index 000000000..65cf854e7 Binary files /dev/null and b/one_page_checkout/static/description/assets/icons/puzzle.png differ diff --git a/one_page_checkout/static/description/assets/icons/restaurant-black.png b/one_page_checkout/static/description/assets/icons/restaurant-black.png new file mode 100755 index 000000000..4a35eb939 Binary files /dev/null and b/one_page_checkout/static/description/assets/icons/restaurant-black.png differ diff --git a/one_page_checkout/static/description/assets/icons/service-black.png b/one_page_checkout/static/description/assets/icons/service-black.png new file mode 100755 index 000000000..301ab51cb Binary files /dev/null and b/one_page_checkout/static/description/assets/icons/service-black.png differ diff --git a/one_page_checkout/static/description/assets/icons/trading-black.png b/one_page_checkout/static/description/assets/icons/trading-black.png new file mode 100755 index 000000000..9398ba2f1 Binary files /dev/null and b/one_page_checkout/static/description/assets/icons/trading-black.png differ diff --git a/one_page_checkout/static/description/assets/icons/training.png b/one_page_checkout/static/description/assets/icons/training.png new file mode 100755 index 000000000..884ca024d Binary files /dev/null and b/one_page_checkout/static/description/assets/icons/training.png differ diff --git a/one_page_checkout/static/description/assets/icons/update.png b/one_page_checkout/static/description/assets/icons/update.png new file mode 100755 index 000000000..ecbc5a01a Binary files /dev/null and b/one_page_checkout/static/description/assets/icons/update.png differ diff --git a/one_page_checkout/static/description/assets/icons/user.png b/one_page_checkout/static/description/assets/icons/user.png new file mode 100755 index 000000000..6ffb23d9f Binary files /dev/null and b/one_page_checkout/static/description/assets/icons/user.png differ diff --git a/one_page_checkout/static/description/assets/icons/wrench.png b/one_page_checkout/static/description/assets/icons/wrench.png new file mode 100755 index 000000000..6c04dea0f Binary files /dev/null and b/one_page_checkout/static/description/assets/icons/wrench.png differ diff --git a/one_page_checkout/static/description/assets/misc/categories.png b/one_page_checkout/static/description/assets/misc/categories.png new file mode 100755 index 000000000..bedf1e0b1 Binary files /dev/null and b/one_page_checkout/static/description/assets/misc/categories.png differ diff --git a/one_page_checkout/static/description/assets/misc/check-box.png b/one_page_checkout/static/description/assets/misc/check-box.png new file mode 100755 index 000000000..42caf24b9 Binary files /dev/null and b/one_page_checkout/static/description/assets/misc/check-box.png differ diff --git a/one_page_checkout/static/description/assets/misc/compass.png b/one_page_checkout/static/description/assets/misc/compass.png new file mode 100755 index 000000000..d5fed8faa Binary files /dev/null and b/one_page_checkout/static/description/assets/misc/compass.png differ diff --git a/one_page_checkout/static/description/assets/misc/corporate.png b/one_page_checkout/static/description/assets/misc/corporate.png new file mode 100755 index 000000000..2eb13edbf Binary files /dev/null and b/one_page_checkout/static/description/assets/misc/corporate.png differ diff --git a/one_page_checkout/static/description/assets/misc/customer-support.png b/one_page_checkout/static/description/assets/misc/customer-support.png new file mode 100755 index 000000000..79efc72ed Binary files /dev/null and b/one_page_checkout/static/description/assets/misc/customer-support.png differ diff --git a/one_page_checkout/static/description/assets/misc/cybrosys-logo.png b/one_page_checkout/static/description/assets/misc/cybrosys-logo.png new file mode 100755 index 000000000..cc3cc0ccf Binary files /dev/null and b/one_page_checkout/static/description/assets/misc/cybrosys-logo.png differ diff --git a/one_page_checkout/static/description/assets/misc/features.png b/one_page_checkout/static/description/assets/misc/features.png new file mode 100755 index 000000000..b41769f77 Binary files /dev/null and b/one_page_checkout/static/description/assets/misc/features.png differ diff --git a/one_page_checkout/static/description/assets/misc/logo.png b/one_page_checkout/static/description/assets/misc/logo.png new file mode 100755 index 000000000..478462d3e Binary files /dev/null and b/one_page_checkout/static/description/assets/misc/logo.png differ diff --git a/one_page_checkout/static/description/assets/misc/pictures.png b/one_page_checkout/static/description/assets/misc/pictures.png new file mode 100755 index 000000000..56d255fe9 Binary files /dev/null and b/one_page_checkout/static/description/assets/misc/pictures.png differ diff --git a/one_page_checkout/static/description/assets/misc/pie-chart.png b/one_page_checkout/static/description/assets/misc/pie-chart.png new file mode 100755 index 000000000..426e05244 Binary files /dev/null and b/one_page_checkout/static/description/assets/misc/pie-chart.png differ diff --git a/one_page_checkout/static/description/assets/misc/right-arrow.png b/one_page_checkout/static/description/assets/misc/right-arrow.png new file mode 100755 index 000000000..730984a06 Binary files /dev/null and b/one_page_checkout/static/description/assets/misc/right-arrow.png differ diff --git a/one_page_checkout/static/description/assets/misc/star.png b/one_page_checkout/static/description/assets/misc/star.png new file mode 100755 index 000000000..2eb9ab29f Binary files /dev/null and b/one_page_checkout/static/description/assets/misc/star.png differ diff --git a/one_page_checkout/static/description/assets/misc/support.png b/one_page_checkout/static/description/assets/misc/support.png new file mode 100755 index 000000000..4f18b8b82 Binary files /dev/null and b/one_page_checkout/static/description/assets/misc/support.png differ diff --git a/one_page_checkout/static/description/assets/misc/whatsapp.png b/one_page_checkout/static/description/assets/misc/whatsapp.png new file mode 100755 index 000000000..d513a5356 Binary files /dev/null and b/one_page_checkout/static/description/assets/misc/whatsapp.png differ diff --git a/one_page_checkout/static/description/assets/modules/1.png b/one_page_checkout/static/description/assets/modules/1.png new file mode 100755 index 000000000..8f586a139 Binary files /dev/null and b/one_page_checkout/static/description/assets/modules/1.png differ diff --git a/one_page_checkout/static/description/assets/modules/2.png b/one_page_checkout/static/description/assets/modules/2.png new file mode 100755 index 000000000..45fcdcbde Binary files /dev/null and b/one_page_checkout/static/description/assets/modules/2.png differ diff --git a/one_page_checkout/static/description/assets/modules/3.png b/one_page_checkout/static/description/assets/modules/3.png new file mode 100755 index 000000000..813e4c306 Binary files /dev/null and b/one_page_checkout/static/description/assets/modules/3.png differ diff --git a/one_page_checkout/static/description/assets/modules/4.png b/one_page_checkout/static/description/assets/modules/4.png new file mode 100755 index 000000000..296fe66b4 Binary files /dev/null and b/one_page_checkout/static/description/assets/modules/4.png differ diff --git a/one_page_checkout/static/description/assets/modules/5.png b/one_page_checkout/static/description/assets/modules/5.png new file mode 100755 index 000000000..61b04722d Binary files /dev/null and b/one_page_checkout/static/description/assets/modules/5.png differ diff --git a/one_page_checkout/static/description/assets/modules/6.png b/one_page_checkout/static/description/assets/modules/6.png new file mode 100644 index 000000000..a53a72332 Binary files /dev/null and b/one_page_checkout/static/description/assets/modules/6.png differ diff --git a/one_page_checkout/static/description/assets/screenshots/IU001.png b/one_page_checkout/static/description/assets/screenshots/IU001.png new file mode 100755 index 000000000..d29310d6f Binary files /dev/null and b/one_page_checkout/static/description/assets/screenshots/IU001.png differ diff --git a/one_page_checkout/static/description/assets/screenshots/PU001.png b/one_page_checkout/static/description/assets/screenshots/PU001.png new file mode 100755 index 000000000..d2933c5eb Binary files /dev/null and b/one_page_checkout/static/description/assets/screenshots/PU001.png differ diff --git a/one_page_checkout/static/description/assets/screenshots/PU002.png b/one_page_checkout/static/description/assets/screenshots/PU002.png new file mode 100755 index 000000000..a56d945be Binary files /dev/null and b/one_page_checkout/static/description/assets/screenshots/PU002.png differ diff --git a/one_page_checkout/static/description/assets/screenshots/hero.gif b/one_page_checkout/static/description/assets/screenshots/hero.gif new file mode 100755 index 000000000..4465adab6 Binary files /dev/null and b/one_page_checkout/static/description/assets/screenshots/hero.gif differ diff --git a/one_page_checkout/static/description/banner.jpg b/one_page_checkout/static/description/banner.jpg new file mode 100755 index 000000000..368dffeda Binary files /dev/null and b/one_page_checkout/static/description/banner.jpg differ diff --git a/one_page_checkout/static/description/icon.png b/one_page_checkout/static/description/icon.png new file mode 100755 index 000000000..c691a0c69 Binary files /dev/null and b/one_page_checkout/static/description/icon.png differ diff --git a/one_page_checkout/static/description/index.html b/one_page_checkout/static/description/index.html new file mode 100755 index 000000000..d1bca07cf --- /dev/null +++ b/one_page_checkout/static/description/index.html @@ -0,0 +1,646 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+ +

+ One Page Checkout +

+

+ This Module simplifies ecommerce checkout by condensing it into a single, + user-friendly page. +

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

+ Explore This + Module +

+
+ + + +
+
+ +
+

+ Overview +

+
+
+
+ This Module simplifies ecommerce checkout by condensing it into a single, + user-friendly page. +
+
+ + +
+
+ +
+

+ Features +

+
+
+
+
+ +
+ Select any delivery method. + Choose your preferred delivery method from a range of options available for your orders. +
+
+
+ +
+ Create a new address and select existing address. + Easily add a new address to your profile or select from existing addresses for a seamless and personalized checkout experience. +
+
+
+
+
+ +
+ Apply your promo-codes. + Enter your promo code to apply special discounts. +
+
+
+ +
+ Inline validation for public users. + Enable inline form validation for public users, ensuring that inputted data is instantly validated and errors are highlighted for a smoother and error-free user experience. +
+
+
+
+ + +
+
+ +
+

+ Screenshots +

+
+
+
+
+

+ Checking out with Login User.

+

+ +
+
+

+ Checking out with Public User.

+

+ +
+
+

+ Form validation for Public User.

+

+ +
+
+ + +
+
+ +
+

+ Related + Products +

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

+ Our Services +

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

+ Our + Industries +

+
+
+
+
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products +

+
+
+
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience +

+
+
+
+
+ +
+ Education +
+

+ A platform for + educational management +

+
+
+
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations +

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

+ Mobile + friendly, + awe-inspiring product pages +

+
+
+
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice +

+
+
+
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically +

+
+
+
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application +

+
+
+
+
+ + +
+
+ +
+

+ Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need + help? Get in touch.

+ +

+ odoo@cybrosys.com +

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on + WhatsApp!

+ +

+ +91 86068 + 27707 +

+
+
+
+
+
+
+
+ +
+
+
+
+ diff --git a/one_page_checkout/static/src/css/style.css b/one_page_checkout/static/src/css/style.css new file mode 100755 index 000000000..893b7e7a5 --- /dev/null +++ b/one_page_checkout/static/src/css/style.css @@ -0,0 +1,38 @@ +/* Column Responsive CSS for including three templates in a single page */ +.single_pg_checkout_layout{ + width:90%; + max-width:1400px; + margin: 0 auto; +} +.single_pg_checkout_layout .column { + float: left; + width: 33.33%; +} +.block-ui{ + pointer-events:none; + opacity:0.5; +} +/* Clear floats after the columns */ +.single_pg_checkout_layout:after { + content: ""; + display: table; + clear: both; +} +@media screen and (max-width: 1000px) { + .single_pg_checkout_layout .column { + width: 80%; + margin: 15px auto; + } +} +@media screen and (max-width: 750px) { + .single_pg_checkout_layout .column { + width: 90%; + margin: 15px auto; + } +} +@media screen and (max-width: 500px) { + .single_pg_checkout_layout .column { + width: 97%; + margin: 15px auto; + } +} diff --git a/one_page_checkout/static/src/js/checkout_form.js b/one_page_checkout/static/src/js/checkout_form.js new file mode 100755 index 000000000..a74769585 --- /dev/null +++ b/one_page_checkout/static/src/js/checkout_form.js @@ -0,0 +1,32 @@ +odoo.define('one_page_checkout.checkout_form', require => { + 'use strict'; + + const publicWidget = require('web.public.widget'); + const paymentFormMixin = require('payment.payment_form_mixin'); + /** + * OnePagePaymentForm widget. Enhances the payment form by adding a click + * event listener that submits the extra_info_form along with the payment form. + * + * @extends paymentFormMixin + */ + publicWidget.registry.OnePagePaymentForm = publicWidget.Widget.extend(paymentFormMixin, { + selector: 'form[name="o_payment_checkout"]', + events: Object.assign({}, publicWidget.Widget.prototype.events, { + 'click button[name="o_payment_submit_button"]': '_onClickPayment', + }), + init: function () { + this._super(...arguments); + }, + /** + * OnePagePaymentForm widget. Enhances the payment form by adding a click + * event listener that submits the extra_info_form along with the payment form. + * + * @extends paymentFormMixin + */ + _onClickPayment: async function (ev) { + $('#extra_info_form').submit() + + }, + }); + return publicWidget.registry.OnePagePaymentForm; +}); diff --git a/one_page_checkout/static/src/js/website_sale.js b/one_page_checkout/static/src/js/website_sale.js new file mode 100755 index 000000000..2b5495dce --- /dev/null +++ b/one_page_checkout/static/src/js/website_sale.js @@ -0,0 +1,228 @@ +odoo.define('one_page_checkout.website_sale', function (require) { +'use strict'; + +var core = require('web.core'); +var config = require('web.config'); +var publicWidget = require('web.public.widget'); +var VariantMixin = require('website_sale.VariantMixin'); +var wSaleUtils = require('website_sale.utils'); +const cartHandlerMixin = wSaleUtils.cartHandlerMixin; +require("web.zoomodoo"); +const dom = require('web.dom'); + +publicWidget.registry.OnePageCheckoutWebsiteSale = publicWidget.Widget.extend( + VariantMixin, cartHandlerMixin, { + selector: '.single_pg_checkout_layout', + events: _.extend({}, VariantMixin.events || {}, { + 'click .a-submit': '_onClickSubmit', + 'click .show_coupon': '_onClickShowCoupon', + 'change select[name="country_id"]': '_onChangeCountry', + 'click span[title="Details"]': '_onCartDetailClick', + }), + + /** + * Initializes the widget. + * Sets the `isWebsite` property to `true`. + */ + init: function () { + this._super.apply(this, arguments); + this.isWebsite = true; + }, + + /** + * Starts the widget. + * Calls the super method and returns the resulting promise. + * @returns {Promise} A promise representing the start of the widget. + */ + start() { + const def = this._super(...arguments); + return def; + }, + + /** + * Destroys the widget. + * Calls the super method and performs any necessary cleanup. + */ + destroy() { + this._super.apply(this, arguments); + this._cleanupZoom(); + }, + /** + * Changes the country and updates the corresponding fields + based on the selected country. + */ + _changeCountry: function () { + if (!$("#country_id").val()) { + return; + } + // Get country information via RPC call + this._rpc({ + route: "/shop/country_infos/" + $("#country_id").val(), + params: { + mode: $("#country_id").attr('mode'), + }, + }).then(function (data) { + // placeholder phone_code + $("input[name='phone']").attr('placeholder', data.phone_code !== 0 ? '+'+ data.phone_code : ''); // populate states and display + var selectStates = $("select[name='state_id']"); + // dont reload state at first loading (done in qweb) + if (selectStates.data('init')===0 || selectStates.find('option').length===1) { + if (data.states.length || data.state_required) { + selectStates.html(''); + _.each(data.states, function (x) { + var opt = $('