4 changed files with 79 additions and 2 deletions
			
			
		@ -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 Product Quick View", | 
				
			||||
 | 
					    'version': '10.0.1.0.0', | 
				
			||||
 | 
					    'summary': """E-commerce Product Quick View.""", | 
				
			||||
 | 
					    'description': """E-commerce Product Quick View.""", | 
				
			||||
 | 
					    'author': 'Cybrosys Techno Solutions', | 
				
			||||
 | 
					    'company': 'Cybrosys Techno Solutions', | 
				
			||||
 | 
					    'website': "https://cybrosys.com", | 
				
			||||
 | 
					    'category': 'eCommerce', | 
				
			||||
 | 
					    'depends': ['base', | 
				
			||||
 | 
					                'website_sale', | 
				
			||||
 | 
					                'website_mail', | 
				
			||||
 | 
					                'rating', | 
				
			||||
 | 
					                ], | 
				
			||||
 | 
					    'data': [ | 
				
			||||
 | 
					        # 'security/ir.model.access.csv', | 
				
			||||
 | 
					        'views/assets.xml', | 
				
			||||
 | 
					        'views/template.xml', | 
				
			||||
 | 
					    ], | 
				
			||||
 | 
					    'demo': [], | 
				
			||||
 | 
					    'images': ['static/description/banner.jpg'], | 
				
			||||
 | 
					    'license': 'LGPL-3', | 
				
			||||
 | 
					    'installable': True, | 
				
			||||
 | 
					    'application': True | 
				
			||||
 | 
					} | 
				
			||||
@ -0,0 +1,29 @@ | 
				
			|||||
 | 
					# -*- coding: utf-8 -*- | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					from odoo import http | 
				
			||||
 | 
					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 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) | 
				
			||||
 | 
					        response.qcontext.update({ | 
				
			||||
 | 
					            'get_attribute_value_ids': self.get_attribute_value_ids, | 
				
			||||
 | 
					            'rating_status': response.qcontext.get('rating_product'), | 
				
			||||
 | 
					        }) | 
				
			||||
 | 
					        return response | 
				
			||||
					Loading…
					
					
				
		Reference in new issue