diff --git a/geoip_website_redirect/README.rst b/geoip_website_redirect/README.rst new file mode 100644 index 000000000..60084c2e3 --- /dev/null +++ b/geoip_website_redirect/README.rst @@ -0,0 +1,49 @@ +.. image:: https://img.shields.io/badge/license-LGPL--3-blue.svg + :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +Website Language And Currency Based On GeoIP +============================================ +ThisModule helps the user to view website and its contents in language of country from which the user +login and also able to view the website shop's currency as that country's currency + +Configuration +------------- +- Install python package - countryinfo. + Command for install: pip install countryinfo +- Install our custom module. + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Credits +------- +Developer: (V15)Mohammed Dilshad Tk, 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/geoip_website_redirect/__init__.py b/geoip_website_redirect/__init__.py new file mode 100644 index 000000000..a6c7f376f --- /dev/null +++ b/geoip_website_redirect/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Mohammed Dilshad Tk (odoo@cybrosys.com) +# +# 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 +from . import models diff --git a/geoip_website_redirect/__manifest__.py b/geoip_website_redirect/__manifest__.py new file mode 100644 index 000000000..5eb228bae --- /dev/null +++ b/geoip_website_redirect/__manifest__.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Mohammed Dilshad Tk (odoo@cybrosys.com) +# +# 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': 'Website Language And Currency Based On GeoIP', + 'version': '15.0.1.0.0', + 'category': 'eCommerce, Productivity', + 'summary': """This module helps you to map currency and language + based on Customer's IP address for Odoo 15""", + 'description': """Website Language And Currency Based On GeoIP Application + module helps the user to view website and its contents in the language of + country from which the user login and also able to view the website shop's + currency as that country's currency""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://cybrosys.com', + 'depends': ['website_sale'], + 'data': ['views/geoip_website_redirect_templates.xml'], + 'assets': { + 'web.assets_frontend': [ + 'geoip_website_redirect/static/src/js/user_ip.js', ], + }, + 'external_dependencies': { + 'python': ['countryinfo'], + }, + 'images': ['static/description/banner.png'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, + +} diff --git a/geoip_website_redirect/controllers/__init__.py b/geoip_website_redirect/controllers/__init__.py new file mode 100644 index 000000000..4ab639cd9 --- /dev/null +++ b/geoip_website_redirect/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Mohammed Dilshad Tk (odoo@cybrosys.com) +# +# 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 main diff --git a/geoip_website_redirect/controllers/main.py b/geoip_website_redirect/controllers/main.py new file mode 100644 index 000000000..8b22a1f04 --- /dev/null +++ b/geoip_website_redirect/controllers/main.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Mohammed Dilshad Tk (odoo@cybrosys.com) +# +# 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 . +# +############################################################################# +import requests +from countryinfo import CountryInfo +from odoo import http +from odoo.addons.portal.controllers.web import Home +from odoo.http import request + + +class GeoIP(Home): + """ controller for selecting login user's datas """ + def get_location(self, ip_address): + """ get location details of user using ip address""" + response = requests.get(f'http://ip-api.com/json/{ip_address}', timeout=10).json() + return {"country": response.get("country")} + + @http.route() + def web_login(self, redirect=None, **kw): + """ on login access customer country information """ + result = super(GeoIP, self).web_login(redirect=redirect, **kw) + request.env.user.write({'ip_address': kw.get('user_ip')}) + datas = self.get_location(kw.get('user_ip')) + if datas: + lang = CountryInfo(datas['country']).languages() + language = request.env['res.lang'].sudo().search([ + ('iso_code', '=', lang[0]), ('active', 'in', [True, False])]) + if language: + language.active = True + request.env['website'].sudo().browse(request.website.id + ).language_ids = [ + (4, language.id)] + url = f'/{language.url_code}' + return request.redirect(url) + return result diff --git a/geoip_website_redirect/doc/RELEASE_NOTES.md b/geoip_website_redirect/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..7e9684cbe --- /dev/null +++ b/geoip_website_redirect/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 18.01.2024 +#### Version 15.0.1.0.0 +#### ADD + +- Initial commit for Website Language And Currency Based On GeoIP diff --git a/geoip_website_redirect/models/__init__.py b/geoip_website_redirect/models/__init__.py new file mode 100644 index 000000000..b6ac961d8 --- /dev/null +++ b/geoip_website_redirect/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Mohammed Dilshad Tk (odoo@cybrosys.com) +# +# 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 res_users +from . import website diff --git a/geoip_website_redirect/models/res_users.py b/geoip_website_redirect/models/res_users.py new file mode 100644 index 000000000..6a1b1befb --- /dev/null +++ b/geoip_website_redirect/models/res_users.py @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Mohammed Dilshad Tk (odoo@cybrosys.com) +# +# 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 fields, models + + +class ResUsers(models.Model): + """class for adding ip address field in Res Users """ + _inherit = "res.users" + + ip_address = fields.Char(string="IP Address", help="IP address of user") diff --git a/geoip_website_redirect/models/website.py b/geoip_website_redirect/models/website.py new file mode 100644 index 000000000..88c502834 --- /dev/null +++ b/geoip_website_redirect/models/website.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Mohammed Dilshad Tk (odoo@cybrosys.com) +# +# 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 countryinfo import CountryInfo +import requests +from odoo import models + + +class Website(models.Model): + """ class for selecting shop's public pricelist """ + _inherit = 'website' + + def get_user_location(self): + """ get location details of user """ + response = requests.get( + f'http://ip-api.com/json/{self.env.user.ip_address}', timeout=10).json() + return {"country": response.get("country")} + + def get_current_pricelist(self): + """ get current pricelist if it is public pricelist then + change its currency into customers currency """ + res = super().get_current_pricelist() + default = self.env['product.pricelist'].search([ + '&', ('selectable', '=', True), + '&', ('country_group_ids', '=', False), + '|', ('company_id', '=', False), + ('company_id', '=', self.env.company.id)], limit=1) + if res in default: + datas = self.get_user_location() + if datas: + country = CountryInfo(datas['country']) + currency = country.currencies() + currency_dict = self.env['res.currency'].sudo().search([ + ('name', '=', currency[0]), + ('active', 'in', [True, False])]) + if currency_dict: + currency_dict.active = True + res.currency_id = currency_dict + return res diff --git a/geoip_website_redirect/static/description/assets/icons/check.png b/geoip_website_redirect/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/check.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/chevron.png b/geoip_website_redirect/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/chevron.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/cogs.png b/geoip_website_redirect/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/cogs.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/consultation.png b/geoip_website_redirect/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/consultation.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/ecom-black.png b/geoip_website_redirect/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/ecom-black.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/education-black.png b/geoip_website_redirect/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/education-black.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/hotel-black.png b/geoip_website_redirect/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/hotel-black.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/license.png b/geoip_website_redirect/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/license.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/lifebuoy.png b/geoip_website_redirect/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/lifebuoy.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/logo.png b/geoip_website_redirect/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/logo.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/manufacturing-black.png b/geoip_website_redirect/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/manufacturing-black.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/pos-black.png b/geoip_website_redirect/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/pos-black.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/puzzle.png b/geoip_website_redirect/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/puzzle.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/restaurant-black.png b/geoip_website_redirect/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/restaurant-black.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/service-black.png b/geoip_website_redirect/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/service-black.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/trading-black.png b/geoip_website_redirect/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/trading-black.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/training.png b/geoip_website_redirect/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/training.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/update.png b/geoip_website_redirect/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/update.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/user.png b/geoip_website_redirect/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/user.png differ diff --git a/geoip_website_redirect/static/description/assets/icons/wrench.png b/geoip_website_redirect/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/geoip_website_redirect/static/description/assets/icons/wrench.png differ diff --git a/geoip_website_redirect/static/description/assets/misc/categories.png b/geoip_website_redirect/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/misc/categories.png differ diff --git a/geoip_website_redirect/static/description/assets/misc/check-box.png b/geoip_website_redirect/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/misc/check-box.png differ diff --git a/geoip_website_redirect/static/description/assets/misc/compass.png b/geoip_website_redirect/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/geoip_website_redirect/static/description/assets/misc/compass.png differ diff --git a/geoip_website_redirect/static/description/assets/misc/corporate.png b/geoip_website_redirect/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/geoip_website_redirect/static/description/assets/misc/corporate.png differ diff --git a/geoip_website_redirect/static/description/assets/misc/customer-support.png b/geoip_website_redirect/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/geoip_website_redirect/static/description/assets/misc/customer-support.png differ diff --git a/geoip_website_redirect/static/description/assets/misc/cybrosys-logo.png b/geoip_website_redirect/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/geoip_website_redirect/static/description/assets/misc/cybrosys-logo.png differ diff --git a/geoip_website_redirect/static/description/assets/misc/features.png b/geoip_website_redirect/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/misc/features.png differ diff --git a/geoip_website_redirect/static/description/assets/misc/logo.png b/geoip_website_redirect/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/geoip_website_redirect/static/description/assets/misc/logo.png differ diff --git a/geoip_website_redirect/static/description/assets/misc/pictures.png b/geoip_website_redirect/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/misc/pictures.png differ diff --git a/geoip_website_redirect/static/description/assets/misc/pie-chart.png b/geoip_website_redirect/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/misc/pie-chart.png differ diff --git a/geoip_website_redirect/static/description/assets/misc/right-arrow.png b/geoip_website_redirect/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/misc/right-arrow.png differ diff --git a/geoip_website_redirect/static/description/assets/misc/star.png b/geoip_website_redirect/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/geoip_website_redirect/static/description/assets/misc/star.png differ diff --git a/geoip_website_redirect/static/description/assets/misc/support.png b/geoip_website_redirect/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/misc/support.png differ diff --git a/geoip_website_redirect/static/description/assets/misc/whatsapp.png b/geoip_website_redirect/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/misc/whatsapp.png differ diff --git a/geoip_website_redirect/static/description/assets/modules/1.png b/geoip_website_redirect/static/description/assets/modules/1.png new file mode 100644 index 000000000..ae3e11bff Binary files /dev/null and b/geoip_website_redirect/static/description/assets/modules/1.png differ diff --git a/geoip_website_redirect/static/description/assets/modules/2.png b/geoip_website_redirect/static/description/assets/modules/2.png new file mode 100644 index 000000000..5c172b9ab Binary files /dev/null and b/geoip_website_redirect/static/description/assets/modules/2.png differ diff --git a/geoip_website_redirect/static/description/assets/modules/3.png b/geoip_website_redirect/static/description/assets/modules/3.png new file mode 100644 index 000000000..2b5926612 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/modules/3.png differ diff --git a/geoip_website_redirect/static/description/assets/modules/4.png b/geoip_website_redirect/static/description/assets/modules/4.png new file mode 100644 index 000000000..5856d1b7e Binary files /dev/null and b/geoip_website_redirect/static/description/assets/modules/4.png differ diff --git a/geoip_website_redirect/static/description/assets/modules/5.png b/geoip_website_redirect/static/description/assets/modules/5.png new file mode 100644 index 000000000..b4c3395f7 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/modules/5.png differ diff --git a/geoip_website_redirect/static/description/assets/modules/6.png b/geoip_website_redirect/static/description/assets/modules/6.png new file mode 100644 index 000000000..e6bee65a9 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/modules/6.png differ diff --git a/geoip_website_redirect/static/description/assets/screenshots/Screenshot1.png b/geoip_website_redirect/static/description/assets/screenshots/Screenshot1.png new file mode 100644 index 000000000..3ac9854d6 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/screenshots/Screenshot1.png differ diff --git a/geoip_website_redirect/static/description/assets/screenshots/Screenshot2.png b/geoip_website_redirect/static/description/assets/screenshots/Screenshot2.png new file mode 100644 index 000000000..31c60a14d Binary files /dev/null and b/geoip_website_redirect/static/description/assets/screenshots/Screenshot2.png differ diff --git a/geoip_website_redirect/static/description/assets/screenshots/Screenshot3.png b/geoip_website_redirect/static/description/assets/screenshots/Screenshot3.png new file mode 100644 index 000000000..82d8510fc Binary files /dev/null and b/geoip_website_redirect/static/description/assets/screenshots/Screenshot3.png differ diff --git a/geoip_website_redirect/static/description/assets/screenshots/Screenshot4.png b/geoip_website_redirect/static/description/assets/screenshots/Screenshot4.png new file mode 100644 index 000000000..5f6de3dfc Binary files /dev/null and b/geoip_website_redirect/static/description/assets/screenshots/Screenshot4.png differ diff --git a/geoip_website_redirect/static/description/assets/screenshots/hero.gif b/geoip_website_redirect/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..9b40134c1 Binary files /dev/null and b/geoip_website_redirect/static/description/assets/screenshots/hero.gif differ diff --git a/geoip_website_redirect/static/description/banner.png b/geoip_website_redirect/static/description/banner.png new file mode 100644 index 000000000..6060257d9 Binary files /dev/null and b/geoip_website_redirect/static/description/banner.png differ diff --git a/geoip_website_redirect/static/description/icon.png b/geoip_website_redirect/static/description/icon.png new file mode 100644 index 000000000..e82cc5e37 Binary files /dev/null and b/geoip_website_redirect/static/description/icon.png differ diff --git a/geoip_website_redirect/static/description/index.html b/geoip_website_redirect/static/description/index.html new file mode 100644 index 000000000..8a1cb213f --- /dev/null +++ b/geoip_website_redirect/static/description/index.html @@ -0,0 +1,638 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+ +

+ Website Language And Currency Based On GeoIP

+

+ Module To Map Currency And Language Based On Customer's IP Address






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

+ Explore This + Module

+
+ + + + +
+
+ +
+

+ Overview +

+
+
+
+ Website Language And Currency Based On GeoIP is an application which is + fetch the IP address + of customer's device and allow them to see website in their native + language and + see the currency as per the geolocation. +
+
+ + + +
+
+ +
+

+ Features +

+
+
+
+
+ + Auto-Detect Customer's IP Address +
+
+ + Switch Website's Content in Customer's Native Language +
+
+ + Customer can Change Store Manually +
+
+
+
+ + Product Price in Customer's Local Currency +
+
+ + Customer can also Change Language Manually +
+
+ + Select Customers Currency and Language on Login +
+
+
+ + + + +
+
+ +
+

+ Screenshots +

+
+
+
+
+

+ Customer Login Page

+

+ Before login website will be shown in default language

+ +
+
+

+ Language Changes After Login

+

After login, it fetches + customers IP address and identify customer's + geolocation and select the language, change portal view based on + that language +

+ +
+
+

+ Change Website Default Language to Customer's Language

+
+
+
+

+ Changes the Website Currency

+

+ It also changes the product price into customer's local + currency.

+ +
+
+
+ + + +
+
+

Suggested 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/geoip_website_redirect/static/src/js/user_ip.js b/geoip_website_redirect/static/src/js/user_ip.js new file mode 100644 index 000000000..c5866d6de --- /dev/null +++ b/geoip_website_redirect/static/src/js/user_ip.js @@ -0,0 +1,24 @@ +odoo.define('geoip_website_redirect.get_ip', function (require) { + "use strict"; + var publicWidget = require('web.public.widget'); + //public widget for getting the IP address of the user + publicWidget.registry.userIpAddress = publicWidget.Widget.extend({ + selector: '.oe_website_login_container', + events: { + 'click .oe_login_buttons': '_getIpAddress', + }, + //Super the existing setup + setup(){ + super.setup(); + this._getIpAddress() + }, + //function which give ip address of user + _getIpAddress: async function(events){ + var self = this; + await $.getJSON("https://api.ipify.org?format=json", function(data) { + self.el.querySelector('#user_ip').value = data.ip; + }); + }, + }); + return publicWidget.registry.userIpAddress; +}); diff --git a/geoip_website_redirect/views/geoip_website_redirect_templates.xml b/geoip_website_redirect/views/geoip_website_redirect_templates.xml new file mode 100644 index 000000000..9d3863ea6 --- /dev/null +++ b/geoip_website_redirect/views/geoip_website_redirect_templates.xml @@ -0,0 +1,9 @@ + + + + +