[IMP] /shop page variants (Total 3 Variants !!)

- (Default) Default one with products listing
- (Option1) Categorized Shop Page with all listing of products category
- (Option2) Blank Shop Page with no content! User can design their own /shop page

User can easily choose any one option for /shop page from `Customize` menu at a time.
This commit is contained in:
Siddharth Bhalgami 2018-02-08 16:32:24 +05:30
parent a5fa03a1be
commit 2b42b1b300
3 changed files with 97 additions and 1 deletions

View File

@ -316,7 +316,7 @@ class WebsiteSale(http.Controller):
}
if category:
values['main_object'] = category
return request.render("website_sale.products", values)
return request.render("website_sale.main_shop_page", values)
@http.route(['/shop/product/<model("product.template"):product>'], type='http', auth="public", website=True)
def product(self, product, category='', search='', **kwargs):

View File

@ -45,3 +45,29 @@
color: #666666 !important;
}
/* share Option end */
/* Categorized Shop Page START */
.main-categ{
display: block;
background: #e7e7e7;
padding: 5px;
margin-bottom: 5px;
font-weight: bold;
font-size: 16px;
color: @brand-primary;
&:hover {
text-decoration: none;
}
}
.child-categ {
padding: 7px 15px;
a {
text-decoration: underline;
color: #444;
&:hover {
color: @brand-primary;
}
}
}
/* Categorized Shop Page END */

View File

@ -184,6 +184,11 @@
</div>
</template>
<!-- /shop Main Template -->
<template id="main_shop_page" name="Shop Page Variants (Use Any One)">
<t t-call="website_sale.products"/>
</template>
<!-- /shop product listing -->
<template id="products" name="Products">
<t t-call="website.layout">
@ -229,6 +234,71 @@
</t>
</template>
<!-- /shop blank page (design your own shop page) -->
<template id="blank_shop_page" inherit_id="website_sale.main_shop_page"
name="Blank Shop Page" active="False" customize_show="True">
<xpath expr="//t[@t-call='website_sale.products']" position="replace">
<t t-if="category">
<t t-call="website_sale.products"/>
</t>
<t t-else="">
<t t-call="website.layout">
<t t-set="additional_title">Shop</t>
<div id="wrap" class="oe_structure oe_empty"/>
</t>
</t>
</xpath>
</template>
<!-- /shop category listing,
Supported to level-1 (Main Category & Child Category) -->
<template id="categorized_shop_page" inherit_id="website_sale.main_shop_page"
name="Categorized Shop Page" active="False" customize_show="True">
<xpath expr="//t[@t-call='website_sale.products']" position="replace">
<t t-if="category">
<t t-call="website_sale.products"/>
</t>
<t t-else="">
<t t-call="website.layout">
<t t-set="additional_title">Shop</t>
<div id="wrap">
<div class="oe_structure" />
<div class="container mt32 mb32 s_product_categories">
<div class="col-md-12" id="filter-cm">
<t t-foreach="categories" t-as="c">
<t t-call="website_sale.categories_recursive_snippet"/>
</t>
</div>
</div>
<div class="oe_structure" />
</div>
</t>
</t>
</xpath>
</template>
<!-- /shop category listing: Parent Category -->
<template id="categories_recursive_snippet" name="Category list">
<div class="col-md-6 mb16" t-if="website in c.website_ids or not c.website_ids">
<a t-att-href="keep('/shop/category/' + slug(c), category=0)" class="main-categ">
<span t-field="c.name"/>
<i class="fa fa-caret-right"/>
</a>
<div t-if="c.child_id">
<t t-foreach="c.child_id" t-as="c">
<t t-call="website_sale.categories_recursive_snippet_child"/>
</t>
</div>
</div>
</template>
<!-- /shop category listing: Child Category -->
<template id="categories_recursive_snippet_child" name="Category list">
<div class="col-md-6 child-categ" t-if="website in c.website_ids or not c.website_ids">
<a t-att-href="keep('/shop/category/' + slug(c), category=0)" t-field="c.name"/>
</div>
</template>
<template id="sort" inherit_id="website_sale.products" active="True" customize_show="True" name="Show Sort by">
<xpath expr="//div[hasclass('products_pager')]/div/t[@t-call][last()]" position="after">
<t t-set="new_arrivals_label">New Arrivals</t>