diff --git a/special_product_snippet/README.rst b/special_product_snippet/README.rst new file mode 100755 index 000000000..7feb0c604 --- /dev/null +++ b/special_product_snippet/README.rst @@ -0,0 +1,52 @@ +.. 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 + +Features +======== +* Users can select Product and Multiple Template for Product from Snippet. + +Configuration +============= +Nothing to configure. + +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: (V16) Sruthi Pavithran, + (V17) Farhana Jahan PT, + 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/special_product_snippet/__init__.py b/special_product_snippet/__init__.py new file mode 100755 index 000000000..156acf2fb --- /dev/null +++ b/special_product_snippet/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-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..8c190778c --- /dev/null +++ b/special_product_snippet/__manifest__.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-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': '17.0.1.0.0', + 'category': 'Website', + 'summary': "Select Product and Multiple Template for Product in " + "Website Snippet", + '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..685cc78c4 --- /dev/null +++ b/special_product_snippet/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-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..1bfb9add0 --- /dev/null +++ b/special_product_snippet/controllers/special_product_snippet.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-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..f2732880b --- /dev/null +++ b/special_product_snippet/doc/RELEASE_NOTES.md @@ -0,0 +1,5 @@ +## Module +#### 22.01.2024 +#### Version 17.0.1.0.0 +#### ADD +- Initial Commit for Special Product Website Snippet diff --git a/special_product_snippet/static/description/assets/icons/capture (1).png b/special_product_snippet/static/description/assets/icons/capture (1).png new file mode 100644 index 000000000..8824deafc Binary files /dev/null and b/special_product_snippet/static/description/assets/icons/capture (1).png differ 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 100644 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 100644 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 100644 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 100644 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 100644 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 100644 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 100644 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/img.png b/special_product_snippet/static/description/assets/icons/img.png new file mode 100644 index 000000000..70197f477 Binary files /dev/null and b/special_product_snippet/static/description/assets/icons/img.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 100644 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 100644 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 100644 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/photo-capture.png b/special_product_snippet/static/description/assets/icons/photo-capture.png new file mode 100644 index 000000000..06c111758 Binary files /dev/null and b/special_product_snippet/static/description/assets/icons/photo-capture.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 100644 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 100644 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 100644 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 100644 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 100644 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 100644 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 100644 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 100644 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 100644 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/Cybrosys R.png b/special_product_snippet/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/special_product_snippet/static/description/assets/misc/Cybrosys R.png differ diff --git a/special_product_snippet/static/description/assets/misc/email.svg b/special_product_snippet/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/special_product_snippet/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/special_product_snippet/static/description/assets/misc/phone.svg b/special_product_snippet/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/special_product_snippet/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/special_product_snippet/static/description/assets/misc/star (1) 2.svg b/special_product_snippet/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/special_product_snippet/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/special_product_snippet/static/description/assets/misc/support (1) 1.svg b/special_product_snippet/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/special_product_snippet/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/special_product_snippet/static/description/assets/misc/support-email.svg b/special_product_snippet/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/special_product_snippet/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/special_product_snippet/static/description/assets/misc/tick-mark.svg b/special_product_snippet/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/special_product_snippet/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/special_product_snippet/static/description/assets/misc/whatsapp 1.svg b/special_product_snippet/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/special_product_snippet/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/special_product_snippet/static/description/assets/misc/whatsapp.svg b/special_product_snippet/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/special_product_snippet/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/special_product_snippet/static/description/assets/modules/1.png b/special_product_snippet/static/description/assets/modules/1.png new file mode 100644 index 000000000..e90228872 Binary files /dev/null and b/special_product_snippet/static/description/assets/modules/1.png differ diff --git a/special_product_snippet/static/description/assets/modules/2.png b/special_product_snippet/static/description/assets/modules/2.png new file mode 100644 index 000000000..fa478cd14 Binary files /dev/null and b/special_product_snippet/static/description/assets/modules/2.png differ diff --git a/special_product_snippet/static/description/assets/modules/3.jpg b/special_product_snippet/static/description/assets/modules/3.jpg new file mode 100644 index 000000000..793b14f11 Binary files /dev/null and b/special_product_snippet/static/description/assets/modules/3.jpg differ diff --git a/special_product_snippet/static/description/assets/modules/4.png b/special_product_snippet/static/description/assets/modules/4.png new file mode 100644 index 000000000..9b58fa3ec Binary files /dev/null and b/special_product_snippet/static/description/assets/modules/4.png differ diff --git a/special_product_snippet/static/description/assets/modules/5.png b/special_product_snippet/static/description/assets/modules/5.png new file mode 100644 index 000000000..a78662b18 Binary files /dev/null and b/special_product_snippet/static/description/assets/modules/5.png differ diff --git a/special_product_snippet/static/description/assets/modules/6.png b/special_product_snippet/static/description/assets/modules/6.png new file mode 100644 index 000000000..0547a5bce Binary files /dev/null and b/special_product_snippet/static/description/assets/modules/6.png differ diff --git a/special_product_snippet/static/description/assets/screenshots/1.png b/special_product_snippet/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..82ce3b182 Binary files /dev/null and b/special_product_snippet/static/description/assets/screenshots/1.png differ diff --git a/special_product_snippet/static/description/assets/screenshots/2.png b/special_product_snippet/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..a6e8432c2 Binary files /dev/null and b/special_product_snippet/static/description/assets/screenshots/2.png differ diff --git a/special_product_snippet/static/description/assets/screenshots/3.png b/special_product_snippet/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..5840dbae3 Binary files /dev/null and b/special_product_snippet/static/description/assets/screenshots/3.png differ diff --git a/special_product_snippet/static/description/assets/screenshots/4.png b/special_product_snippet/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..738b2f662 Binary files /dev/null and b/special_product_snippet/static/description/assets/screenshots/4.png differ diff --git a/special_product_snippet/static/description/assets/screenshots/5.png b/special_product_snippet/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..8603f71cb Binary files /dev/null and b/special_product_snippet/static/description/assets/screenshots/5.png differ diff --git a/special_product_snippet/static/description/assets/screenshots/6.png b/special_product_snippet/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..8329aa8c6 Binary files /dev/null and b/special_product_snippet/static/description/assets/screenshots/6.png differ diff --git a/special_product_snippet/static/description/assets/screenshots/7.png b/special_product_snippet/static/description/assets/screenshots/7.png new file mode 100644 index 000000000..8031d75da Binary files /dev/null and b/special_product_snippet/static/description/assets/screenshots/7.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..d2ec48bc7 Binary files /dev/null and b/special_product_snippet/static/description/assets/screenshots/hero.gif differ diff --git a/special_product_snippet/static/description/banner.jpg b/special_product_snippet/static/description/banner.jpg new file mode 100644 index 000000000..641aa46e0 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 100644 index 000000000..fc3680b98 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..cf63819fc --- /dev/null +++ b/special_product_snippet/static/description/index.html @@ -0,0 +1,604 @@ + + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ Special Product Website Snippet

+

+ Special Product Snippet for Website +

+
+ +
+
+
+
+
+

Key Highlights +

+
+
+
+
+
+ +
+
+

Add Special Snippet in Website

+

Users can select Product and Multiple Template for Product from Snippet. +

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

+ Drag and Drop the Snippet in Website.

+
+
+
+
+
+
+ +
+
+

+ User can add Product and Choose Product Template from that Snippet

+
+
+
+
+
+
+ +
+
+

+ First Template

+
+
+
+
+
+
+ +
+
+

+ Second Template

+
+
+
+
+
+
+ +
+
+

+ Third Template

+
+
+
+
+
+
+ +
+
+

+ Fourth Template

+
+
+
+
+
+
+ +
+
+

+ When we click on the 'View' button, redirects to the Shop to view the Product Details. +

+
+
+
+
+
+
+
    +
  • + Select Multiple Template and Product +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:10th Jan 2024 +
+

+ Initial Commit for Special Product Website Snippet.

+
+
+
+
+
+
+
+

Related Products

+
+
+ +
+
+

Our Services

+ +
+
+
+
+
+
+
+
+ service-icon +
+
+

Odoo Customization

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Support

+
+
+
+
+
+
+ service-icon +
+
+

Hire Odoo Developer

+
+
+
+
+ +
+
+ service-icon +
+
+

Odoo Integration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Migration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Consultancy

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Implementation

+
+
+
+
+
+
+ service-icon +
+
+

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 + 99456767686
+
+
+
+
+
+
+
+
+ + + + + + 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..5b21e708b --- /dev/null +++ b/special_product_snippet/static/src/css/product_snippet.css @@ -0,0 +1,186 @@ +.first-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; +} +.second-product-image { + 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; +} +.second-product-details { + display: flex; + flex-direction: column; + align-items: center; + text-align: center; +} +.product-name { + font-size: 30px; + font-weight: bold; + color: #333; + margin-top: 100px; +} +.second-product-name { + 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; +} +.second-product-price { + font-size: 30px; + color: #ff5252; + margin-top: 5px; + font-style: italic; + margin-left: 75px; +} +.third-product-price { + 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; +} +.third-product-page { + box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2); + max-width: 300px; + margin: auto; + text-align: center; + font-family: arial; +} +.third-product-name { + font-size: 24px; +} +.third-product-image { + width: 300px; +} +.third-cta-button { + 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); +} +.fourth-cta-button { + 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; +} +.fourth-product-image { + 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; + } +} +.fourth-product-details { + display: flex; + flex-direction: column; + align-items: center; +} +.fourth-product-price { + font-size: 20px; + font-weight: bold; + color: black; + margin-bottom: 10px; +} +.fourth-view-button { + 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%); +} +} 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..07e4aef29 --- /dev/null +++ b/special_product_snippet/static/src/js/options.js @@ -0,0 +1,94 @@ +/** @odoo-module **/ +var globalVariable; +import { jsonrpc } from "@web/core/network/rpc_service"; +import options from "@web_editor/js/editor/snippets.options"; +import { renderToFragment } from "@web/core/utils/render"; +const Many2oneSpecialWidget = options.userValueWidgetsRegistry['we-many2one']; +options.registry.SpecialProduct = options.registry.SelectTemplate.extend({ + /** + * @constructor + */ + init() { + this._super(...arguments); + this.containerSelector = ''; + this.selectTemplateWidgetName = 'special_product_snippet'; + this.orm = this.bindService("orm"); + }, + async selectTemplate(previewMode, widgetValue, params) { + var self = this; + if (globalVariable) { + await this._templatesLoading; + // Call the controller method with parameters + const response = await jsonrpc("/website/snippet/special/render", { + 'template': widgetValue, + 'params': globalVariable + }); + if (previewMode === 'reset') { + if (!this.beforePreviewNodes) { + // FIXME should not be necessary: only needed because we have a + // strange 'reset' sent after a non-preview + return; + } + // Empty the container and restore the original content + 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) { + // We are about the apply a template on non-previewed content, + // save that content's nodes. + this.beforePreviewNodes = [...this.containerEl.childNodes]; + } + // Empty the container and add the template content + while (this.containerEl.lastChild) { + this.containerEl.removeChild(this.containerEl.lastChild); + } + const temp = renderToFragment(widgetValue, response.qcontext); + this.$target.append(temp) + if (!previewMode) { + // The original content to keep saved has to be retrieved just + // before the preview (if we save it now, we might miss other items + // added by other options or custo). + 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, +}; 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..d62737b13 --- /dev/null +++ b/special_product_snippet/static/src/xml/special_product_snippet.xml @@ -0,0 +1,85 @@ + + + + +
+ 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..b8fd89c96 --- /dev/null +++ b/special_product_snippet/views/product_snippet_templates.xml @@ -0,0 +1,138 @@ + + + + + + + + + + + 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..dd3e31c98 --- /dev/null +++ b/special_product_snippet/views/special_product_snippet_templates.xml @@ -0,0 +1,12 @@ + + + + +