@ -0,0 +1,24 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Cybrosys Techno Solutions |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
import controllers |
|||
import models |
@ -0,0 +1,48 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Hilar AK(<hilar@cybrosys.in>) |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
|
|||
{ |
|||
'name': "E-commerce Featured Products", |
|||
'version': '10.0.1.0.0', |
|||
'summary': """e-commerce Featured Products""", |
|||
'description': """Odoo e-commerce Featured Products.""", |
|||
'author': 'Cybrosys Techno Solutions', |
|||
'company': 'Cybrosys Techno Solutions', |
|||
'website': "https://cybrosys.com/", |
|||
'category': 'eCommerce', |
|||
'depends': ['base', |
|||
'website_sale', |
|||
'rating', |
|||
], |
|||
'data': [ |
|||
'security/ir.model.access.csv', |
|||
'views/assets.xml', |
|||
'views/views.xml', |
|||
'views/template.xml', |
|||
], |
|||
'demo': [], |
|||
'images': ['static/description/banner.jpg'], |
|||
'license': 'LGPL-3', |
|||
'installable': True, |
|||
'application': True |
|||
} |
@ -0,0 +1,23 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Cybrosys Techno Solutions |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
import main |
@ -0,0 +1,53 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Cybrosys Techno Solutions |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
|
|||
from odoo import http |
|||
from odoo.http import request |
|||
from odoo.addons.website_sale.controllers import main |
|||
|
|||
|
|||
class WebsiteSaleExtend(main.WebsiteSale): |
|||
@http.route([ |
|||
'/shop', |
|||
'/shop/page/<int:page>', |
|||
'/shop/category/<model("product.public.category"):category>', |
|||
'/shop/category/<model("product.public.category"):category>/page/<int:page>' |
|||
], type='http', auth="public", website=True) |
|||
def shop(self, page=0, category=None, search='', ppg=False, **post): |
|||
""" |
|||
Overrided function to update the response with featured products objects.Here we are updating qcontext. |
|||
:param page: |
|||
:param category: |
|||
:param search: |
|||
:param ppg: |
|||
:param post: |
|||
:return: |
|||
""" |
|||
response = super(WebsiteSaleExtend, self).shop(page=0, category=None, search='', ppg=False, **post) |
|||
env = request.env |
|||
published_list_ids = env['product.featured'].sudo().search([('website_published', '=', True)]).ids |
|||
featured_products = env['product.featured.relation'].sudo().search([('featured_rel', 'in', published_list_ids)]) |
|||
response.qcontext.update({ |
|||
'featured_products': featured_products, |
|||
}) |
|||
return response |
@ -0,0 +1,23 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Cybrosys Techno Solutions |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
import model |
@ -0,0 +1,44 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################## |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2017-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Cybrosys Techno Solutions |
|||
# 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 <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################## |
|||
|
|||
from odoo import models, fields, _ |
|||
|
|||
|
|||
class FeaturedProducts(models.Model): |
|||
_name = 'product.featured.relation' |
|||
_description = 'Related Model for product_featured table' |
|||
|
|||
product = fields.Many2one('product.template') |
|||
featured_rel = fields.Many2one('product.featured') |
|||
|
|||
|
|||
class WebsiteProductFeatured(models.Model): |
|||
_name = 'product.featured' |
|||
_inherit = ['website.published.mixin', 'mail.thread', 'ir.needaction_mixin'] |
|||
_description = 'Basic model for featured products records' |
|||
|
|||
name = fields.Char(string="Name") |
|||
website_published = fields.Boolean(string='Available on the Website', copy=False, default=False) |
|||
featured_list = fields.One2many("product.featured.relation", "featured_rel", string="Featured List") |
|||
user_id = fields.Many2one('res.users', string="Person Responsible", track_visibility='onchange', |
|||
default=lambda self: self.env.uid) |
@ -0,0 +1,35 @@ |
|||
# Ecommerce Featured Products |
|||
|
|||
Ecommerce Featured Products is an odoo e-commerse based addon, which Extends the products view by |
|||
including the featured products as an automatic slider. |
|||
|
|||
- E-commerce Featured Products |
|||
- Automatic Slider with product ratings |
|||
- Configure featured products under website admin menu |
|||
- Can be manage as different collections of featured products |
|||
- Publish or Unpublish records on website |
|||
- Adapted slick.js library for Automatic slider http://kenwheeler.github.io/slick |
|||
|
|||
### Depends |
|||
Ecommerce Featured Products addon depends on Odoo website_sale, rating |
|||
### Tech |
|||
|
|||
* [jQuery] - slick.js v1.6.0 The MIT License (MIT) Copyright (c) 2013-2016 by Ken Wheeler, http://kenwheeler.github.io/slick |
|||
* [Python] - Models, Controllers |
|||
* [XML] - Odoo website templates |
|||
|
|||
### Installation |
|||
- www.odoo.com/documentation/10.0/setup/install.html |
|||
- Install our custom addon, which also installs its depends [rating, website_sale] |
|||
|
|||
### Usage |
|||
> Goto Website Admin - select submenu Featured Products |
|||
> Configure Each collections of Featured Products and make publish. |
|||
|
|||
License |
|||
---- |
|||
GNU LESSER GENERAL PUBLIC LICENSE, Version 3 (LGPLv3) |
|||
(http://www.gnu.org/licenses/agpl.html) |
|||
|
|||
|
|||
|
|
After Width: | Height: | Size: 87 KiB |
After Width: | Height: | Size: 135 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 293 KiB |
After Width: | Height: | Size: 12 KiB |
@ -0,0 +1,128 @@ |
|||
<section class="oe_container oe_dark"> |
|||
<h2 class="oe_slogan" style="margin-top:20px;" >E-commerce Featured Products</h2> |
|||
<h4 class="oe_slogan">Author : Cybrosys Techno Solutions , www.cybrosys.com</h4> |
|||
</section> |
|||
|
|||
<section class="oe_container"> |
|||
<div class="oe_row oe_spaced"> |
|||
<h2 class="oe_slogan" style="color:#875A7B;">Automatic slider for featured products on E-commerce product page</h2> |
|||
<h3 class="oe_slogan"> |
|||
Responsive and with product ratings. |
|||
</h3> |
|||
<!--<div class="oe_demo oe_picture oe_screenshot"> |
|||
<img class="trans-300-out" src="screenshot.gif"> |
|||
</div>--> |
|||
</div> |
|||
|
|||
<div class="oe_container oe_dark"> |
|||
<div class="row mt32 o_animate o_animate_in_children o_animate_offset_min" |
|||
style="animation-name: none; visibility: hidden; animation-play-state: paused;"> |
|||
|
|||
<div class="col-md-5 col-md-offset-1" style="transition-delay: 0ms;"> |
|||
<h2 class=" mt32 mb16"><b>Back-end Configuration for Featured Products under website admin.</b></h2> |
|||
</div> |
|||
<div class="col-md-6" style="transition-delay: 500ms;"> |
|||
<div class=" oe_demo oe_picture oe_screenshot"> |
|||
<img style="max-width: 100%;-moz-transform: scale(1.2);-webkit-transform: scale(1.2); -o-transform: scale(1.2); -ms-transform: scale(1.2); transform: scale(1.2);" |
|||
src="backend.png"> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
</div> |
|||
<div class="oe_container"> |
|||
<div class="row mt32 o_animate o_animate_in_children o_animate_offset_min" |
|||
style="animation-name: none; visibility: hidden; animation-play-state: paused;"> |
|||
|
|||
<div class="col-md-5 col-md-offset-1" style="transition-delay: 0ms;"> |
|||
<h2 class=" mt32 mb16"><b>Can Publish or restrict on front-end</b></h2> |
|||
|
|||
</div> |
|||
<div class="col-md-6" style="transition-delay: 500ms;"> |
|||
<div class=" oe_demo oe_picture oe_screenshot"> |
|||
<img style="max-width: 100%;-moz-transform: scale(1.2);-webkit-transform: scale(1.2); -o-transform: scale(1.2); -ms-transform: scale(1.2); transform: scale(1.2);" |
|||
src="publish.png"> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
</div> |
|||
<div class="oe_container"> |
|||
<div class="row mt32 o_animate o_animate_in_children o_animate_offset_min" |
|||
style="animation-name: none; visibility: hidden; animation-play-state: paused;"> |
|||
|
|||
<div class="col-md-5 col-md-offset-1" style="transition-delay: 0ms;"> |
|||
<h2 class=" mt32 mb16"><b>Make not available on shop, using website publish button</b></h2> |
|||
|
|||
</div> |
|||
<div class="col-md-6" style="transition-delay: 500ms;"> |
|||
<div class=" oe_demo oe_picture oe_screenshot"> |
|||
<img style="max-width: 100%;-moz-transform: scale(1.2);-webkit-transform: scale(1.2); -o-transform: scale(1.2); -ms-transform: scale(1.2); transform: scale(1.2);" |
|||
src="unpublished.png"> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
</div> |
|||
<div class="oe_container"> |
|||
<div class="row mt32 o_animate o_animate_in_children o_animate_offset_min" |
|||
style="animation-name: none; visibility: hidden; animation-play-state: paused;"> |
|||
|
|||
<div class="col-md-5 col-md-offset-1" style="transition-delay: 0ms;"> |
|||
<h2 class=" mt32 mb16"><b>Automatic Slider under products listing with configured products.</b></h2> |
|||
|
|||
</div> |
|||
<div class="col-md-6" style="transition-delay: 500ms;"> |
|||
<div class=" oe_demo oe_picture oe_screenshot"> |
|||
<img style="max-width: 100%;-moz-transform: scale(1.2);-webkit-transform: scale(1.2); -o-transform: scale(1.2); -ms-transform: scale(1.2); transform: scale(1.2);" |
|||
src="shop_preview.png"> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
</div> |
|||
<div class="oe_container"> |
|||
<div class="row mt32 o_animate o_animate_in_children o_animate_offset_min" |
|||
style="animation-name: none; visibility: hidden; animation-play-state: paused;"> |
|||
|
|||
<div class="col-md-5 col-md-offset-1" style="transition-delay: 0ms;"> |
|||
<h2 class=" mt32 mb16"><b>Hover on product to stop slide and click for product description.</b></h2> |
|||
|
|||
</div> |
|||
<div class="col-md-6" style="transition-delay: 500ms;"> |
|||
<div class=" oe_demo oe_picture oe_screenshot"> |
|||
<img style="max-width: 100%;-moz-transform: scale(1.2);-webkit-transform: scale(1.2); -o-transform: scale(1.2); -ms-transform: scale(1.2); transform: scale(1.2);" |
|||
src="hover.png"> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
|||
<section class="oe_container oe_dark"> |
|||
<h2 class="oe_slogan" style="margin-top:20px;" >Need Any Help?</h2> |
|||
<div class="oe_slogan" style="margin-top:10px !important;"> |
|||
<div> |
|||
<a class="btn btn-primary btn-lg mt8" |
|||
style="color: #FFFFFF !important;border-radius: 0;" href="https://www.cybrosys.com"><i |
|||
class="fa fa-envelope"></i> Email </a> <a |
|||
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" |
|||
href="https://www.cybrosys.com/contact/"><i |
|||
class="fa fa-phone"></i> Contact Us </a> <a |
|||
class="btn btn-primary btn-lg mt8" style="color: #FFFFFF !important;border-radius: 0;" |
|||
href="https://www.cybrosys.com/odoo-customization-and-installation/"><i |
|||
class="fa fa-check-square"></i> Request Customization </a> |
|||
</div> |
|||
<br> |
|||
<img src="cybro_logo.png" style="width: 190px; margin-bottom: 20px;" class="center-block"> |
|||
<div> |
|||
<a href="https://twitter.com/cybrosys" target="_blank"><i class="fa fa-2x fa-twitter" style="color:white;background: #00a0d1;width:35px;"></i></a></td> |
|||
<a href="https://www.linkedin.com/company/cybrosys-technologies-pvt-ltd" target="_blank"><i class="fa fa-2x fa-linkedin" style="color:white;background: #31a3d6;width:35px;padding-left: 3px;"></i></a></td> |
|||
<a href="https://www.facebook.com/cybrosystechnologies" target="_blank"><i class="fa fa-2x fa-facebook" style="color:white;background: #3b5998;width:35px;padding-left: 8px;"></i></a></td> |
|||
<a href="https://plus.google.com/106641282743045431892/about" target="_blank"><i class="fa fa-2x fa-google-plus" style="color:white;background: #c53c2c;width:35px;padding-left: 3px;"></i></a></td> |
|||
<a href="https://in.pinterest.com/cybrosys" target="_blank"><i class="fa fa-2x fa-pinterest" style="color:white;background: #ac0f18;width:35px;padding-left: 3px;"></i></a></td> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
|
After Width: | Height: | Size: 55 KiB |
After Width: | Height: | Size: 173 KiB |
After Width: | Height: | Size: 44 KiB |
@ -0,0 +1,125 @@ |
|||
/* Slider */ |
|||
.slick-slider |
|||
{ |
|||
position: relative; |
|||
|
|||
display: block; |
|||
box-sizing: border-box; |
|||
|
|||
-webkit-user-select: none; |
|||
-moz-user-select: none; |
|||
-ms-user-select: none; |
|||
user-select: none; |
|||
|
|||
-webkit-touch-callout: none; |
|||
-khtml-user-select: none; |
|||
-ms-touch-action: pan-y; |
|||
touch-action: pan-y; |
|||
-webkit-tap-highlight-color: transparent; |
|||
} |
|||
|
|||
.slick-list |
|||
{ |
|||
position: relative; |
|||
|
|||
display: block; |
|||
overflow: hidden; |
|||
|
|||
margin: 0; |
|||
padding: 0; |
|||
} |
|||
.slick-list:focus |
|||
{ |
|||
outline: none; |
|||
} |
|||
.slick-list.dragging |
|||
{ |
|||
cursor: pointer; |
|||
cursor: hand; |
|||
} |
|||
|
|||
.slick-slider .slick-track, |
|||
.slick-slider .slick-list |
|||
{ |
|||
-webkit-transform: translate3d(0, 0, 0); |
|||
-moz-transform: translate3d(0, 0, 0); |
|||
-ms-transform: translate3d(0, 0, 0); |
|||
-o-transform: translate3d(0, 0, 0); |
|||
transform: translate3d(0, 0, 0); |
|||
} |
|||
|
|||
.slick-track |
|||
{ |
|||
position: relative; |
|||
top: 0; |
|||
left: 0; |
|||
|
|||
display: block; |
|||
} |
|||
.slick-track:before, |
|||
.slick-track:after |
|||
{ |
|||
display: table; |
|||
|
|||
content: ''; |
|||
} |
|||
.slick-track:after |
|||
{ |
|||
clear: both; |
|||
} |
|||
.slick-loading .slick-track |
|||
{ |
|||
visibility: hidden; |
|||
} |
|||
|
|||
.slick-slide |
|||
{ |
|||
display: none; |
|||
float: left; |
|||
|
|||
height: 100%; |
|||
min-height: 1px; |
|||
} |
|||
[dir='rtl'] .slick-slide |
|||
{ |
|||
float: right; |
|||
} |
|||
.slick-slide img |
|||
{ |
|||
display: block; |
|||
width:200px !important; |
|||
height:200px !important; |
|||
} |
|||
.slick-slide.slick-loading img |
|||
{ |
|||
display: none; |
|||
} |
|||
.slick-slide.dragging img |
|||
{ |
|||
pointer-events: none; |
|||
} |
|||
.slick-initialized .slick-slide |
|||
{ |
|||
display: block; |
|||
} |
|||
.slick-loading .slick-slide |
|||
{ |
|||
visibility: hidden; |
|||
} |
|||
.slick-vertical .slick-slide |
|||
{ |
|||
display: block; |
|||
|
|||
height: auto; |
|||
|
|||
border: 1px solid transparent; |
|||
} |
|||
.slick-arrow { |
|||
display: none; |
|||
} |
|||
.rating.hidden-sm.col-md-6 > .price-text-color.fa-star { |
|||
color: #fcc500; |
|||
} |
|||
.rating.hidden-sm.col-md-6 > .fa-star{ |
|||
color: #dddddb; |
|||
} |
@ -0,0 +1,12 @@ |
|||
$(document).on('ready', function() { |
|||
$(".center").slick({ |
|||
dots: false, |
|||
infinite: true, |
|||
slidesToShow: 5, |
|||
slidesToScroll: 1, |
|||
autoplay: true, |
|||
autoplaySpeed: 1000, |
|||
prevArrow: '', |
|||
nextArrow: '', |
|||
}); |
|||
}); |
@ -0,0 +1,9 @@ |
|||
<odoo> |
|||
<template id="assets_frontend" inherit_id="website.assets_frontend" name="Assets For Featured Products"> |
|||
<xpath expr="." position="inside"> |
|||
<link href="/website_featured_products/static/src/css/Style.css" rel="stylesheet" type="text/css"/> |
|||
<script type="text/javascript" src="/website_featured_products/static/src/lib/slick.min.js"/> |
|||
<script type="text/javascript" src="/website_featured_products/static/src/js/featured_product.js"/> |
|||
</xpath> |
|||
</template> |
|||
</odoo> |
@ -0,0 +1,118 @@ |
|||
<odoo> |
|||
<template id="featured_products" inherit_id="website_sale.products" name="Employee Grid View"> |
|||
<xpath expr="//div[@class='products_pager'][2]" position="after"> |
|||
<div class="container"> |
|||
<div class="center slider"> |
|||
<t t-foreach="featured_products" t-as="fp"> |
|||
<div> |
|||
<img t-att-src="'data:image/png;base64,'+fp.product.image if fp.product.image else ''" |
|||
class="img-responsive" /> |
|||
<div class="row"> |
|||
<div class="price col-md-6"> |
|||
<h5><a t-att-href="'/shop/product/%s' % slug(fp.product)"><span t-esc="fp.product.name"/></a></h5> |
|||
<h5 class="price-text-color"> |
|||
<span t-field="fp.product.lst_price" |
|||
t-options='{ |
|||
"widget": "monetary", |
|||
"display_currency": fp.product.currency_id, |
|||
}'/> |
|||
</h5> |
|||
</div> |
|||
<div class="rating hidden-sm col-md-6"> |
|||
<t t-set="rating" t-value="request.env['rating.rating'].sudo().search([('res_id', '=', fp.product.id)])"/> |
|||
<i t-att-class="'fa fa-star' + ' price-text-color' if rating and rating.rating > 0 else 'fa fa-star'"/> |
|||
<i t-att-class="'fa fa-star' + ' price-text-color' if rating and rating.rating > 1 else 'fa fa-star'"/> |
|||
<i t-att-class="'fa fa-star' + ' price-text-color' if rating and rating.rating > 2 else 'fa fa-star'"/> |
|||
<i t-att-class="'fa fa-star' + ' price-text-color' if rating and rating.rating > 3 else 'fa fa-star'"/> |
|||
<i t-att-class="'fa fa-star' + ' price-text-color' if rating and rating.rating > 4 else 'fa fa-star'"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</t> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
|
|||
<!--<div class="col-sm-3">--> |
|||
<!--<div class="col-item">--> |
|||
<!--<div class="photo">--> |
|||
<!--<img t-att-src="'data:image/png;base64,'+fp.product.image if fp.product.image else ''" |
|||
class="img-responsive" alt="a" />--> |
|||
<!--</div>--> |
|||
<!--<div class="info">--> |
|||
<!--<div class="row">--> |
|||
<!--<div class="price col-md-6">--> |
|||
<!--<h5>--> |
|||
<!--<span t-esc="fp.product.name"/></h5>--> |
|||
<!--<h5 class="price-text-color">--> |
|||
<!--<span t-field="fp.product.lst_price"--> |
|||
<!--t-options='{--> |
|||
<!--"widget": "monetary",--> |
|||
<!--"display_currency": fp.product.currency_id,--> |
|||
<!--}'/></h5>--> |
|||
<!--</div>--> |
|||
<!--<div class="rating hidden-sm col-md-6">--> |
|||
<!--<i class="price-text-color fa fa-star"></i><i class="price-text-color fa fa-star">--> |
|||
<!--</i><i class="price-text-color fa fa-star"></i><i class="price-text-color fa fa-star">--> |
|||
<!--</i><i class="fa fa-star"></i>--> |
|||
<!--</div>--> |
|||
<!--</div>--> |
|||
<!--<div class="separator clear-left">--> |
|||
<!--<p class="btn-add">--> |
|||
<!--<i class="fa fa-shopping-cart"></i><a href="#" class="hidden-sm">Add to cart</a></p>--> |
|||
<!--<p class="btn-details">--> |
|||
<!--<i class="fa fa-list"></i><a href="#" class="hidden-sm">More details</a></p>--> |
|||
<!--</div>--> |
|||
<!--<div class="clearfix">--> |
|||
<!--</div>--> |
|||
<!--</div>--> |
|||
<!--</div>--> |
|||
<!--</div>--> |
|||
<!--</t>--> |
|||
<!--</div>--> |
|||
|
|||
<!--<div class="item ">--> |
|||
<!--<div class="row">--> |
|||
<!--<t t-foreach="featured_products" t-as="fp">--> |
|||
<!--<div class="col-sm-3">--> |
|||
<!--<div class="col-item">--> |
|||
<!--<div class="photo">--> |
|||
<!--<img t-att-src="'data:image/png;base64,'+fp.product.image if fp.product.image else ''"--> |
|||
<!--class="img-responsive" alt="a" />--> |
|||
<!--</div>--> |
|||
<!--<div class="info">--> |
|||
<!--<div class="row">--> |
|||
<!--<div class="price col-md-6">--> |
|||
<!--<h5>--> |
|||
<!--<span t-esc="fp.product.name"/></h5>--> |
|||
<!--<h5 class="price-text-color">--> |
|||
<!--<span t-field="fp.product.lst_price"--> |
|||
<!--t-options='{--> |
|||
<!--"widget": "monetary",--> |
|||
<!--"display_currency": fp.product.currency_id,--> |
|||
<!--}'/></h5>--> |
|||
<!--</div>--> |
|||
<!--<div class="rating hidden-sm col-md-6">--> |
|||
<!--<i class="price-text-color fa fa-star"></i><i class="price-text-color fa fa-star">--> |
|||
<!--</i><i class="price-text-color fa fa-star"></i><i class="price-text-color fa fa-star">--> |
|||
<!--</i><i class="fa fa-star"></i>--> |
|||
<!--</div>--> |
|||
<!--</div>--> |
|||
<!--<div class="separator clear-left">--> |
|||
<!--<p class="btn-add">--> |
|||
<!--<i class="fa fa-shopping-cart"></i><a href="#" class="hidden-sm">Add to cart</a></p>--> |
|||
<!--<p class="btn-details">--> |
|||
<!--<i class="fa fa-list"></i><a href="#" class="hidden-sm">More details</a></p>--> |
|||
<!--</div>--> |
|||
<!--<div class="clearfix">--> |
|||
<!--</div>--> |
|||
<!--</div>--> |
|||
<!--</div>--> |
|||
<!--</div>--> |
|||
<!--</t>--> |
|||
<!--</div>--> |
|||
|
|||
</xpath> |
|||
</template> |
|||
</odoo> |
@ -0,0 +1,64 @@ |
|||
<odoo> |
|||
<record id="product_featured_list_form" model="ir.ui.view"> |
|||
<field name="name">Product Featured List Form View</field> |
|||
<field name="model">product.featured</field> |
|||
<field name="arch" type="xml"> |
|||
<form> |
|||
<sheet> |
|||
<div class="oe_button_box" name="button_box"> |
|||
<button class="oe_stat_button" name="website_publish_button" |
|||
type="object" icon="fa-globe"> |
|||
<field name="website_published" widget="website_button"/> |
|||
</button> |
|||
</div> |
|||
<group> |
|||
<group><field name="name"/></group> |
|||
<group><field name="user_id"/></group> |
|||
</group> |
|||
<notebook> |
|||
<page name="featured_list" string="Featured Products"> |
|||
<field name="featured_list"> |
|||
<tree editable="bottom"> |
|||
<field name="product"/> |
|||
</tree> |
|||
<form> |
|||
<field name="product"/> |
|||
</form> |
|||
</field> |
|||
</page> |
|||
</notebook> |
|||
</sheet> |
|||
<div class="oe_chatter"> |
|||
<field name="message_follower_ids" widget="mail_followers" groups="base.group_user"/> |
|||
<field name="message_ids" widget="mail_thread"/> |
|||
</div> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
<record id="product_featured_list_tree" model="ir.ui.view"> |
|||
<field name="name">Product Featured List Tree View</field> |
|||
<field name="model">product.featured</field> |
|||
<field name="arch" type="xml"> |
|||
<tree> |
|||
<field name="name"/> |
|||
<field name="website_published"/> |
|||
<field name="user_id"/> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="featured_products_action" model="ir.actions.act_window"> |
|||
<field name="name">Featured Products</field> |
|||
<field name="res_model">product.featured</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">tree,form</field> |
|||
<!--<field name="context">{'search_default_published': 1, 'default_website_published': True}</field>--> |
|||
</record> |
|||
|
|||
<menuitem |
|||
id="featured_products_menu" |
|||
name="Featured Products" |
|||
parent="website_sale.menu_catalog" |
|||
action="featured_products_action" |
|||
/> |
|||
</odoo> |