diff --git a/website_sale_product_gallery_zoom/__init__.py b/website_sale_product_gallery_zoom/__init__.py new file mode 100644 index 000000000..a5e7e1d4f --- /dev/null +++ b/website_sale_product_gallery_zoom/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +import models \ No newline at end of file diff --git a/website_sale_product_gallery_zoom/__openerp__.py b/website_sale_product_gallery_zoom/__openerp__.py new file mode 100644 index 000000000..d7e8ed9f5 --- /dev/null +++ b/website_sale_product_gallery_zoom/__openerp__.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Hilar AK() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## + +{ + 'name': "E-commerce Product Gallery & Zoom", + 'version': '9.0.1.0.0', + 'summary': """ + Odoo e-commerce Product Gallery and Zoom.""", + + 'description': """ + Odoo e-commerce Product Gallery and Zoom. + """, + + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': "http://cybrosys.com/", + 'category': 'eCommerce', + 'depends': ['base', + 'website', + 'website_sale', + ], + 'data': [ + 'security/ir.model.access.csv', + 'views/product_view.xml', + 'views/product_template.xml', + 'views/assets.xml' + ], + # only loaded in demonstration mode + 'demo': [ + # 'demo/demo.xml', + ], + 'images': ['static/description/banner.jpg'], + 'license': 'LGPL-3', + 'installable': True, + 'application': True +} \ No newline at end of file diff --git a/website_sale_product_gallery_zoom/models/__init__.py b/website_sale_product_gallery_zoom/models/__init__.py new file mode 100644 index 000000000..c65f3012a --- /dev/null +++ b/website_sale_product_gallery_zoom/models/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +import product \ No newline at end of file diff --git a/website_sale_product_gallery_zoom/models/product.py b/website_sale_product_gallery_zoom/models/product.py new file mode 100644 index 000000000..d4c63b3ea --- /dev/null +++ b/website_sale_product_gallery_zoom/models/product.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- + +from openerp import fields, models + +class MultiProductImagesRel(models.Model): + _name = 'product.images' + _description = "Add Multiple Images in Product" + + sequence = fields.Integer('Sequence') + name = fields.Char('Name') + image = fields.Binary( + 'Image', + attachment=True, + ) + product_id_rel = fields.Many2one( + 'product.template', + 'Product', + ) + +class Product(models.Model): + _inherit = 'product.template' + _description = "Images Gallery For Products" + + product_multi_images = fields.One2many( + 'product.images', + 'product_id_rel', + string='Gallery', + ) \ No newline at end of file diff --git a/website_sale_product_gallery_zoom/readme.md b/website_sale_product_gallery_zoom/readme.md new file mode 100644 index 000000000..1e5344748 --- /dev/null +++ b/website_sale_product_gallery_zoom/readme.md @@ -0,0 +1,33 @@ +# Ecommerce Product Gallery & Zoom + +Ecommerce Product Gallery & Zoom is an odoo e-commerse based addon, which Extends the product description view by +including the Products Multiple Images as a Gallery and also enabling The Zoom. + + - E-commerce Product Gallery + - E-commerce Product Image Zoom + - Set Product Images on Backend + - First Five Images will be taken for image Gallery form backend Image list + +### Depends +Ecommerce Product Gallery & Zoom addon depends on Odoo website and website_sale +### Tech + +* [jQuery] - Zoom xZoom v1.0.5, (c) 2013 by Azat Ahmedov & Elman Guseynov, https://github.com/payalord +* [Python] - Models +* [XML] - Odoo website templates + +### Installation +- www.odoo.com/documentation/9.0/setup/install.html +- Install our custom addon, which also installs its depends [website, website_sale] + +### Usage +> Create Gallery Images on product backend, sales -> products -> product form -> page Image Gallery +> First Install our custom addon, then go to website and open product description page. + +License +---- +GNU LESSER GENERAL PUBLIC LICENSE, Version 3 (LGPLv3) +(http://www.gnu.org/licenses/agpl.html) + + + diff --git a/website_sale_product_gallery_zoom/security/ir.model.access.csv b/website_sale_product_gallery_zoom/security/ir.model.access.csv new file mode 100644 index 000000000..98f207afe --- /dev/null +++ b/website_sale_product_gallery_zoom/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +public_access_product_images,Access Product Images Public,model_product_images,,1,0,0,0 \ No newline at end of file diff --git a/website_sale_product_gallery_zoom/static/description/backend.png b/website_sale_product_gallery_zoom/static/description/backend.png new file mode 100644 index 000000000..b554d80cc Binary files /dev/null and b/website_sale_product_gallery_zoom/static/description/backend.png differ diff --git a/website_sale_product_gallery_zoom/static/description/banner.jpg b/website_sale_product_gallery_zoom/static/description/banner.jpg new file mode 100644 index 000000000..15ad038f3 Binary files /dev/null and b/website_sale_product_gallery_zoom/static/description/banner.jpg differ diff --git a/website_sale_product_gallery_zoom/static/description/cybro_logo.png b/website_sale_product_gallery_zoom/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/website_sale_product_gallery_zoom/static/description/cybro_logo.png differ diff --git a/website_sale_product_gallery_zoom/static/description/icon.png b/website_sale_product_gallery_zoom/static/description/icon.png new file mode 100644 index 000000000..aed983ac0 Binary files /dev/null and b/website_sale_product_gallery_zoom/static/description/icon.png differ diff --git a/website_sale_product_gallery_zoom/static/description/index.html b/website_sale_product_gallery_zoom/static/description/index.html new file mode 100644 index 000000000..600d9b94d --- /dev/null +++ b/website_sale_product_gallery_zoom/static/description/index.html @@ -0,0 +1,114 @@ +
+

E-commerce Product Gallery & Zoom

+
+
+
+

Multiple Images for products and Zoom Plugin

+

+ Responsive Gallery and Zoom Functionality +

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

Need Any Help?

+ + +
diff --git a/website_sale_product_gallery_zoom/static/description/tgallery.png b/website_sale_product_gallery_zoom/static/description/tgallery.png new file mode 100644 index 000000000..793b63967 Binary files /dev/null and b/website_sale_product_gallery_zoom/static/description/tgallery.png differ diff --git a/website_sale_product_gallery_zoom/static/description/thover.png b/website_sale_product_gallery_zoom/static/description/thover.png new file mode 100644 index 000000000..490eaf60b Binary files /dev/null and b/website_sale_product_gallery_zoom/static/description/thover.png differ diff --git a/website_sale_product_gallery_zoom/static/description/tzoom.png b/website_sale_product_gallery_zoom/static/description/tzoom.png new file mode 100644 index 000000000..ba55637b3 Binary files /dev/null and b/website_sale_product_gallery_zoom/static/description/tzoom.png differ diff --git a/website_sale_product_gallery_zoom/static/description/tzoom2.png b/website_sale_product_gallery_zoom/static/description/tzoom2.png new file mode 100644 index 000000000..83eb3d9a6 Binary files /dev/null and b/website_sale_product_gallery_zoom/static/description/tzoom2.png differ diff --git a/website_sale_product_gallery_zoom/static/images/banner.jpg b/website_sale_product_gallery_zoom/static/images/banner.jpg new file mode 100644 index 000000000..bbe7428af Binary files /dev/null and b/website_sale_product_gallery_zoom/static/images/banner.jpg differ diff --git a/website_sale_product_gallery_zoom/static/images/xloading.gif b/website_sale_product_gallery_zoom/static/images/xloading.gif new file mode 100644 index 000000000..75f75e3c3 Binary files /dev/null and b/website_sale_product_gallery_zoom/static/images/xloading.gif differ diff --git a/website_sale_product_gallery_zoom/static/src/css/xzoom.css b/website_sale_product_gallery_zoom/static/src/css/xzoom.css new file mode 100644 index 000000000..fc1fc920d --- /dev/null +++ b/website_sale_product_gallery_zoom/static/src/css/xzoom.css @@ -0,0 +1,103 @@ +/* Compatibility styles for frameworks like bootstrap, foundation e.t.c */ +.xzoom-source img, .xzoom-preview img, .xzoom-lens img { + display: block; + max-width: none; + max-height: none; + -webkit-transition: none; + -moz-transition: none; + -o-transition: none; + transition: none; +} +/* --------------- */ + +/* xZoom Styles below */ +.xzoom-container { + display: inline-block; +} + +.xzoom-thumbs { + text-align: center; + margin-bottom: 10px; +} + +.xzoom { + -webkit-box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.5); + -moz-box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.5); + box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.5); +} +.xzoom2, .xzoom3, .xzoom4, .xzoom5 { + -webkit-box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.5); + -moz-box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.5); + box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.5); +} + +/* Thumbs */ +.xzoom-gallery, .xzoom-gallery2, .xzoom-gallery3, .xzoom-gallery4, .xzoom-gallery5 { + border: 1px solid #cecece; + margin-left: 5px; + margin-bottom: 10px; +} + +.xzoom-source, .xzoom-hidden { + display: block; + position: static; + float: none; + clear: both; +} + +/* Everything out of border is hidden */ +.xzoom-hidden { + overflow: hidden; +} + +/* Preview */ +.xzoom-preview { + border: 1px solid #888; + background: #2f4f4f; + box-shadow: -0px -0px 10px rgba(0,0,0,0.50); +} + +/* Lens */ +.xzoom-lens { + border: 1px solid #555; + box-shadow: -0px -0px 10px rgba(0,0,0,0.50); + cursor: crosshair; +} + +/* Loading */ +.xzoom-loading { + background-position: center center; + background-repeat: no-repeat; + border-radius: 100%; + opacity: .7; + background: url(../images/xloading.gif); + width: 48px; + height: 48px; +} + +/* Additional class that applied to thumb when it is active */ +.xactive { + -webkit-box-shadow: 0px 0px 3px 0px rgba(74,169,210,1); + -moz-box-shadow: 0px 0px 3px 0px rgba(74,169,210,1); + box-shadow: 0px 0px 3px 0px rgba(74,169,210,1); + border: 1px solid #4aaad2; +} + +/* Caption */ +.xzoom-caption { + position: absolute; + bottom: -43px; + left: 0; + background: #000; + width: 100%; + text-align: left; +} + +.xzoom-caption span { + color: #fff; + font-family: Arial, sans-serif; + display: block; + font-size: 0.75em; + font-weight: bold; + padding: 10px; +} \ No newline at end of file diff --git a/website_sale_product_gallery_zoom/static/src/js/setup.js b/website_sale_product_gallery_zoom/static/src/js/setup.js new file mode 100644 index 000000000..16b7965a1 --- /dev/null +++ b/website_sale_product_gallery_zoom/static/src/js/setup.js @@ -0,0 +1,16 @@ +(function ($) { + $(document).ready(function() { + $('.xzoom, .xzoom-gallery').xzoom({ + zoomWidth: '250', + zoomHeight: '250', + title: false, + tint: '#333', + Xoffset: 15, + scroll: true, + fadeTrans: true, + position: 'lens', + lensShape: 'square', + sourceClass: 'xzoom-hidden', + hover: true, + }); +});})(jQuery); \ No newline at end of file diff --git a/website_sale_product_gallery_zoom/views/assets.xml b/website_sale_product_gallery_zoom/views/assets.xml new file mode 100644 index 000000000..426c483c8 --- /dev/null +++ b/website_sale_product_gallery_zoom/views/assets.xml @@ -0,0 +1,18 @@ + +