@ -0,0 +1,42 @@ |
|||||
|
.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg |
||||
|
:target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html |
||||
|
:alt: License: LGPL-3 |
||||
|
|
||||
|
Theme Coffee Shop |
||||
|
================= |
||||
|
Theme Coffee Shop, A more appealing and practical theme for an e-Commerce Odoo website. |
||||
|
|
||||
|
Company |
||||
|
------- |
||||
|
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
||||
|
|
||||
|
License |
||||
|
------- |
||||
|
Lesser General Public License, Version 3 (LGPL v3). |
||||
|
(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) |
||||
|
|
||||
|
Credits |
||||
|
------- |
||||
|
Developer: (V15) Fathima Mazlin AM, 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 <https://cybrosys.com/>`__ |
||||
|
|
||||
|
Further information |
||||
|
=================== |
||||
|
HTML Description: `<static/description/index.html>`__ |
@ -0,0 +1,23 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Fathima Mazlin AM (odoo@cybrosys.com) |
||||
|
# |
||||
|
# 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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from . import controllers |
||||
|
from . import models |
@ -0,0 +1,62 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Fathima Mazlin AM(odoo@cybrosys.com) |
||||
|
# |
||||
|
# 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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
{ |
||||
|
'name': 'Theme Coffee Shop', |
||||
|
'version': '15.0.1.0.0', |
||||
|
'category': 'Theme/Creative', |
||||
|
'summary': 'Theme Coffee Shop for Odoo Website e-Commerce', |
||||
|
'description': 'Theme Coffee Shop, A more appealing and practical theme ' |
||||
|
'for an e-Commerce Odoo website', |
||||
|
'author': 'Cybrosys Techno Solutions', |
||||
|
'company': 'Cybrosys Techno Solutions', |
||||
|
'maintainer': 'Cybrosys Techno Solutions', |
||||
|
'website': 'https://www.cybrosys.com', |
||||
|
'depends': ['website_sale_wishlist', 'auth_oauth'], |
||||
|
'data': [ |
||||
|
'data/menus_data.xml', |
||||
|
'views/header.xml', |
||||
|
'views/footer.xml', |
||||
|
'views/contact_us.xml', |
||||
|
'views/cart.xml', |
||||
|
'views/cart_lines.xml', |
||||
|
'views/cart_popover.xml', |
||||
|
'views/cart_summary.xml', |
||||
|
'views/payment_summary.xml', |
||||
|
'views/shop.xml', |
||||
|
'views/about_us.xml', |
||||
|
'views/feature.xml', |
||||
|
'views/menu_page.xml', |
||||
|
'views/product.xml', |
||||
|
], |
||||
|
'assets': { |
||||
|
'web.assets_frontend': [ |
||||
|
'theme_coffee_shop/static/src/css/style.css', |
||||
|
'theme_coffee_shop/static/src/js/action.js', |
||||
|
], |
||||
|
}, |
||||
|
'images': ['static/description/banner.png', |
||||
|
'static/description/theme_screenshot.jpeg'], |
||||
|
'license': 'LGPL-3', |
||||
|
'installable': True, |
||||
|
'auto_install': False, |
||||
|
'application': False |
||||
|
} |
@ -0,0 +1,22 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Fathima Mazlin AM (odoo@cybrosys.com) |
||||
|
# |
||||
|
# 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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from . import theme_coffee_shop |
@ -0,0 +1,371 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Fathima Mazlin AM (odoo@cybrosys.com) |
||||
|
# |
||||
|
# 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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from collections import defaultdict |
||||
|
from datetime import datetime |
||||
|
from itertools import product as cartesian_product |
||||
|
from werkzeug.exceptions import NotFound |
||||
|
from odoo import http, tools |
||||
|
from odoo.http import request |
||||
|
from odoo.osv import expression |
||||
|
from odoo.tools import lazy |
||||
|
from odoo.addons.http_routing.models.ir_http import slug |
||||
|
from odoo.addons.website.controllers.main import QueryURL |
||||
|
from odoo.addons.website.models.ir_http import sitemap_qs2dom |
||||
|
|
||||
|
|
||||
|
class TableComputeCoffee(object): |
||||
|
""" Compute data related to coffee shop theme """ |
||||
|
|
||||
|
def __init__(self): |
||||
|
""" The init for menu page""" |
||||
|
self.table = {} |
||||
|
|
||||
|
def _check_place(self, posx, posy, sizex, sizey, ppr): |
||||
|
"""Function for check place""" |
||||
|
res = True |
||||
|
for yaxix in range(sizey): |
||||
|
for xaxix in range(sizex): |
||||
|
if posx + xaxix >= ppr: |
||||
|
res = False |
||||
|
break |
||||
|
row = self.table.setdefault(posy + yaxix, {}) |
||||
|
if row.setdefault(posx + xaxix) is not None: |
||||
|
res = False |
||||
|
break |
||||
|
for x in range(ppr): |
||||
|
self.table[posy + yaxix].setdefault(xaxix, None) |
||||
|
return res |
||||
|
|
||||
|
def process(self, products, ppg=20, ppr=4): |
||||
|
"""Compute products positions on the grid""" |
||||
|
minpos = 0 |
||||
|
index = 0 |
||||
|
maxy = 0 |
||||
|
rec = 0 |
||||
|
for pdct in products: |
||||
|
rec = min(max(pdct.website_size_x, 1), ppr) |
||||
|
res = min(max(pdct.website_size_y, 1), ppr) |
||||
|
if index >= ppg: |
||||
|
rec = res = 1 |
||||
|
pos = minpos |
||||
|
while not self._check_place(pos % ppr, pos // ppr, rec, res, ppr): |
||||
|
pos += 1 |
||||
|
if index >= ppg and ((pos + 1.0) // ppr) > maxy: |
||||
|
break |
||||
|
if rec == 1 and res == 1: |
||||
|
minpos = pos // ppr |
||||
|
for y2 in range(res): |
||||
|
for x2 in range(rec): |
||||
|
self.table[(pos // ppr) + y2][(pos % ppr) + x2] = False |
||||
|
self.table[pos // ppr][pos % ppr] = { |
||||
|
'product': pdct, 'x': rec, 'y': res, |
||||
|
'ribbon': pdct._get_website_ribbon(), |
||||
|
} |
||||
|
if index <= ppg: |
||||
|
maxy = max(maxy, res + (pos // ppr)) |
||||
|
index += 1 |
||||
|
rows = sorted(self.table.items()) |
||||
|
rows = [r[1] for r in rows] |
||||
|
for col in range(len(rows)): |
||||
|
cols = sorted(rows[col].items()) |
||||
|
rec += len(cols) |
||||
|
rows[col] = [r[1] for r in cols if r[1]] |
||||
|
return rows |
||||
|
|
||||
|
|
||||
|
class ThemeCoffeeMenu(http.Controller): |
||||
|
""" Controller for rendering datas to menu page """ |
||||
|
|
||||
|
def _get_search_order(self, post): |
||||
|
""" OrderBy will be parsed in orm and so no direct sql injection id is |
||||
|
added to be sure that order is a unique sort key |
||||
|
""" |
||||
|
order = post.get('order') or 'website_sequence ASC' |
||||
|
return 'is_published desc, %s, id desc' % order |
||||
|
|
||||
|
def _get_search_domain(self, search, category, attrib_values, |
||||
|
search_in_description=True): |
||||
|
"""Function for getting search domain""" |
||||
|
domains = [request.website.sale_product_domain()] |
||||
|
if search: |
||||
|
for srch in search.split(" "): |
||||
|
subdomains = [ |
||||
|
[('name', 'ilike', srch)], |
||||
|
[('product_variant_ids.default_code', 'ilike', srch)] |
||||
|
] |
||||
|
if search_in_description: |
||||
|
subdomains.append([('website_description', 'ilike', srch)]) |
||||
|
subdomains.append([('description_sale', 'ilike', srch)]) |
||||
|
domains.append(expression.OR(subdomains)) |
||||
|
if category: |
||||
|
domains.append([('public_categ_ids', 'child_of', int(category))]) |
||||
|
if attrib_values: |
||||
|
attrib = None |
||||
|
ids = [] |
||||
|
for value in attrib_values: |
||||
|
if not attrib: |
||||
|
attrib = value[0] |
||||
|
ids.append(value[1]) |
||||
|
elif value[0] == attrib: |
||||
|
ids.append(value[1]) |
||||
|
else: |
||||
|
domains.append( |
||||
|
[('attribute_line_ids.value_ids', 'in', ids)]) |
||||
|
attrib = value[0] |
||||
|
ids = [value[1]] |
||||
|
if attrib: |
||||
|
domains.append([('attribute_line_ids.value_ids', 'in', ids)]) |
||||
|
return expression.AND(domains) |
||||
|
|
||||
|
def sitemap_shop(env, rule, qs): |
||||
|
"""Sitemap for shop""" |
||||
|
if not qs or qs.lower() in '/menu': |
||||
|
yield {'loc': '/menu'} |
||||
|
Category = env['product.public.category'] |
||||
|
dom = sitemap_qs2dom(qs, '/menu/category', Category._rec_name) |
||||
|
dom += env['website'].get_current_website().website_domain() |
||||
|
for cat in Category.search(dom): |
||||
|
loc = '/menu/category/%s' % slug(cat) |
||||
|
if not qs or qs.lower() in loc: |
||||
|
yield {'loc': loc} |
||||
|
|
||||
|
def _get_search_options( |
||||
|
self, category=None, attrib_values=None, pricelist=None, **post): |
||||
|
"""Function for returning search options""" |
||||
|
return { |
||||
|
'displayDescription': True, |
||||
|
'displayDetail': True, |
||||
|
'displayExtraDetail': True, |
||||
|
'displayExtraLink': True, |
||||
|
'displayImage': True, |
||||
|
'allowFuzzy': not post.get('noFuzzy'), |
||||
|
'category': str(category.id) if category else None, |
||||
|
'attrib_values': attrib_values, |
||||
|
'display_currency': pricelist.currency_id, |
||||
|
} |
||||
|
|
||||
|
def _shop_lookup_products(self, attrib_set, options, post, search, |
||||
|
website): |
||||
|
""" No limit because attributes are obtained from complete |
||||
|
product list""" |
||||
|
product_count, details, fuzzy_search_term = website._search_with_fuzzy( |
||||
|
"products_only", search, limit=None, |
||||
|
order=self._get_search_order(post), options=options |
||||
|
) |
||||
|
search_result = details[0].get( |
||||
|
'results', request.env['product.template'] |
||||
|
).with_context(bin_size=True) |
||||
|
if attrib_set: |
||||
|
attribute_values = request.env['product.attribute.value'].browse( |
||||
|
attrib_set) |
||||
|
values_per_attribute = defaultdict( |
||||
|
lambda: request.env['product.attribute.value']) |
||||
|
multi_value_attribute = False |
||||
|
for value in attribute_values: |
||||
|
values_per_attribute[value.attribute_id] |= value |
||||
|
if len(values_per_attribute[value.attribute_id]) > 1: |
||||
|
multi_value_attribute = True |
||||
|
|
||||
|
def filter_template(template, attribute_values_list): |
||||
|
"""Transform product.attribute.value to product. template. |
||||
|
attribute.value """ |
||||
|
attribute_value_to_ptav = dict() |
||||
|
for ptav in template.attribute_line_ids.product_template_value_ids: |
||||
|
attribute_value_to_ptav[ |
||||
|
ptav.product_attribute_value_id] = ptav.id |
||||
|
possible_combinations = False |
||||
|
for attribute_values in attribute_values_list: |
||||
|
ptavs = request.env[ |
||||
|
'product.template.attribute.value'].browse( |
||||
|
[attribute_value_to_ptav[val] |
||||
|
for val in attribute_values |
||||
|
if val in attribute_value_to_ptav] |
||||
|
) |
||||
|
if len(ptavs) < len(attribute_values): |
||||
|
continue |
||||
|
if len(ptavs) == len(template.attribute_line_ids): |
||||
|
if template._is_combination_possible(ptavs): |
||||
|
return True |
||||
|
elif len(ptavs) < len(template.attribute_line_ids): |
||||
|
if len(attribute_values_list) == 1: |
||||
|
if any(template._get_possible_combinations( |
||||
|
necessary_values=ptavs)): |
||||
|
return True |
||||
|
if not possible_combinations: |
||||
|
possible_combinations = template._get_possible_combinations() |
||||
|
if any(len(ptavs & combination) == len(ptavs) |
||||
|
for combination in possible_combinations): |
||||
|
return True |
||||
|
return False |
||||
|
|
||||
|
possible_attrib_values_list = ( |
||||
|
[attribute_values] |
||||
|
if not multi_value_attribute |
||||
|
else [ |
||||
|
request.env['product.attribute.value'].browse( |
||||
|
[v.id for v in values]) |
||||
|
for values in |
||||
|
cartesian_product(*values_per_attribute.values()) |
||||
|
] |
||||
|
) |
||||
|
search_result = search_result.filtered( |
||||
|
lambda tmpl: filter_template(tmpl, possible_attrib_values_list) |
||||
|
) |
||||
|
return fuzzy_search_term, product_count, search_result |
||||
|
|
||||
|
def _menu_get_query_url_kwargs(self, category, search, attrib=None, |
||||
|
order=None): |
||||
|
"""Function for returning category, search, order and attribute""" |
||||
|
return { |
||||
|
'category': category, |
||||
|
'search': search, |
||||
|
'attrib': attrib, |
||||
|
'order': order, |
||||
|
} |
||||
|
|
||||
|
def _get_additional_shop_values(self, values): |
||||
|
""" Hook to update values used for rendering |
||||
|
website_sale.products template """ |
||||
|
return {} |
||||
|
|
||||
|
@http.route([ |
||||
|
'/menu', |
||||
|
'/menu/page/<int:page>', |
||||
|
'/menu/category/<model("product.public.category"):category>', |
||||
|
'/menu/category/<model("product.public.category"):category>/page/<int:page>', |
||||
|
], type='http', auth="public", website=True, sitemap=sitemap_shop) |
||||
|
def menu_page(self, page=0, category=None, search='', |
||||
|
min_price=0.0, max_price=0.0, ppg=False, **post): |
||||
|
"""Get menu page """ |
||||
|
add_qty = int(post.get('add_qty', 1)) |
||||
|
Category = request.env['product.public.category'] |
||||
|
if category: |
||||
|
category = Category.search([('id', '=', int(category))], limit=1) |
||||
|
if not category or not category.can_access_from_current_website(): |
||||
|
raise NotFound() |
||||
|
else: |
||||
|
category = Category |
||||
|
website = request.env['website'].get_current_website() |
||||
|
if ppg: |
||||
|
try: |
||||
|
ppg = int(ppg) |
||||
|
post['ppg'] = ppg |
||||
|
except ValueError: |
||||
|
ppg = False |
||||
|
if not ppg: |
||||
|
ppg = website.shop_ppg or 20 |
||||
|
ppr = website.shop_ppr or 4 |
||||
|
attrib_list = request.httprequest.args.getlist('attrib') |
||||
|
attrib_values = [[int(x) for x in v.split("-")] |
||||
|
for v in attrib_list if v |
||||
|
] |
||||
|
attributes_ids = {v[0] for v in attrib_values} |
||||
|
attrib_set = {v[1] for v in attrib_values} |
||||
|
keep = QueryURL('/menu', **self._menu_get_query_url_kwargs( |
||||
|
category and int(category), search, min_price, max_price, **post)) |
||||
|
now = datetime.timestamp(datetime.now()) |
||||
|
pricelist = request.env['product.pricelist'].browse( |
||||
|
request.session.get('website_sale_current_pl')) |
||||
|
if not pricelist or request.session.get('website_sale_pricelist_time', |
||||
|
0) < now - 60 * 60: |
||||
|
pricelist = website.get_current_pricelist() |
||||
|
request.session['website_sale_pricelist_time'] = now |
||||
|
request.session['website_sale_current_pl'] = pricelist.id |
||||
|
request.context = dict(request.context, pricelist=pricelist.id, |
||||
|
partner=request.env.user.partner_id) |
||||
|
url = "/menu" |
||||
|
if search: |
||||
|
post["search"] = search |
||||
|
if attrib_list: |
||||
|
post['attrib'] = attrib_list |
||||
|
options = self._get_search_options( |
||||
|
category=category, |
||||
|
attrib_values=attrib_values, |
||||
|
pricelist=pricelist, |
||||
|
**post |
||||
|
) |
||||
|
fuzzy_search_term, product_count, search_product = \ |
||||
|
self._shop_lookup_products(attrib_set, options, post, |
||||
|
search, website) |
||||
|
website_domain = website.website_domain() |
||||
|
categs_domain = [('parent_id', '=', False)] + website_domain |
||||
|
if search: |
||||
|
search_categories = Category.search( |
||||
|
[( |
||||
|
'product_tmpl_ids', 'in', |
||||
|
search_product.ids)] + website_domain |
||||
|
).parents_and_self |
||||
|
categs_domain.append(('id', 'in', search_categories.ids)) |
||||
|
else: |
||||
|
search_categories = Category |
||||
|
categs = lazy(lambda: Category.search(categs_domain)) |
||||
|
if category: |
||||
|
url = "/menu/category/%s" % slug(category) |
||||
|
pager = website.pager(url=url, total=product_count, page=page, |
||||
|
step=ppg, scope=7, url_args=post) |
||||
|
offset = pager['offset'] |
||||
|
products = search_product[offset:offset + ppg] |
||||
|
ProductAttribute = request.env['product.attribute'] |
||||
|
if products: |
||||
|
attributes = lazy(lambda: ProductAttribute.search([ |
||||
|
('product_tmpl_ids', 'in', search_product.ids), |
||||
|
('visibility', '=', 'visible'), |
||||
|
])) |
||||
|
else: |
||||
|
attributes = lazy(lambda: ProductAttribute.browse(attributes_ids)) |
||||
|
layout_mode = request.session.get('website_sale_shop_layout_mode') |
||||
|
if not layout_mode: |
||||
|
if website.viewref('website_sale.products_list_view').active: |
||||
|
layout_mode = 'list' |
||||
|
else: |
||||
|
layout_mode = 'grid' |
||||
|
request.session['website_sale_shop_layout_mode'] = layout_mode |
||||
|
products_prices = lazy(lambda: products._get_sales_prices(pricelist)) |
||||
|
values = { |
||||
|
'order': post.get('order', ''), |
||||
|
'category': category, |
||||
|
'attrib_values': attrib_values, |
||||
|
'attrib_set': attrib_set, |
||||
|
'pager': pager, |
||||
|
'pricelist': pricelist, |
||||
|
'add_qty': add_qty, |
||||
|
'products': products, |
||||
|
'search_product': search_product, |
||||
|
'search_count': product_count, |
||||
|
'bins': lazy( |
||||
|
lambda: TableComputeCoffee().process(products, ppg, ppr)), |
||||
|
'ppg': ppg, |
||||
|
'ppr': ppr, |
||||
|
'categories': categs, |
||||
|
'attributes': attributes, |
||||
|
'keep': keep, |
||||
|
'search_categories_ids': search_categories.ids, |
||||
|
'products_prices': products_prices, |
||||
|
'get_product_prices': lambda product: lazy( |
||||
|
lambda: products_prices[product.id] |
||||
|
), |
||||
|
'float_round': tools.float_round, |
||||
|
} |
||||
|
if category: |
||||
|
values['main_object'] = category |
||||
|
values.update(self._get_additional_shop_values(values)) |
||||
|
return request.render("theme_coffee_shop.coffee_menu", values) |
@ -0,0 +1,26 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<odoo> |
||||
|
<data noupdate="1"> |
||||
|
<!-- Menu for about us--> |
||||
|
<record id="menu_about_us" model="website.menu"> |
||||
|
<field name="name">About us</field> |
||||
|
<field name="url">/about</field> |
||||
|
<field name="parent_id" ref="website.main_menu"/> |
||||
|
<field name="sequence" type="int">30</field> |
||||
|
</record> |
||||
|
<!-- Menu for features--> |
||||
|
<record id="menu_feature" model="website.menu"> |
||||
|
<field name="name">Features</field> |
||||
|
<field name="url">/feature</field> |
||||
|
<field name="parent_id" ref="website.main_menu"/> |
||||
|
<field name="sequence" type="int">35</field> |
||||
|
</record> |
||||
|
<!-- Menu for Menu --> |
||||
|
<record id="menu_menu" model="website.menu"> |
||||
|
<field name="name">Menu</field> |
||||
|
<field name="url">/menu</field> |
||||
|
<field name="parent_id" ref="website.main_menu"/> |
||||
|
<field name="sequence" type="int">15</field> |
||||
|
</record> |
||||
|
</data> |
||||
|
</odoo> |
@ -0,0 +1,7 @@ |
|||||
|
## Module <theme_coffee_shop> |
||||
|
|
||||
|
#### 23.11.2023 |
||||
|
#### Version 15.0.1.0.0 |
||||
|
#### ADD |
||||
|
|
||||
|
- Initial commit for Theme Coffee Shop |
@ -0,0 +1,22 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Fathima Mazlin AM (odoo@cybrosys.com) |
||||
|
# |
||||
|
# 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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from . import theme_utils |
@ -0,0 +1,37 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################# |
||||
|
# |
||||
|
# Cybrosys Technologies Pvt. Ltd. |
||||
|
# |
||||
|
# Copyright (C) 2023-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
||||
|
# Author: Fathima Mazlin AM (odoo@cybrosys.com) |
||||
|
# |
||||
|
# 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 <http://www.gnu.org/licenses/>. |
||||
|
# |
||||
|
############################################################################# |
||||
|
from odoo import api, models |
||||
|
|
||||
|
|
||||
|
class Theme(models.AbstractModel): |
||||
|
""" Class for enable and disable templates when using coffee shop theme """ |
||||
|
_inherit = 'theme.utils' |
||||
|
|
||||
|
@api.model |
||||
|
def _theme_coffee_shop_post_copy(self, mod): |
||||
|
""" Enable and disable templates when using coffee shop theme """ |
||||
|
self.enable_view("website_sale.products_categories") |
||||
|
self.enable_view("website_sale.products_description") |
||||
|
self.enable_view("website_sale.products_add_to_cart") |
||||
|
self.enable_view("website_sale.product_comment") |
||||
|
self.enable_view("website_sale.option_collapse_products_categories") |
||||
|
self.enable_view("website_sale.product_buy_now") |
After Width: | Height: | Size: 226 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 7.2 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 157 KiB |
After Width: | Height: | Size: 5.1 MiB |
After Width: | Height: | Size: 843 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 899 B |
After Width: | Height: | Size: 848 B |
After Width: | Height: | Size: 936 B |
After Width: | Height: | Size: 1001 B |
After Width: | Height: | Size: 9.5 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 3.9 KiB |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 990 KiB |
After Width: | Height: | Size: 930 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 165 KiB |
After Width: | Height: | Size: 1.7 MiB |
After Width: | Height: | Size: 269 KiB |
After Width: | Height: | Size: 195 KiB |
After Width: | Height: | Size: 950 KiB |
After Width: | Height: | Size: 570 KiB |
After Width: | Height: | Size: 107 KiB |
After Width: | Height: | Size: 245 KiB |
After Width: | Height: | Size: 328 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 39 KiB |
After Width: | Height: | Size: 890 KiB |
After Width: | Height: | Size: 84 KiB |
After Width: | Height: | Size: 283 KiB |
After Width: | Height: | Size: 993 KiB |
After Width: | Height: | Size: 928 KiB |
After Width: | Height: | Size: 940 KiB |
After Width: | Height: | Size: 553 KiB |
After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 975 KiB |
After Width: | Height: | Size: 969 KiB |
After Width: | Height: | Size: 924 KiB |
After Width: | Height: | Size: 735 KiB |
After Width: | Height: | Size: 576 KiB |
After Width: | Height: | Size: 954 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 953 KiB |
After Width: | Height: | Size: 972 KiB |
After Width: | Height: | Size: 86 KiB |
After Width: | Height: | Size: 809 KiB |
After Width: | Height: | Size: 922 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 168 KiB |
After Width: | Height: | Size: 251 KiB |
After Width: | Height: | Size: 269 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 714 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 5.6 KiB |
After Width: | Height: | Size: 6.6 KiB |
After Width: | Height: | Size: 524 B |
After Width: | Height: | Size: 795 B |
After Width: | Height: | Size: 61 KiB |
After Width: | Height: | Size: 343 KiB |
After Width: | Height: | Size: 5.6 MiB |
After Width: | Height: | Size: 39 KiB |
After Width: | Height: | Size: 1.7 MiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 3.5 MiB |
After Width: | Height: | Size: 312 B |
@ -0,0 +1,16 @@ |
|||||
|
odoo.define("theme_coffee_shop.theme_coffee_shop_template", function (require) { |
||||
|
"use strict"; |
||||
|
var publicWidget = require('web.public.widget'); |
||||
|
/** Public widget for login form **/ |
||||
|
publicWidget.registry.loginData = publicWidget.Widget.extend({ |
||||
|
selector: '.login-form-container', |
||||
|
events:{ |
||||
|
'click .login-close': '_loginPageToggle', |
||||
|
}, |
||||
|
/** Toggle the login page visibility **/ |
||||
|
_loginPageToggle: function(){ |
||||
|
this.el.classList.toggle('show'); |
||||
|
}, |
||||
|
}); |
||||
|
return publicWidget.registry.loginData; |
||||
|
}); |
@ -0,0 +1,30 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<odoo> |
||||
|
<!-- This XML defines a new page named "About" for the coffee shop theme --> |
||||
|
<record id="coffee_about_us" model="website.page"> |
||||
|
<field name="name">About</field> |
||||
|
<field name="type">qweb</field> |
||||
|
<field name="key">theme_coffee_shop.coffee_about_us</field> |
||||
|
<field name="url">/about</field> |
||||
|
<field name="is_published">True</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<t name="About" t-name="theme_coffee_shop.coffee_about_us"> |
||||
|
<t t-call="website.layout"> |
||||
|
<div id="wrap"> |
||||
|
<section id="banner" class="banner-imgAbout"> |
||||
|
<div class="container wrapper"> |
||||
|
<div class="banner-content"> |
||||
|
<div class="banner-text"> |
||||
|
<p class="banner-head">More than</p> |
||||
|
<p class="banner-head">Just Coffee</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</section> |
||||
|
<div class="oe_structure"/> |
||||
|
</div> |
||||
|
</t> |
||||
|
</t> |
||||
|
</field> |
||||
|
</record> |
||||
|
</odoo> |
@ -0,0 +1,205 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<odoo> |
||||
|
<!-- Templates for cart--> |
||||
|
<template id="boec_cart" name="Boec Cart" inherit_id="website_sale.cart"> |
||||
|
<xpath expr="//div[@id='wrap']" position="replace"> |
||||
|
<section id="banner" class="banner-imgcart"> |
||||
|
<div class="container wrapper "> |
||||
|
<div class="banner-content"> |
||||
|
<div class="banner-text"> |
||||
|
<p class="banner-head">Pick your</p> |
||||
|
<p class="banner-head">favourites</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</section> |
||||
|
<section id="my-cart" class="container wrapper" |
||||
|
style="padding-bottom: 20px"> |
||||
|
<span class="cart-heading">My Cart</span> |
||||
|
</section> |
||||
|
<div class="border"/> |
||||
|
<div class="container oe_website_sale py-2"> |
||||
|
<div class="row"> |
||||
|
<div class="col-12"> |
||||
|
<t t-call="website_sale.wizard_checkout"> |
||||
|
<t t-set="step" t-value="10"/> |
||||
|
</t> |
||||
|
</div> |
||||
|
<div class="col-12 col-xl-8 oe_cart"> |
||||
|
<div class="row"> |
||||
|
<div class="col-lg-12"> |
||||
|
<div t-if="abandoned_proceed or access_token" |
||||
|
class="mt8 mb8 alert alert-info" |
||||
|
role="alert"> <!-- abandoned cart choices --> |
||||
|
<t t-if="abandoned_proceed"> |
||||
|
<p>Your previous cart has already |
||||
|
been completed. |
||||
|
</p> |
||||
|
<p t-if="website_sale_order">Please |
||||
|
proceed your current cart. |
||||
|
</p> |
||||
|
</t> |
||||
|
<t t-if="access_token"> |
||||
|
<p>This is your current cart.</p> |
||||
|
<p> |
||||
|
<strong> |
||||
|
<a t-attf-href="/shop/cart/?access_token=#{access_token}&revive=squash"> |
||||
|
Click here |
||||
|
</a> |
||||
|
</strong> |
||||
|
if you want to restore your |
||||
|
previous cart. Your current cart |
||||
|
will be replaced with your |
||||
|
previous cart. |
||||
|
</p> |
||||
|
<p> |
||||
|
<strong> |
||||
|
<a t-attf-href="/shop/cart/?access_token=#{access_token}&revive=merge"> |
||||
|
Click here |
||||
|
</a> |
||||
|
</strong> |
||||
|
if you want to merge your |
||||
|
previous cart into current cart. |
||||
|
</p> |
||||
|
</t> |
||||
|
</div> |
||||
|
<t t-call="website_sale.cart_lines"/> |
||||
|
<div class="clearfix"/> |
||||
|
<!-- <a role="button" href="/shop"--> |
||||
|
<!-- class="btn btn-secondary mb32 d-none d-xl-inline-block">--> |
||||
|
<!-- <span class="fa fa-chevron-left"/>--> |
||||
|
<!-- <span class="">Continue Shopping</span>--> |
||||
|
<!-- </a>--> |
||||
|
<!-- <a role="button"--> |
||||
|
<!-- t-if="website_sale_order and website_sale_order.website_order_line"--> |
||||
|
<!-- class="btn btn-primary float-right d-none d-xl-inline-block"--> |
||||
|
<!-- href="/shop/checkout?express=1">--> |
||||
|
<!-- <span class="">Process Checkout</span>--> |
||||
|
<!-- <span class="fa fa-chevron-right"/>--> |
||||
|
<!-- </a>--> |
||||
|
<div class="oe_structure" |
||||
|
id="oe_structure_website_sale_cart_1"/> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<!-- <div class="border"/>--> |
||||
|
<section id="cart-sum" class="container wrapper"> |
||||
|
<div class="cart-left"> |
||||
|
<div class="continue-shopping"> |
||||
|
<a role="button" href="/shop"> |
||||
|
<img src="/theme_coffee_shop/static/src/images/Arrow 2.svg" |
||||
|
alt=""/> |
||||
|
</a> |
||||
|
<span class="conti-shop">Continue shopping |
||||
|
</span> |
||||
|
</div> |
||||
|
<div class="shop-details"> |
||||
|
<p>Congrats you’re eligible for free shipping |
||||
|
</p> |
||||
|
<p>100% Secure & Encrypt</p> |
||||
|
<img src="/theme_coffee_shop/static/src/images/payment-method_69e7ec.svg" |
||||
|
alt=""/> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="cart-right width_35"> |
||||
|
<t t-call="website_sale.short_cart_summary"/> |
||||
|
<div class="check-btn"> |
||||
|
<a role="button" href="/shop/checkout?express=1" |
||||
|
class="btn-ckeckout"> |
||||
|
Process Checkout |
||||
|
</a> |
||||
|
</div> |
||||
|
</div> |
||||
|
</section> |
||||
|
</div> |
||||
|
<!-- </div>--> |
||||
|
<div class="oe_structure" |
||||
|
id="oe_structure_website_sale_cart_2"/> |
||||
|
|
||||
|
|
||||
|
<!-- <section id="carts" class="container wrapper">--> |
||||
|
<!-- <div class="container oe_website_sale py-2">--> |
||||
|
<!-- <div class="row">--> |
||||
|
<!-- <div class="col-12 d-none">--> |
||||
|
<!-- <t t-call="website_sale.wizard_checkout">--> |
||||
|
<!-- <t t-set="step" t-value="10"/>--> |
||||
|
<!-- </t>--> |
||||
|
<!-- </div>--> |
||||
|
<!-- <div class=" oe_cart">--> |
||||
|
<!-- <div class="row">--> |
||||
|
<!-- <div class="col-lg-12">--> |
||||
|
<!-- <div t-if="abandoned_proceed or access_token"--> |
||||
|
<!-- class="mt8 mb8 alert alert-info"--> |
||||
|
<!-- role="alert"> <!– Abandoned cart choices –>--> |
||||
|
<!-- <t t-if="abandoned_proceed">--> |
||||
|
<!-- <p>Your previous cart has already--> |
||||
|
<!-- been completed.--> |
||||
|
<!-- </p>--> |
||||
|
<!-- <p t-if="website_sale_order">Please--> |
||||
|
<!-- proceed your current cart.--> |
||||
|
<!-- </p>--> |
||||
|
<!-- </t>--> |
||||
|
<!-- <t t-if="access_token">--> |
||||
|
<!-- <p>This is your current cart.</p>--> |
||||
|
<!-- <p>--> |
||||
|
<!-- <strong>--> |
||||
|
<!-- <a t-attf-href="/shop/cart/?access_token=#{access_token}&revive=squash">--> |
||||
|
<!-- Click here--> |
||||
|
<!-- </a>--> |
||||
|
<!-- </strong>--> |
||||
|
<!-- if you want to restore your--> |
||||
|
<!-- previous cart. Your current--> |
||||
|
<!-- cart--> |
||||
|
<!-- will be replaced with your--> |
||||
|
<!-- previous cart.--> |
||||
|
<!-- </p>--> |
||||
|
<!-- <p>--> |
||||
|
<!-- <strong>--> |
||||
|
<!-- <a t-attf-href="/shop/cart/?access_token=#{access_token}&revive=merge">--> |
||||
|
<!-- Click here--> |
||||
|
<!-- </a>--> |
||||
|
<!-- </strong>--> |
||||
|
<!-- if you want to merge your--> |
||||
|
<!-- previous cart into current--> |
||||
|
<!-- cart.--> |
||||
|
<!-- </p>--> |
||||
|
<!-- </t>--> |
||||
|
<!-- </div>--> |
||||
|
<!-- <t t-call="website_sale.cart_lines"/>--> |
||||
|
<!-- </div>--> |
||||
|
<!-- </div>--> |
||||
|
<!-- </div>--> |
||||
|
<!-- </div>--> |
||||
|
<!-- </div>--> |
||||
|
<!-- </section>--> |
||||
|
<!-- <div class="border"/>--> |
||||
|
<!-- <section id="cart-sum" class="container wrapper">--> |
||||
|
<!-- <div class="cart-left">--> |
||||
|
<!-- <div class="continue-shopping">--> |
||||
|
<!-- <a role="button" href="/shop">--> |
||||
|
<!-- <img src="/theme_coffee_shop/static/src/images/Arrow 2.svg"--> |
||||
|
<!-- alt=""/>--> |
||||
|
<!-- </a>--> |
||||
|
<!-- <span class="conti-shop">Continue shopping</span>--> |
||||
|
<!-- </div>--> |
||||
|
<!-- <div class="shop-details">--> |
||||
|
<!-- <p>Congrats you’re eligible for free shipping</p>--> |
||||
|
<!-- <p>100% Secure & Encrypt</p>--> |
||||
|
<!-- <img src="/theme_coffee_shop/static/src/images/payment-method_69e7ec.svg"--> |
||||
|
<!-- alt=""/>--> |
||||
|
<!-- </div>--> |
||||
|
<!-- </div>--> |
||||
|
<!-- <div class="cart-right width_35">--> |
||||
|
<!-- <t t-call="website_sale.short_cart_summary"/>--> |
||||
|
<!-- <div class="check-btn">--> |
||||
|
<!-- <a role="button" href="/shop/checkout?express=1"--> |
||||
|
<!-- class="btn-ckeckout">--> |
||||
|
<!-- Process Checkout--> |
||||
|
<!-- </a>--> |
||||
|
<!-- </div>--> |
||||
|
<!-- </div>--> |
||||
|
<!-- </section>--> |
||||
|
</xpath> |
||||
|
</template> |
||||
|
</odoo> |
@ -0,0 +1,157 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<odoo> |
||||
|
<!-- This XML template customizes the appearance and functionality of cart lines in the shopping cart page --> |
||||
|
<template id="coffee_cart_lines" inherit_id="website_sale.cart_lines" |
||||
|
name="Coffee Cart Lines"> |
||||
|
<xpath expr="//table[@id='cart_products']" position="replace"> |
||||
|
<table t-if="website_sale_order and website_sale_order.website_order_line" |
||||
|
class="mb16 table-striped table-sm js_cart_lines" |
||||
|
id="cart_products"> |
||||
|
<t t-set="show_qty" |
||||
|
t-value="is_view_active('website_sale.product_quantity')"/> |
||||
|
<thead> |
||||
|
<tr> |
||||
|
<th class="td-img">Product</th> |
||||
|
<th/> |
||||
|
<th class="text-center td-qty"> |
||||
|
<t t-if="show_qty"> |
||||
|
Quantity |
||||
|
</t> |
||||
|
</th> |
||||
|
<th class="text-center td-price">Price</th> |
||||
|
<th class="text-center td-price">Total</th> |
||||
|
<th class="text-center td-action"/> |
||||
|
</tr> |
||||
|
<tr class="height_30"/> |
||||
|
</thead> |
||||
|
<tbody> |
||||
|
<t t-foreach="website_sale_order.website_order_line" |
||||
|
t-as="line"> |
||||
|
<tr t-att-class="'optional_product info' if line.linked_line_id else None" |
||||
|
class="cstm_tbl"> |
||||
|
<td t-if="not line.product_id" colspan="2" |
||||
|
class='td-img cstm_tbl'/> |
||||
|
<t t-else=""> |
||||
|
<td align="center" |
||||
|
class='td-img cstm_tbl image_td'> |
||||
|
<span t-if="line._is_not_sellable_line() and line.product_id.image_128"> |
||||
|
<img t-att-src="image_data_uri(line.product_id.image_128)" |
||||
|
class="sample" |
||||
|
t-att-alt="line.name_short"/> |
||||
|
</span> |
||||
|
<span t-else="" |
||||
|
t-field="line.product_id.image_128" |
||||
|
t-options="{'widget': 'image', 'qweb_img_responsive': False, 'class': 'sample'}" |
||||
|
/> |
||||
|
</td> |
||||
|
<td class='td-product_name cstm_tbl'> |
||||
|
<div> |
||||
|
<t t-call="website_sale.cart_line_product_link"> |
||||
|
<p class="item-name"> |
||||
|
<strong t-field="line.name_short"/> |
||||
|
</p> |
||||
|
</t> |
||||
|
</div> |
||||
|
<p class="item-about"> |
||||
|
<t t-esc="line.product_id.categ_id.name"/> |
||||
|
</p> |
||||
|
<div class="product-indicate"> |
||||
|
<div class="indicate-content"/> |
||||
|
</div> |
||||
|
</td> |
||||
|
</t> |
||||
|
<td class="text-center td-qty cstm_tbl"> |
||||
|
<div class="css_quantity input-group mx-auto justify-content-center"> |
||||
|
<t t-if="not line._is_not_sellable_line()"> |
||||
|
<t t-if="show_qty"> |
||||
|
<div class="counter"> |
||||
|
<div class="box-container"> |
||||
|
<a t-attf-href="#" |
||||
|
class="btn btn-link js_add_cart_json d-none d-md-inline-block border_link" |
||||
|
aria-label="Remove one" |
||||
|
title="Remove one"> |
||||
|
<i class="fa fa-minus"/> |
||||
|
</a> |
||||
|
<input type="text" |
||||
|
class="js_quantity form-control quantity" |
||||
|
t-att-data-line-id="line.id" |
||||
|
t-att-data-product-id="line.product_id.id" |
||||
|
t-att-value="int(line.product_uom_qty) == line.product_uom_qty and int(line.product_uom_qty) or line.product_uom_qty"/> |
||||
|
<a |
||||
|
t-attf-href="#" |
||||
|
class="btn btn-link float_left js_add_cart_json d-none d-md-inline-block border_link" |
||||
|
aria-label="Add one" |
||||
|
title="Add one"> |
||||
|
<i class="fa fa-plus"/> |
||||
|
</a> |
||||
|
</div> |
||||
|
</div> |
||||
|
</t> |
||||
|
<t t-else=""> |
||||
|
<input type="hidden" |
||||
|
class="js_quantity form-control quantity" |
||||
|
t-att-data-line-id="line.id" |
||||
|
t-att-data-product-id="line.product_id.id" |
||||
|
t-att-value="int(line.product_uom_qty) == line.product_uom_qty and int(line.product_uom_qty) or line.product_uom_qty"/> |
||||
|
</t> |
||||
|
</t> |
||||
|
<t t-else=""> |
||||
|
<span class="text-muted w-100" |
||||
|
t-esc="int(line.product_uom_qty)"/> |
||||
|
<input type="hidden" |
||||
|
class="js_quantity form-control quantity" |
||||
|
t-att-data-line-id="line.id" |
||||
|
t-att-data-product-id="line.product_id.id" |
||||
|
t-att-value="line.product_uom_qty"/> |
||||
|
</t> |
||||
|
</div> |
||||
|
</td> |
||||
|
<td class="text-center td-price cstm_tbl" |
||||
|
name="price"> |
||||
|
<t groups="account.group_show_line_subtotals_tax_excluded"> |
||||
|
<span t-field="line.price_reduce_taxexcl" |
||||
|
class="text-nowrap" |
||||
|
t-options="{'widget': 'monetary', 'display_currency': website_sale_order.currency_id}"/> |
||||
|
</t> |
||||
|
<t groups="account.group_show_line_subtotals_tax_included"> |
||||
|
<span t-field="line.price_reduce_taxinc" |
||||
|
class="text-nowrap" |
||||
|
t-options="{'widget': 'monetary', 'display_currency': website_sale_order.currency_id}"/> |
||||
|
</t> |
||||
|
<t t-if="line.discount"> |
||||
|
<del t-attf-class="#{'text-danger mr8'} text-nowrap" |
||||
|
t-esc="line.price_unit" |
||||
|
t-options="{'widget': 'monetary', 'display_currency': website_sale_order.currency_id}"/> |
||||
|
</t> |
||||
|
<small t-if="not line._is_not_sellable_line() and line.product_id.base_unit_price" |
||||
|
class="cart_product_base_unit_price d-block text-muted" |
||||
|
groups="website_sale.group_show_uom_price"> |
||||
|
<t t-call='website_sale.base_unit_price'> |
||||
|
<t t-set='product' |
||||
|
t-value='line.product_id'/> |
||||
|
</t> |
||||
|
</small> |
||||
|
</td> |
||||
|
<td class="cstm_tbl" align="center"> |
||||
|
<t t-esc="website_sale_order.currency_id.symbol"/> |
||||
|
<t t-esc="line.price_subtotal"/> |
||||
|
</td> |
||||
|
<td class="td-action cstm_tbl"> |
||||
|
<a href='#' aria-label="Remove from cart" |
||||
|
title="Remove from cart" |
||||
|
class='js_delete_product no-decoration'> |
||||
|
<div class="col remove"> |
||||
|
<div class="close-circle"> |
||||
|
<i class="fa fa-times" |
||||
|
aria-hidden="false"/> |
||||
|
</div> |
||||
|
</div> |
||||
|
</a> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</t> |
||||
|
</tbody> |
||||
|
</table> |
||||
|
</xpath> |
||||
|
</template> |
||||
|
</odoo> |
@ -0,0 +1,49 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<odoo> |
||||
|
<!-- This XML template customizes the appearance and functionality of the cart popover in the website --> |
||||
|
<template id="coffee_cart_popover" inherit_id="website_sale.cart_popover" |
||||
|
name="Coffee Cart Popover"> |
||||
|
<xpath expr="." position="replace"> |
||||
|
<div> |
||||
|
<div class="items-cart"> |
||||
|
<t t-foreach="website_sale_order.website_order_line" |
||||
|
t-as="order_line"> |
||||
|
<div class="item"> |
||||
|
<div class="item-img"> |
||||
|
<img t-attf-src="data:image/png;base64,{{order_line.product_id.image_1920}}" |
||||
|
alt=""/> |
||||
|
</div> |
||||
|
<div class="item-desc"> |
||||
|
<p class="item-cartname"> |
||||
|
<t t-esc="order_line.product_id.name"/> |
||||
|
</p> |
||||
|
<p class="item-cartabout"> |
||||
|
<t t-esc="order_line.product_id.categ_id.name"/> |
||||
|
</p> |
||||
|
<p class="item-rate"> |
||||
|
<t t-esc="order_line.price_unit"/> |
||||
|
</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
</t> |
||||
|
</div> |
||||
|
<div class="cart-border"/> |
||||
|
<div class="row list-row cart-box-total"> |
||||
|
<p class="list">Subtotal:</p> |
||||
|
<p class="amount"> |
||||
|
<t t-esc="website_sale_order.amount_total"/> |
||||
|
</p> |
||||
|
</div> |
||||
|
<div class="cart-buttons"> |
||||
|
<a href="/shop/cart" |
||||
|
t-attf-class="nav-link"> |
||||
|
<button class="cartview">View Cart</button> |
||||
|
</a> |
||||
|
<a href="/shop/payment"> |
||||
|
<button class="cartcheckout">checkout</button> |
||||
|
</a> |
||||
|
</div> |
||||
|
</div> |
||||
|
</xpath> |
||||
|
</template> |
||||
|
</odoo> |
@ -0,0 +1,74 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<odoo> |
||||
|
<!-- This XML template customizes the appearance of the short cart summary in the website --> |
||||
|
<template id="coffee_short_cart_summary" |
||||
|
inherit_id="website_sale.short_cart_summary" |
||||
|
name="Coffee Cart Summary"> |
||||
|
<xpath expr="//div[hasclass('js_cart_summary')]" position="replace"> |
||||
|
<div class="cart-right" |
||||
|
t-if="website_sale_order and website_sale_order.website_order_line"> |
||||
|
<div> |
||||
|
<t t-call="website_sale.total"> |
||||
|
<t t-set="no_rowspan" t-value="1"/> |
||||
|
</t> |
||||
|
</div> |
||||
|
</div> |
||||
|
</xpath> |
||||
|
</template> |
||||
|
<!-- Cart total--> |
||||
|
<template id="coffee_shop_total" inherit_id="website_sale.total" |
||||
|
name="Coffee Total"> |
||||
|
<xpath expr="." position="replace"> |
||||
|
<div id="cart_total" t-att-class="extra_class or ''" |
||||
|
t-if="website_sale_order and website_sale_order.website_order_line"> |
||||
|
<table class="table mb-0"> |
||||
|
<tr id="order_total_untaxed"> |
||||
|
<td class="list border-0">Subtotal:</td> |
||||
|
<td class="amount text-xl-end border-0"> |
||||
|
<span t-field="website_sale_order.amount_untaxed" |
||||
|
class="monetary_field text-nowrap" |
||||
|
t-options="{'widget': 'monetary', 'display_currency': website_sale_order.currency_id}"/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr/> |
||||
|
<tr id="order_total_taxes"> |
||||
|
<td class="list border-0">Sales tax:</td> |
||||
|
<td class="amount text-xl-end border-0"> |
||||
|
<span t-field="website_sale_order.amount_tax" |
||||
|
class="monetary_field text-nowrap" |
||||
|
t-options="{'widget': 'monetary', 'display_currency': website_sale_order.currency_id}"/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr/> |
||||
|
<tr id="order_total"> |
||||
|
<td class="list border-bottom-0">Grand Total:</td> |
||||
|
<td class="amount text-xl-end border-bottom-0"> |
||||
|
<span t-field="website_sale_order.amount_total" |
||||
|
class="monetary_field" |
||||
|
t-options='{"widget": "monetary", "display_currency": website_sale_order.pricelist_id.currency_id}'/> |
||||
|
</td> |
||||
|
</tr> |
||||
|
<tr/> |
||||
|
<tr t-if="not hide_promotions"> |
||||
|
<td colspan="3" |
||||
|
class="text-center text-xl-right border-0"> |
||||
|
<span class=''> |
||||
|
<t t-set='force_coupon' |
||||
|
t-value="website_sale_order.pricelist_id.code or request.params.get('code_not_available')"/> |
||||
|
<t t-if="not force_coupon"> |
||||
|
<a href="#" class="show_coupon">I have a |
||||
|
promo |
||||
|
code |
||||
|
</a> |
||||
|
</t> |
||||
|
<div t-attf-class="coupon_form #{not force_coupon and 'd-none'}"> |
||||
|
<t t-call="website_sale.coupon_form"/> |
||||
|
</div> |
||||
|
</span> |
||||
|
</td> |
||||
|
</tr> |
||||
|
</table> |
||||
|
</div> |
||||
|
</xpath> |
||||
|
</template> |
||||
|
</odoo> |
@ -0,0 +1,219 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<odoo> |
||||
|
<!-- This XML template customizes the appearance of the Contact Us page in the website --> |
||||
|
<template id="coffee_shop_contact_us" name="Coffee Shop Contact Us" |
||||
|
inherit_id="website.contactus"> |
||||
|
<xpath expr="//div[@id='wrap']" position="replace"> |
||||
|
<section id="banner" class="banner-imgContact"> |
||||
|
<div class="container wrapper "> |
||||
|
<div class="banner-content"> |
||||
|
<div class="banner-text"> |
||||
|
<p class="banner-head">Hello!</p> |
||||
|
<p class="banner-head">Lets talk</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</section> |
||||
|
<section id="contact" class="container wrapper"> |
||||
|
<span class="contact-heading">Contact</span> |
||||
|
<div class="contact-container"> |
||||
|
<div class="get-intouch-left"> |
||||
|
<p class="getin-text">Get in Touch with Expresso</p> |
||||
|
<div class="getin-img"> |
||||
|
<img src="/theme_coffee_shop/static/src/images/coffee-contact.png" |
||||
|
alt=""/> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="get-intouch-right"> |
||||
|
<section class="s_website_form" |
||||
|
data-vcss="001" |
||||
|
data-snippet="s_website_form"> |
||||
|
<div class="container"> |
||||
|
<form id="contactus_form" |
||||
|
action="/website/form/" |
||||
|
method="post" |
||||
|
enctype="multipart/form-data" |
||||
|
class="o_mark_required" |
||||
|
data-mark="*" |
||||
|
data-model_name="mail.mail" |
||||
|
data-success-mode="redirect" |
||||
|
data-success-page="/contactus-thank-you" |
||||
|
data-pre-fill="true"> |
||||
|
<div class="s_website_form_rows row s_col_no_bgcolor"> |
||||
|
<div class="mb-0 py-2 col-12 s_website_form_field s_website_form_custom s_website_form_required" |
||||
|
data-type="char" |
||||
|
data-name="Field"> |
||||
|
<div class="row s_col_no_resize s_col_no_bgcolor"> |
||||
|
<label class="col-form-label width_200 col-sm-auto s_website_form_label" |
||||
|
for="contact1" style="width: 200px"> |
||||
|
<span class="s_website_form_label_content"> |
||||
|
Name |
||||
|
</span> |
||||
|
<span class="s_website_form_mark"> |
||||
|
* |
||||
|
</span> |
||||
|
</label> |
||||
|
<div class="col-sm"> |
||||
|
<input id="contact1" |
||||
|
type="text" |
||||
|
class="form-control s_website_form_input" |
||||
|
name="name" |
||||
|
required="" |
||||
|
data-fill-with="name"/> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group col-12 s_website_form_field s_website_form_custom" |
||||
|
data-type="char" data-name="Field"> |
||||
|
<div class="row s_col_no_resize s_col_no_bgcolor"> |
||||
|
<label class="col-form-label col-sm-auto s_website_form_label" |
||||
|
style="width: 200px" |
||||
|
for="contact2"> |
||||
|
<span class="s_website_form_label_content"> |
||||
|
Phone Number |
||||
|
</span> |
||||
|
</label> |
||||
|
<div class="col-sm"> |
||||
|
<input id="contact2" |
||||
|
type="tel" |
||||
|
class="form-control s_website_form_input" |
||||
|
name="phone" |
||||
|
data-fill-with="phone"/> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group col-12 s_website_form_field s_website_form_required s_website_form_model_required" |
||||
|
data-type="email" |
||||
|
data-name="Field"> |
||||
|
<div class="row s_col_no_resize s_col_no_bgcolor"> |
||||
|
<label class="col-form-label col-sm-auto s_website_form_label" |
||||
|
style="width: 200px" |
||||
|
for="contact3"> |
||||
|
<span class="s_website_form_label_content"> |
||||
|
Your Email |
||||
|
</span> |
||||
|
<span class="s_website_form_mark"> |
||||
|
* |
||||
|
</span> |
||||
|
</label> |
||||
|
<div class="col-sm"> |
||||
|
<input id="contact3" |
||||
|
type="email" |
||||
|
class="form-control s_website_form_input" |
||||
|
name="email_from" |
||||
|
required="" |
||||
|
data-fill-with="email"/> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group col-12 s_website_form_field s_website_form_custom" |
||||
|
data-type="char" data-name="Field"> |
||||
|
<div class="row s_col_no_resize s_col_no_bgcolor"> |
||||
|
<label class="col-form-label col-sm-auto s_website_form_label" |
||||
|
style="width: 200px" |
||||
|
for="contact4"> |
||||
|
<span class="s_website_form_label_content"> |
||||
|
Your Company |
||||
|
</span> |
||||
|
</label> |
||||
|
<div class="col-sm"> |
||||
|
<input id="contact4" |
||||
|
type="text" |
||||
|
class="form-control s_website_form_input" |
||||
|
name="company" |
||||
|
data-fill-with="commercial_company_name"/> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group col-12 s_website_form_field s_website_form_required s_website_form_model_required" |
||||
|
data-type="char" data-name="Field"> |
||||
|
<div class="row s_col_no_resize s_col_no_bgcolor"> |
||||
|
<label class="col-form-label col-sm-auto s_website_form_label" |
||||
|
style="width: 200px" |
||||
|
for="contact5"> |
||||
|
<span class="s_website_form_label_content"> |
||||
|
Subject |
||||
|
</span> |
||||
|
<span class="s_website_form_mark"> |
||||
|
* |
||||
|
</span> |
||||
|
</label> |
||||
|
<div class="col-sm"> |
||||
|
<input id="contact5" |
||||
|
type="text" |
||||
|
class="form-control s_website_form_input" |
||||
|
name="subject" |
||||
|
required=""/> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group col-12 s_website_form_field s_website_form_custom s_website_form_required" |
||||
|
data-type="text" data-name="Field"> |
||||
|
<div class="row s_col_no_resize s_col_no_bgcolor"> |
||||
|
<label class="col-form-label col-sm-auto s_website_form_label" |
||||
|
style="width: 200px" |
||||
|
for="contact6"> |
||||
|
<span class="s_website_form_label_content"> |
||||
|
Your Question |
||||
|
</span> |
||||
|
<span class="s_website_form_mark"> |
||||
|
* |
||||
|
</span> |
||||
|
</label> |
||||
|
<div class="col-sm"> |
||||
|
<textarea id="contact6" |
||||
|
class="form-control s_website_form_input" |
||||
|
name="description" |
||||
|
required=""/> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="form-group col-12 s_website_form_field s_website_form_dnone"> |
||||
|
<div class="row s_col_no_resize s_col_no_bgcolor"> |
||||
|
<label class="col-form-label col-sm-auto s_website_form_label" |
||||
|
style="width: 200px" |
||||
|
for="contact7"> |
||||
|
<span class="s_website_form_label_content"> |
||||
|
Email To |
||||
|
</span> |
||||
|
</label> |
||||
|
<div class="col-sm"> |
||||
|
<input id="contact7" |
||||
|
type="hidden" |
||||
|
class="form-control s_website_form_input" |
||||
|
name="email_to"/> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="getin-footer mb-0 py-2 col-12 s_website_form_submit" |
||||
|
data-name="Submit Button"> |
||||
|
<p class="getin-promise">*We |
||||
|
promise not to disclose your |
||||
|
personal |
||||
|
information to third parties. |
||||
|
</p> |
||||
|
<a class="send-btn btn btn-primary btn-lg s_website_form_send" |
||||
|
href="#" |
||||
|
role="button">Send |
||||
|
</a> |
||||
|
<span id="s_website_form_result"/> |
||||
|
</div> |
||||
|
</div> |
||||
|
</form> |
||||
|
</div> |
||||
|
</section> |
||||
|
</div> |
||||
|
</div> |
||||
|
</section> |
||||
|
<section id="map" class="container wrapper"> |
||||
|
<div class="map-container"> |
||||
|
<iframe title="Calicut" loading="lazy" width="100%" |
||||
|
height="350" id="gmap_canvas" |
||||
|
src="https://maps.google.com/maps?q=Cybrosys%20Technologies%20Pvt.%20Ltd.%20Neospace%2C%20Kinfra%20Techno%20Park%2C%20Kakkancherry&t=&z=7&ie=UTF8&iwloc=&output=embed" |
||||
|
frameborder="0" scrolling="no" marginheight="0" |
||||
|
marginwidth="0"/> |
||||
|
</div> |
||||
|
</section> |
||||
|
</xpath> |
||||
|
</template> |
||||
|
</odoo> |
@ -0,0 +1,36 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<odoo> |
||||
|
<!-- This XML record defines a custom QWeb view for the "Feature" section of the website --> |
||||
|
<record id="coffee_feature" model="ir.ui.view"> |
||||
|
<field name="name">Feature</field> |
||||
|
<field name="type">qweb</field> |
||||
|
<field name="key">theme_coffee_shop.coffee_feature</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<t name="Feature" t-name="theme_coffee_shop.feature"> |
||||
|
<t t-call="website.layout"> |
||||
|
<div id="wrap"> |
||||
|
<section id="banner" class="banner-imgFeature"> |
||||
|
<div class="container wrapper "> |
||||
|
<div class="banner-content"> |
||||
|
<div class="banner-text"> |
||||
|
<p class="banner-head">Our awesome</p> |
||||
|
<p class="banner-head">Premium |
||||
|
Features |
||||
|
</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</section> |
||||
|
<div class="oe_structure"/> |
||||
|
</div> |
||||
|
</t> |
||||
|
</t> |
||||
|
</field> |
||||
|
</record> |
||||
|
<record id="feature" model="website.page"> |
||||
|
<field name="is_published">True</field> |
||||
|
<field name="url">/feature</field> |
||||
|
<field name="view_id" ref="coffee_feature"/> |
||||
|
<field name="track">True</field> |
||||
|
</record> |
||||
|
</odoo> |