2013-06-28 16:28:04 +00:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
<openerp>
|
|
|
|
<data>
|
2013-07-01 00:20:54 +00:00
|
|
|
<!-- Layout add nav and footer -->
|
|
|
|
|
|
|
|
<record id="layout_ecommerce" model="ir.ui.view">
|
|
|
|
<field name="name">layout_ecommerce</field>
|
|
|
|
<field name="inherit_id" ref="website.layout"/>
|
|
|
|
<field name="arch" type="xml">
|
|
|
|
<data>
|
|
|
|
<xpath expr="(//header//li)[last()]" position="after">
|
2013-07-01 16:12:47 +00:00
|
|
|
<li class="pull-right"><a href="/shop/my_cart">My cart</a></li>
|
|
|
|
<li class="pull-right"><a href="/shop">Shop</a></li>
|
2013-07-01 00:20:54 +00:00
|
|
|
</xpath>
|
|
|
|
<xpath expr="//footer/div/div/div[3]" position="inside">
|
|
|
|
SHOP Footer
|
|
|
|
</xpath>
|
|
|
|
</data>
|
|
|
|
</field>
|
|
|
|
</record>
|
|
|
|
|
2013-07-02 09:41:38 +00:00
|
|
|
<!-- Page Shop -->
|
2013-06-28 16:28:04 +00:00
|
|
|
|
2013-07-02 09:41:38 +00:00
|
|
|
<record id="page" model="ir.ui.view">
|
|
|
|
<field name="name">page</field>
|
2013-07-01 09:58:43 +00:00
|
|
|
<field name="type">qweb</field>
|
2013-06-28 16:28:04 +00:00
|
|
|
<field name="arch" type="xml">
|
2013-07-02 09:41:38 +00:00
|
|
|
<t t-call="website.layout">
|
|
|
|
<t t-set="title">Shop - <t t-raw="title">Categories</t></t>
|
|
|
|
<div class="container oe_ecommerce">
|
|
|
|
<div class="row">
|
|
|
|
<div class="span4">
|
|
|
|
<ul class="nav nav-list">
|
|
|
|
<t t-foreach="categories" t-as="category">
|
|
|
|
<t t-call="ecommerce.categories_recursive"/>
|
|
|
|
</t>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<div class="span8">
|
|
|
|
<t t-raw="shop_content">
|
|
|
|
<t t-foreach="products" t-as="product">
|
|
|
|
<t t-set="quantity" t-value="product.id in cart and cart[product.id]['quantity'] or 0"/>
|
|
|
|
<t t-call="ecommerce.products"/>
|
|
|
|
</t>
|
|
|
|
</t>
|
|
|
|
</div>
|
2013-07-01 16:12:47 +00:00
|
|
|
</div>
|
2013-07-01 09:58:43 +00:00
|
|
|
</div>
|
2013-07-02 09:41:38 +00:00
|
|
|
</t>
|
2013-06-28 16:28:04 +00:00
|
|
|
</field>
|
|
|
|
</record>
|
|
|
|
|
2013-07-01 09:58:43 +00:00
|
|
|
<!-- List of categories -->
|
2013-06-28 16:28:04 +00:00
|
|
|
|
2013-07-01 09:58:43 +00:00
|
|
|
<record id="categories_recursive" model="ir.ui.view">
|
|
|
|
<field name="name">categories_recursive</field>
|
|
|
|
<field name="type">qweb</field>
|
2013-06-28 16:28:04 +00:00
|
|
|
<field name="arch" type="xml">
|
2013-07-01 09:58:43 +00:00
|
|
|
<li t-att-class="category.id == current_category and 'active' or ''">
|
|
|
|
<a t-att-href="'/shop/category/%%s' %% category.id"><t t-esc="category.name"/></a>
|
|
|
|
<ul t-if="category.child_id" class="nav nav-list">
|
|
|
|
<t t-foreach="category.child_id" t-as="category">
|
|
|
|
<t t-call="ecommerce.categories_recursive"/>
|
|
|
|
</t>
|
|
|
|
</ul>
|
|
|
|
</li>
|
2013-06-28 16:28:04 +00:00
|
|
|
</field>
|
|
|
|
</record>
|
|
|
|
|
2013-07-02 09:41:38 +00:00
|
|
|
<!-- Product list -->
|
|
|
|
|
|
|
|
<record id="products" model="ir.ui.view">
|
|
|
|
<field name="name">products</field>
|
2013-07-01 09:58:43 +00:00
|
|
|
<field name="type">qweb</field>
|
2013-06-28 16:28:04 +00:00
|
|
|
<field name="arch" type="xml">
|
2013-07-02 09:41:38 +00:00
|
|
|
<div class="media">
|
|
|
|
<div class="pull-left" style="width:64px; height:64px;">
|
|
|
|
<img style="max-width:64px; max-height:64px; margin:auto;" class="media-object" t-att-src="'data:image/png;base64,' + product.image"/>
|
|
|
|
</div>
|
|
|
|
<div class="media-body">
|
|
|
|
<div class="oe_button_cart">
|
|
|
|
<button t-if="my_cart" t-att-class="'btn btn-inverse %%s' %% (not quantity and 'oe_hidden' or '')" t-att-data-id="product.id">Remove one</button>
|
|
|
|
<button t-att-class="'btn %%s' %% (quantity and 'btn-success' or 'btn-primary')" t-att-data-id="product.id">
|
|
|
|
<span class="oe_txt_empty">Add to cart</span>
|
|
|
|
<span class="oe_txt">Add one (<span class="oe_quantity"><t t-esc="quantity"/></span> in my cart)</span>
|
|
|
|
</button>
|
2013-07-01 09:58:43 +00:00
|
|
|
</div>
|
2013-07-02 09:41:38 +00:00
|
|
|
<a t-att-href="'/shop/product/%%s' %% product.id"><h4 class="media-heading"><t t-esc="product.name"/></h4></a>
|
|
|
|
<t t-esc="product.description_sale"/>
|
|
|
|
<div><t t-esc="product.list_price"/> €</div>
|
2013-07-01 09:58:43 +00:00
|
|
|
</div>
|
2013-07-02 09:41:38 +00:00
|
|
|
</div>
|
2013-06-28 16:28:04 +00:00
|
|
|
</field>
|
|
|
|
</record>
|
|
|
|
|
2013-07-01 16:12:47 +00:00
|
|
|
<!-- product -->
|
|
|
|
|
2013-07-01 09:58:43 +00:00
|
|
|
<record id="product" model="ir.ui.view">
|
|
|
|
<field name="name">product</field>
|
|
|
|
<field name="type">qweb</field>
|
2013-06-28 16:28:04 +00:00
|
|
|
<field name="arch" type="xml">
|
2013-07-02 09:41:38 +00:00
|
|
|
<t t-call="ecommerce.page">
|
|
|
|
<t t-set="title">Product</t>
|
|
|
|
<t t-set="shop_content">
|
|
|
|
<h1><t t-esc="product.name"/></h1>
|
|
|
|
<img style="max-width:128px; max-height:128px;" t-att-src="'data:image/png;base64,' + product.image"/>
|
|
|
|
<t t-esc="product.description_sale"/>
|
|
|
|
<div><t t-esc="product.list_price"/> €</div>
|
|
|
|
<h1>Giga poulet !</h1>
|
|
|
|
</t>
|
|
|
|
</t>
|
|
|
|
</field>
|
|
|
|
</record>
|
|
|
|
|
|
|
|
<!-- Page Shop my cart -->
|
|
|
|
|
|
|
|
<record id="my_cart" model="ir.ui.view">
|
|
|
|
<field name="name">my_cart</field>
|
|
|
|
<field name="type">qweb</field>
|
|
|
|
<field name="arch" type="xml">
|
|
|
|
<t t-call="ecommerce.page">
|
|
|
|
<t t-set="title">My cart</t>
|
|
|
|
<t t-set="shop_content">
|
|
|
|
<t t-foreach="order.order_line" t-as="line">
|
|
|
|
<t t-set="product" t-value="line.product_id"/>
|
|
|
|
<t t-set="quantity" t-value="int(line.product_uom_qty)"/>
|
|
|
|
<t t-call="ecommerce.products"/>
|
|
|
|
</t>
|
|
|
|
<div class="media well">
|
|
|
|
<h1>
|
|
|
|
<a href="/shop/customer"><button class="btn btn-success">Confirm my order</button></a>
|
|
|
|
Total: <span class="oe_total"><t t-esc="order.amount_total"/> €</span>
|
|
|
|
</h1>
|
2013-07-01 09:58:43 +00:00
|
|
|
</div>
|
2013-07-02 09:41:38 +00:00
|
|
|
</t>
|
2013-06-28 16:28:04 +00:00
|
|
|
</t>
|
|
|
|
</field>
|
|
|
|
</record>
|
|
|
|
|
2013-07-02 09:41:38 +00:00
|
|
|
<!-- Page confirm my cart -->
|
|
|
|
|
|
|
|
<record id="customer" model="ir.ui.view">
|
|
|
|
<field name="name">customer</field>
|
|
|
|
<field name="type">qweb</field>
|
|
|
|
<field name="arch" type="xml">
|
|
|
|
<t t-call="ecommerce.page">
|
|
|
|
<t t-set="title">Your information</t>
|
|
|
|
<t t-set="shop_content">
|
|
|
|
<form action="/shop/confirm_cart">
|
|
|
|
<input name="name"/>
|
|
|
|
<input name="firstname"/>
|
|
|
|
<button class="btn btn-success">Next</button>
|
|
|
|
</form>
|
|
|
|
</t>
|
|
|
|
</t>
|
|
|
|
</field>
|
|
|
|
</record>
|
2013-06-28 16:28:04 +00:00
|
|
|
</data>
|
2013-07-01 00:20:54 +00:00
|
|
|
</openerp>
|