diff --git a/special_product_snippet/README.rst b/special_product_snippet/README.rst new file mode 100755 index 000000000..a36536103 --- /dev/null +++ b/special_product_snippet/README.rst @@ -0,0 +1,44 @@ +.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.svg + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +Special Product Website Snippet +=============================== + +Special Product Website Snippet + +Installation +============ +- www.odoo.com/documentation/16.0/setup/install.html +- Install our custom addon + +License +------- +General Public License, Version 3 (LGPL-3). +(https://www.odoo.com/documentation/user/16.0/legal/licenses/licenses.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developers: Cybrosys Techno Solutions odoo@cybrosys.com + Author : Sruthi Pavithran + +Contacts +-------- +* Mail Contact : odoo@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 `__ diff --git a/special_product_snippet/__init__.py b/special_product_snippet/__init__.py new file mode 100755 index 000000000..304a6d19b --- /dev/null +++ b/special_product_snippet/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import controllers diff --git a/special_product_snippet/__manifest__.py b/special_product_snippet/__manifest__.py new file mode 100755 index 000000000..5e30b54d9 --- /dev/null +++ b/special_product_snippet/__manifest__.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': 'Special Product Website Snippet', + 'version': '16.0.1.0.0', + 'summary': """Select Product and Multiple Template for Product in Website Snippet""", + 'category': 'Website', + 'description': """This module gives an option to user to select product + and multiple template for product in website snippet.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://cybrosys.com/", + 'depends': ['sale_management', 'website', 'base', 'stock', 'website_sale'], + 'data': [ + 'views/special_product_snippet_templates.xml', + 'views/product_snippet_templates.xml', + ], + 'assets': { + 'web.assets_frontend': [ + 'special_product_snippet/static/src/css/product_snippet.css', + ], + 'website.assets_wysiwyg': [ + '/special_product_snippet/static/src/js/options.js' + ], + 'web.assets_backend': [ + 'special_product_snippet/static/src/xml/special_product_snippet.xml', + ], + }, + 'images': ['static/description/banner.jpg'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/special_product_snippet/controllers/__init__.py b/special_product_snippet/controllers/__init__.py new file mode 100755 index 000000000..ff9baea9b --- /dev/null +++ b/special_product_snippet/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import special_product_snippet diff --git a/special_product_snippet/controllers/special_product_snippet.py b/special_product_snippet/controllers/special_product_snippet.py new file mode 100755 index 000000000..9d90983f4 --- /dev/null +++ b/special_product_snippet/controllers/special_product_snippet.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +import json +from odoo import http +from odoo.http import request + + +class SpecialProduct(http.Controller): + + """ Getting product details and passing returning + the values and rendering the templates from js""" + + @http.route('/website/snippet/special/render', type='json', auth='public', + website=True) + def render_template(self, params): + res = json.loads(params) + product = request.env['product.template'].sudo().search_read( + [('id', '=', res['id'])]) + qcontext = {} + for rec in product: + qcontext['display_name'] = rec['display_name'] + qcontext['list_price'] = rec['list_price'] + qcontext['website_url'] = rec['website_url'] + qcontext[ + 'image_url'] = '/web/image/product.template/%s/image_1920' % \ + rec['id'] + return { + 'qcontext': qcontext + } diff --git a/special_product_snippet/doc/RELEASE_NOTES.md b/special_product_snippet/doc/RELEASE_NOTES.md new file mode 100755 index 000000000..5116d8b07 --- /dev/null +++ b/special_product_snippet/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 24.05.2023 +#### Version 16.0.1.0.0 +#### ADD +Initial Commit for Special Product Website Snippet \ No newline at end of file diff --git a/special_product_snippet/static/description/assets/icons/check.png b/special_product_snippet/static/description/assets/icons/check.png new file mode 100755 index 000000000..c8e85f51d Binary files /dev/null and b/special_product_snippet/static/description/assets/icons/check.png differ diff --git a/special_product_snippet/static/description/assets/icons/chevron.png b/special_product_snippet/static/description/assets/icons/chevron.png new file mode 100755 index 000000000..2089293d6 Binary files /dev/null and b/special_product_snippet/static/description/assets/icons/chevron.png differ diff --git a/special_product_snippet/static/description/assets/icons/cogs.png b/special_product_snippet/static/description/assets/icons/cogs.png new file mode 100755 index 000000000..95d0bad62 Binary files /dev/null and b/special_product_snippet/static/description/assets/icons/cogs.png differ diff --git a/special_product_snippet/static/description/assets/icons/consultation.png b/special_product_snippet/static/description/assets/icons/consultation.png new file mode 100755 index 000000000..8319d4baa Binary files /dev/null and b/special_product_snippet/static/description/assets/icons/consultation.png differ diff --git a/special_product_snippet/static/description/assets/icons/ecom-black.png b/special_product_snippet/static/description/assets/icons/ecom-black.png new file mode 100755 index 000000000..a9385ff13 Binary files /dev/null and b/special_product_snippet/static/description/assets/icons/ecom-black.png differ diff --git a/special_product_snippet/static/description/assets/icons/education-black.png b/special_product_snippet/static/description/assets/icons/education-black.png new file mode 100755 index 000000000..3eb09b27b Binary files /dev/null and b/special_product_snippet/static/description/assets/icons/education-black.png differ diff --git a/special_product_snippet/static/description/assets/icons/hotel-black.png b/special_product_snippet/static/description/assets/icons/hotel-black.png new file mode 100755 index 000000000..130f613be Binary files /dev/null and b/special_product_snippet/static/description/assets/icons/hotel-black.png differ diff --git a/special_product_snippet/static/description/assets/icons/license.png b/special_product_snippet/static/description/assets/icons/license.png new file mode 100755 index 000000000..a5869797e Binary files /dev/null and b/special_product_snippet/static/description/assets/icons/license.png differ diff --git a/special_product_snippet/static/description/assets/icons/lifebuoy.png b/special_product_snippet/static/description/assets/icons/lifebuoy.png new file mode 100755 index 000000000..658d56ccc Binary files /dev/null and b/special_product_snippet/static/description/assets/icons/lifebuoy.png differ diff --git a/special_product_snippet/static/description/assets/icons/manufacturing-black.png b/special_product_snippet/static/description/assets/icons/manufacturing-black.png new file mode 100755 index 000000000..697eb0e9f Binary files /dev/null and b/special_product_snippet/static/description/assets/icons/manufacturing-black.png differ diff --git a/special_product_snippet/static/description/assets/icons/pos-black.png b/special_product_snippet/static/description/assets/icons/pos-black.png new file mode 100755 index 000000000..97c0f90c1 Binary files /dev/null and b/special_product_snippet/static/description/assets/icons/pos-black.png differ diff --git a/special_product_snippet/static/description/assets/icons/puzzle.png b/special_product_snippet/static/description/assets/icons/puzzle.png new file mode 100755 index 000000000..65cf854e7 Binary files /dev/null and b/special_product_snippet/static/description/assets/icons/puzzle.png differ diff --git a/special_product_snippet/static/description/assets/icons/restaurant-black.png b/special_product_snippet/static/description/assets/icons/restaurant-black.png new file mode 100755 index 000000000..4a35eb939 Binary files /dev/null and b/special_product_snippet/static/description/assets/icons/restaurant-black.png differ diff --git a/special_product_snippet/static/description/assets/icons/service-black.png b/special_product_snippet/static/description/assets/icons/service-black.png new file mode 100755 index 000000000..301ab51cb Binary files /dev/null and b/special_product_snippet/static/description/assets/icons/service-black.png differ diff --git a/special_product_snippet/static/description/assets/icons/trading-black.png b/special_product_snippet/static/description/assets/icons/trading-black.png new file mode 100755 index 000000000..9398ba2f1 Binary files /dev/null and b/special_product_snippet/static/description/assets/icons/trading-black.png differ diff --git a/special_product_snippet/static/description/assets/icons/training.png b/special_product_snippet/static/description/assets/icons/training.png new file mode 100755 index 000000000..884ca024d Binary files /dev/null and b/special_product_snippet/static/description/assets/icons/training.png differ diff --git a/special_product_snippet/static/description/assets/icons/update.png b/special_product_snippet/static/description/assets/icons/update.png new file mode 100755 index 000000000..ecbc5a01a Binary files /dev/null and b/special_product_snippet/static/description/assets/icons/update.png differ diff --git a/special_product_snippet/static/description/assets/icons/user.png b/special_product_snippet/static/description/assets/icons/user.png new file mode 100755 index 000000000..6ffb23d9f Binary files /dev/null and b/special_product_snippet/static/description/assets/icons/user.png differ diff --git a/special_product_snippet/static/description/assets/icons/wrench.png b/special_product_snippet/static/description/assets/icons/wrench.png new file mode 100755 index 000000000..6c04dea0f Binary files /dev/null and b/special_product_snippet/static/description/assets/icons/wrench.png differ diff --git a/special_product_snippet/static/description/assets/misc/categories.png b/special_product_snippet/static/description/assets/misc/categories.png new file mode 100755 index 000000000..bedf1e0b1 Binary files /dev/null and b/special_product_snippet/static/description/assets/misc/categories.png differ diff --git a/special_product_snippet/static/description/assets/misc/check-box.png b/special_product_snippet/static/description/assets/misc/check-box.png new file mode 100755 index 000000000..42caf24b9 Binary files /dev/null and b/special_product_snippet/static/description/assets/misc/check-box.png differ diff --git a/special_product_snippet/static/description/assets/misc/compass.png b/special_product_snippet/static/description/assets/misc/compass.png new file mode 100755 index 000000000..d5fed8faa Binary files /dev/null and b/special_product_snippet/static/description/assets/misc/compass.png differ diff --git a/special_product_snippet/static/description/assets/misc/corporate.png b/special_product_snippet/static/description/assets/misc/corporate.png new file mode 100755 index 000000000..2eb13edbf Binary files /dev/null and b/special_product_snippet/static/description/assets/misc/corporate.png differ diff --git a/special_product_snippet/static/description/assets/misc/customer-support.png b/special_product_snippet/static/description/assets/misc/customer-support.png new file mode 100755 index 000000000..79efc72ed Binary files /dev/null and b/special_product_snippet/static/description/assets/misc/customer-support.png differ diff --git a/special_product_snippet/static/description/assets/misc/cybrosys-logo.png b/special_product_snippet/static/description/assets/misc/cybrosys-logo.png new file mode 100755 index 000000000..cc3cc0ccf Binary files /dev/null and b/special_product_snippet/static/description/assets/misc/cybrosys-logo.png differ diff --git a/special_product_snippet/static/description/assets/misc/features.png b/special_product_snippet/static/description/assets/misc/features.png new file mode 100755 index 000000000..b41769f77 Binary files /dev/null and b/special_product_snippet/static/description/assets/misc/features.png differ diff --git a/special_product_snippet/static/description/assets/misc/logo.png b/special_product_snippet/static/description/assets/misc/logo.png new file mode 100755 index 000000000..478462d3e Binary files /dev/null and b/special_product_snippet/static/description/assets/misc/logo.png differ diff --git a/special_product_snippet/static/description/assets/misc/pictures.png b/special_product_snippet/static/description/assets/misc/pictures.png new file mode 100755 index 000000000..56d255fe9 Binary files /dev/null and b/special_product_snippet/static/description/assets/misc/pictures.png differ diff --git a/special_product_snippet/static/description/assets/misc/pie-chart.png b/special_product_snippet/static/description/assets/misc/pie-chart.png new file mode 100755 index 000000000..426e05244 Binary files /dev/null and b/special_product_snippet/static/description/assets/misc/pie-chart.png differ diff --git a/special_product_snippet/static/description/assets/misc/right-arrow.png b/special_product_snippet/static/description/assets/misc/right-arrow.png new file mode 100755 index 000000000..730984a06 Binary files /dev/null and b/special_product_snippet/static/description/assets/misc/right-arrow.png differ diff --git a/special_product_snippet/static/description/assets/misc/star.png b/special_product_snippet/static/description/assets/misc/star.png new file mode 100755 index 000000000..2eb9ab29f Binary files /dev/null and b/special_product_snippet/static/description/assets/misc/star.png differ diff --git a/special_product_snippet/static/description/assets/misc/support.png b/special_product_snippet/static/description/assets/misc/support.png new file mode 100755 index 000000000..4f18b8b82 Binary files /dev/null and b/special_product_snippet/static/description/assets/misc/support.png differ diff --git a/special_product_snippet/static/description/assets/misc/whatsapp.png b/special_product_snippet/static/description/assets/misc/whatsapp.png new file mode 100755 index 000000000..d513a5356 Binary files /dev/null and b/special_product_snippet/static/description/assets/misc/whatsapp.png differ diff --git a/special_product_snippet/static/description/assets/modules/module01.png b/special_product_snippet/static/description/assets/modules/module01.png new file mode 100755 index 000000000..a9936f593 Binary files /dev/null and b/special_product_snippet/static/description/assets/modules/module01.png differ diff --git a/special_product_snippet/static/description/assets/modules/module02.png b/special_product_snippet/static/description/assets/modules/module02.png new file mode 100755 index 000000000..1a9e2cbd7 Binary files /dev/null and b/special_product_snippet/static/description/assets/modules/module02.png differ diff --git a/special_product_snippet/static/description/assets/modules/module03.png b/special_product_snippet/static/description/assets/modules/module03.png new file mode 100755 index 000000000..d3d28e08b Binary files /dev/null and b/special_product_snippet/static/description/assets/modules/module03.png differ diff --git a/special_product_snippet/static/description/assets/modules/module04.png b/special_product_snippet/static/description/assets/modules/module04.png new file mode 100755 index 000000000..5297b364a Binary files /dev/null and b/special_product_snippet/static/description/assets/modules/module04.png differ diff --git a/special_product_snippet/static/description/assets/modules/module05.png b/special_product_snippet/static/description/assets/modules/module05.png new file mode 100755 index 000000000..2263f673e Binary files /dev/null and b/special_product_snippet/static/description/assets/modules/module05.png differ diff --git a/special_product_snippet/static/description/assets/modules/module06.png b/special_product_snippet/static/description/assets/modules/module06.png new file mode 100755 index 000000000..0b8c68699 Binary files /dev/null and b/special_product_snippet/static/description/assets/modules/module06.png differ diff --git a/special_product_snippet/static/description/assets/screenshots/hero.gif b/special_product_snippet/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..6260093fd Binary files /dev/null and b/special_product_snippet/static/description/assets/screenshots/hero.gif differ diff --git a/special_product_snippet/static/description/assets/screenshots/snippet0.png b/special_product_snippet/static/description/assets/screenshots/snippet0.png new file mode 100644 index 000000000..ddf23cd51 Binary files /dev/null and b/special_product_snippet/static/description/assets/screenshots/snippet0.png differ diff --git a/special_product_snippet/static/description/assets/screenshots/snippet111.png b/special_product_snippet/static/description/assets/screenshots/snippet111.png new file mode 100644 index 000000000..dff5bf48d Binary files /dev/null and b/special_product_snippet/static/description/assets/screenshots/snippet111.png differ diff --git a/special_product_snippet/static/description/assets/screenshots/snippet2222.png b/special_product_snippet/static/description/assets/screenshots/snippet2222.png new file mode 100644 index 000000000..538ca8a38 Binary files /dev/null and b/special_product_snippet/static/description/assets/screenshots/snippet2222.png differ diff --git a/special_product_snippet/static/description/assets/screenshots/snippet333.png b/special_product_snippet/static/description/assets/screenshots/snippet333.png new file mode 100644 index 000000000..08377b812 Binary files /dev/null and b/special_product_snippet/static/description/assets/screenshots/snippet333.png differ diff --git a/special_product_snippet/static/description/assets/screenshots/snippet444.png b/special_product_snippet/static/description/assets/screenshots/snippet444.png new file mode 100644 index 000000000..c41df2637 Binary files /dev/null and b/special_product_snippet/static/description/assets/screenshots/snippet444.png differ diff --git a/special_product_snippet/static/description/assets/screenshots/snippet555.png b/special_product_snippet/static/description/assets/screenshots/snippet555.png new file mode 100644 index 000000000..1b4676852 Binary files /dev/null and b/special_product_snippet/static/description/assets/screenshots/snippet555.png differ diff --git a/special_product_snippet/static/description/banner.jpg b/special_product_snippet/static/description/banner.jpg new file mode 100755 index 000000000..15892a150 Binary files /dev/null and b/special_product_snippet/static/description/banner.jpg differ diff --git a/special_product_snippet/static/description/icon.png b/special_product_snippet/static/description/icon.png new file mode 100755 index 000000000..4edc9590d Binary files /dev/null and b/special_product_snippet/static/description/icon.png differ diff --git a/special_product_snippet/static/description/index.html b/special_product_snippet/static/description/index.html new file mode 100644 index 000000000..a03cde8a2 --- /dev/null +++ b/special_product_snippet/static/description/index.html @@ -0,0 +1,547 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+

Special Product Website Snippet

+

Special Product Website Snippet

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

Explore This + Module

+
+ + + + +
+
+ +
+

Overview +

+
+
+
+ This module gives an option to user to select product + and multiple template for product from website snippet +
+
+ + + +
+
+ +
+

Features +

+
+
+
+ +
+ + Available in Odoo 16.0 Community & Enterprise +
+
+ + Add Special Snippet in Website +
+
+ + Users can select product and multiple template for product from snippet +
+ +
+
+ + + +
+
+ +
+

Screenshots +

+
+
+
+ +
+

Special Product Snippet in Website +

+

Add new snippet in website

+ +

Drag and Drop that snippet, user can add product and choose product template from that snippet

+ +

We can have different templates

+ + + +

When we click on the view button, redirects to the shop to view the products.

+ +
+ +
+
+ + + +
+
+

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

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

Need Help?

+
+
+
+ + +
+ +
+ + +
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ + + \ No newline at end of file diff --git a/special_product_snippet/static/src/css/product_snippet.css b/special_product_snippet/static/src/css/product_snippet.css new file mode 100755 index 000000000..5089d1d72 --- /dev/null +++ b/special_product_snippet/static/src/css/product_snippet.css @@ -0,0 +1,186 @@ +.product-page { + display: flex; + align-items: center; + justify-content: center; + height: 100vh; + background-color: #f4f4f4; +} +.product-image { + width: 300px; + height: 300px; + object-fit: cover; + margin-right: 10px; + border-radius: 50px; + margin-top: 40px; +} +.product-image2 { + width: 300px; + height: 300px; + object-fit: cover; + margin-right: 10px; + border-radius: 0px; + margin-top: 40px; + margin-left: 600px; + margin-top: 5px; +} +.product-details { + display: flex; + flex-direction: column; + align-items: center; + text-align: center; +} +.product-details2 { + display: flex; + flex-direction: column; + align-items: center; + text-align: center; +} +.product-name { + font-size: 30px; + font-weight: bold; + color: #333; + margin-top: 100px; +} +.product-name2 { + font-size: 30px; + font-weight: bold; + color: #333; + margin-top: 40px; + margin-left: 90px; +} +.product-description { + font-size: 22px; + color: #888; + margin-top: 40px; + max-width: 700px; +} +.product-price { + font-size: 24px; + color: #ff5252; + margin-top: 10px; +} +.product-price2 { + font-size: 30px; + color: #ff5252; + margin-top: 5px; + font-style: italic; + margin-left: 75px; +} +.product-price3 { + color: grey; + font-size: 22px; +} +.cta-button { + margin-top: 40px; + padding: 20px 40px; + background-color: #ff5252; + color: #fff; + border: none; + border-radius: 100px; + font-size: 22px; + font-weight: bold; + cursor: pointer; +} +.cta-button:hover { + background-color: #e63939; +} +.cta-button2 { + padding: 20px 40px; + background-color: #ff5252; + color: #fff; + border: none; + border-radius: 100px; + font-size: 22px; + font-weight: bold; + cursor: pointer; + box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.2); + margin-left: 60px; +} +.cta-button:hover2 { + background-color: #e63939; +} +body { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif; +} +.product-page3 { + box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2); + max-width: 300px; + margin: auto; + text-align: center; + font-family: arial; +} +.product-name3 { + font-size: 24px; +} +.product-image3 { + width: 300px; +} +.cta-button3 { + padding: 20px 40px; + background-color: #ff5252; + color: #fff; + border: none; + border-radius: 100px; + font-size: 22px; + font-weight: bold; + cursor: pointer; + box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.2); +} +.cta-button4 { + border: none; + outline: 0; + padding: 12px; + color: white; + background-color: #ff5252; + text-align: center; + cursor: pointer; + width: 100%; + font-size: 18px; +} +.cta-button:hover3 { + background-color: #e63939; +} +.s_special_products_options { + border: 1px solid #EAEAEA; + padding: 20px; +} +.product-image4 { + width: 400px; + margin-left: 500px; + border: 1px solid black; + box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3); + animation: slide-in 1s ease-in-out; +} +@keyframes slide-in { + 0% { + transform: translateX(-100%); + opacity: 0; + } + 100% { + transform: translateX(0); + opacity: 1; + } +} +.product-details4 { + display: flex; + flex-direction: column; + align-items: center; +} +.product-price4 { + font-size: 20px; + font-weight: bold; + color: black; + margin-bottom: 10px; +} +.view-button4 { + padding: 10px 30px; + background-color: #ff5252; + color: #fff; + border: none; + border-radius: 100px; + font-size: 22px; + font-weight: bold; + cursor: pointer; + box-shadow: 0px 0px 20px 0px rgb(0 0 0 / 20%); +} +} \ No newline at end of file diff --git a/special_product_snippet/static/src/img/snippets_options/img_special_product_snippet.svg b/special_product_snippet/static/src/img/snippets_options/img_special_product_snippet.svg new file mode 100755 index 000000000..57c4406d9 --- /dev/null +++ b/special_product_snippet/static/src/img/snippets_options/img_special_product_snippet.svg @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/special_product_snippet/static/src/js/options.js b/special_product_snippet/static/src/js/options.js new file mode 100755 index 000000000..a35e14965 --- /dev/null +++ b/special_product_snippet/static/src/js/options.js @@ -0,0 +1,84 @@ +odoo.define('special_product_snippet.special_product_snippet_options', function (require) { + 'use strict'; + var core = require('web.core'); + var _t = core._t; + var globalVariable; + const options = require('web_editor.snippets.options'); + const ajax = require('web.ajax'); + const Many2oneSpecialWidget = options.userValueWidgetsRegistry['we-many2one']; + const { Component, useExternalListener, onMounted } = owl; + const QWeb = core.qweb; + + options.registry.SpecialProduct = options.registry.SelectTemplate.extend({ + /** + * @constructor + */ + init() { + this._super(...arguments); + this.selectTemplateWidgetName = 'special_product_snippet'; + }, + async selectTemplate(previewMode, widgetValue, params) { + await this._templatesLoading; + // Call the controller method with parameters + const response = await ajax.jsonRpc("/website/snippet/special/render", 'call', { + 'template': widgetValue, + 'params': globalVariable + }); + if (previewMode === 'reset') { + if (!this.beforePreviewNodes) { + return; + } + while (this.containerEl.lastChild) { + this.containerEl.removeChild(this.containerEl.lastChild); + } + for (const node of this.beforePreviewNodes) { + this.containerEl.appendChild(node); + } + this.beforePreviewNodes = null; + return; + } + if (!this.beforePreviewNodes) { + this.beforePreviewNodes = [...this.containerEl.childNodes]; + } + while (this.containerEl.lastChild) { + this.containerEl.removeChild(this.containerEl.lastChild); + } + const temp = QWeb.render(widgetValue,response.qcontext); + this.containerEl.insertAdjacentHTML('beforeend',temp); + if (!previewMode) { + this.beforePreviewNodes = null; + } + }, + }); + // getting product from Many2one widget and setting the value in a global + // variable and passing to python and fetching data + const SpecialProductSnippetProduct = Many2oneSpecialWidget.include({ + init(parent, title, options, $target) { + return this._super(...arguments); + }, + _onUserValueNotification(ev) { + const { widget } = ev.data; + globalVariable=widget._methodsParams.recordData + if (widget && widget === this.createInput) { + ev.stopPropagation(); + return; + } + if (widget && widget === this.createButton) { + if (!this.createInput._value) { + ev.stopPropagation(); + } + return; + } + if (widget !== this.createButton && this.createInput) { + this.createInput._value = ''; + } + return this._super(ev); + }, + }); + options.userValueWidgetsRegistry['we-many2one-special'] = Many2oneSpecialWidget; + return { + SpecialProductSnippetProduct: SpecialProductSnippetProduct, + SpecialProduct: options.registry.SpecialProduct, + Many2oneSpecialWidget: Many2oneSpecialWidget, + }; +}); \ No newline at end of file diff --git a/special_product_snippet/static/src/xml/special_product_snippet.xml b/special_product_snippet/static/src/xml/special_product_snippet.xml new file mode 100755 index 000000000..d0dee9c16 --- /dev/null +++ b/special_product_snippet/static/src/xml/special_product_snippet.xml @@ -0,0 +1,79 @@ + + + + +
+ Product Image +
+

+ +

+

+ +

+

Starting at + +

+ + View + +
+
+
+ +
+ Product Image +
+

+ +

+

+ +

+

Starting at + +

+ + View + +
+
+
+ +
+
+

+ +

+
+
+ Product Image +
+ +
+
+

Starting at + +

+ View + +
+
+
+
+ +
+ Product Image +
+ + View +
+
+
+
diff --git a/special_product_snippet/views/product_snippet_templates.xml b/special_product_snippet/views/product_snippet_templates.xml new file mode 100755 index 000000000..e0a6c8f30 --- /dev/null +++ b/special_product_snippet/views/product_snippet_templates.xml @@ -0,0 +1,134 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/special_product_snippet/views/special_product_snippet_templates.xml b/special_product_snippet/views/special_product_snippet_templates.xml new file mode 100755 index 000000000..2c79669c7 --- /dev/null +++ b/special_product_snippet/views/special_product_snippet_templates.xml @@ -0,0 +1,12 @@ + + + + + \ No newline at end of file