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-02 19:23:16 +00:00
<li class= "pull-right" > <a href= "/shop/my_cart" > <i class= "icon-shopping-cart icon-large" > </i> My cart</a> </li>
2013-07-01 16:12:47 +00:00
<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" >
2013-07-02 15:21:41 +00:00
<t t-call= "website_sale.categories_recursive" />
2013-07-02 09:41:38 +00:00
</t>
</ul>
</div>
<div class= "span8" >
<t t-raw= "shop_content" >
</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 ''" >
2013-07-02 20:48:49 +00:00
<a t-att-href= "'/shop/category/%%s' %% category.id" > <span t-record= "category" t-field= "name" > <t t-esc= "category.name" /> </span> </a>
2013-07-01 09:58:43 +00:00
<ul t-if= "category.child_id" class= "nav nav-list" >
<t t-foreach= "category.child_id" t-as= "category" >
2013-07-02 15:21:41 +00:00
<t t-call= "website_sale.categories_recursive" />
2013-07-01 09:58:43 +00:00
</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 20:48:49 +00:00
<t t-call= "website_sale.page" >
<t t-set= "title" > Product</t>
<t t-set= "shop_content" >
2013-07-10 15:03:39 +00:00
<div class= "oe_search" >
<form action= "/shop" method= "get" class= "navbar-search" >
<input type= "text" name= "search" class= "search-query span4" placeholder= "Search" t-att-value= "search or ''" />
<button type= "submit" class= "btn" > Submit</button>
</form>
</div>
2013-07-10 13:11:11 +00:00
<span class= "oe_products" >
<t t-foreach= "products" t-as= "product" >
<t t-set= "quantity" t-value= "([int(line.product_uom_qty) for line in (order.order_line or []) if line.product_id.id == product.id] + [0])[0]" />
<t t-call= "website_sale.product_card" />
</t>
</span>
2013-07-02 20:48:49 +00:00
</t>
</t>
2013-06-28 16:28:04 +00:00
</field>
</record>
2013-07-02 21:01:04 +00:00
<record id= "product_card" model= "ir.ui.view" >
2013-07-10 13:11:11 +00:00
<field name= "name" > product_card</field>
2013-07-02 21:01:04 +00:00
<field name= "type" > qweb</field>
<field name= "arch" type= "xml" >
<div class= "media oe_product" >
<a t-att-href= "'/shop/product/%%s' %% product.id" > <h4 class= "media-heading" > <span t-record= "product" t-field= "name" > <t t-esc= "product.name" /> </span> </h4> </a>
2013-07-10 13:11:11 +00:00
<a class= "pull-left" t-att-href= "'/shop/product/%%s' %% product.id" > <img class= "media-object" t-att-src= "'data:image/png;base64,' + product.image" /> </a>
2013-07-02 21:01:04 +00:00
<div class= "media-body" >
2013-07-10 13:11:11 +00:00
<div class= "oe_ecommerce_description" t-record= "product" t-field= "description_sale" > <t t-esc= "product.description_sale" /> </div>
<div class= "oe_ecommerce_price" > <span > <span t-record= "product" t-field= "list_price" > <t t-esc= "product.list_price" /> </span> €</span> </div>
2013-07-02 21:01:04 +00:00
<div class= "oe_button_cart" >
2013-07-10 13:11:11 +00:00
<button t-att-class= "'btn btn-inverse %%s' %% (not quantity and 'oe_hidden' or '')" t-att-data-id= "product.id" > <span > X</span> <i class= "icon-shopping-cart icon-large" > </i> </button>
2013-07-02 21:01:04 +00:00
<button t-att-class= "'btn %%s' %% (quantity and 'btn-success' or 'btn-primary')" t-att-data-id= "product.id" >
2013-07-10 13:11:11 +00:00
<i class= "icon-shopping-cart icon-large" > </i>
2013-07-02 21:01:04 +00:00
<span class= "oe_txt" > (<span class= "oe_quantity" > <t t-esc= "quantity" /> </span> )</span>
</button>
</div>
</div>
</div>
</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 15:21:41 +00:00
<t t-call= "website_sale.page" >
2013-07-02 09:41:38 +00:00
<t t-set= "title" > Product</t>
<t t-set= "shop_content" >
2013-07-02 16:46:19 +00:00
<div clas= "oe_commerce_product_display" >
2013-07-02 20:48:49 +00:00
<h1 > <span t-record= "product" t-field= "name" > <t t-esc= "product.name" /> </span> </h1>
<img class= "media-object" t-att-src= "'data:image/png;base64,' + product.image" />
<div t-record= "product" t-field= "description_sale" > <t t-esc= "product.description_sale" /> </div>
<div class= "oe_ecommerce_price" t-record= "product" t-field= "list_price" > <t t-esc= "product.list_price" /> €</div>
2013-07-02 16:46:19 +00:00
</div>
2013-07-02 09:41:38 +00:00
</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" >
2013-07-02 15:21:41 +00:00
<t t-call= "website_sale.page" >
2013-07-02 09:41:38 +00:00
<t t-set= "title" > My cart</t>
<t t-set= "shop_content" >
2013-07-10 13:11:11 +00:00
<span class= "oe_mycart" >
<t t-foreach= "order.order_line or []" 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= "website_sale.product_card" />
</t>
<t t-call= "website_sale.total" />
<a t-if= "order.order_line" href= "/shop/customer" > <button class= "btn btn-success" > Next stage</button> </a>
</span>
2013-07-02 09:41:38 +00:00
</t>
2013-06-28 16:28:04 +00:00
</t>
</field>
</record>
2013-07-02 12:06:25 +00:00
<!-- Total Shop my cart -->
<record id= "total" model= "ir.ui.view" >
<field name= "name" > total</field>
<field name= "type" > qweb</field>
<field name= "arch" type= "xml" >
<div class= "oe_total" >
2013-07-10 14:29:08 +00:00
<div class= "media well well-small" >
2013-07-02 13:29:40 +00:00
<table t-if= "order.order_line" >
2013-07-02 12:06:25 +00:00
<tr > <td > Untaxed Amount</td> <td > <t t-esc= "order.amount_untaxed" /> €</td> </tr>
<tr > <td > Taxes</td> <td > <t t-esc= "order.amount_tax" /> €</td> </tr>
<tr > <td > Total</td> <td > <h3 > <t t-esc= "order.amount_total" /> €</h3> </td> </tr>
</table>
2013-07-02 13:29:40 +00:00
<span t-if= "not order.order_line" > Your cart is empty</span>
2013-07-02 12:06:25 +00:00
</div>
</div>
</field>
</record>
2013-07-02 13:29:40 +00:00
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" >
2013-07-02 15:21:41 +00:00
<t t-call= "website_sale.page" >
2013-07-02 13:29:40 +00:00
<t t-set= "title" > Your informations</t>
2013-07-02 09:41:38 +00:00
<t t-set= "shop_content" >
2013-07-10 14:29:08 +00:00
<form action= "/shop/customer" class= "oe_signin" method= "post" t-if= "not partner" >
<h5 > Please Sign in or enter your informations</h5>
<input name= "login" type= "text" placeholder= "Login..." /> <br />
<input name= "password" type= "password" placeholder= "Password..." /> <br />
<button type= "submit" class= "btn btn-success" > Next stage</button> or <button type= "reset" class= "btn btn-primary oe_toggleform" > Complete your address</button>
</form>
<form action= "/shop/confirm_cart" class= "oe_signup" method= "post" t-att-style= "partner and 'display:block' or ''" >
<h5 t-if= "partner" > Please confirm your informations</h5>
<h5 t-if= "not partner" > Please enter your informations</h5>
<input name= "name" type= "text" required= "True" placeholder= "Name..." t-att-value= "partner and partner.name or ''" /> <br />
<input name= "phone" type= "tel"
required="True" placeholder="Phone number..." t-att-value="partner and partner.phone or ''"/>
2013-07-02 12:06:25 +00:00
<input name= "email" type= "email" required= "True" placeholder= "Email..." t-att-value= "partner and partner.email or ''" />
2013-07-10 14:29:08 +00:00
<h5 t-if= "partner" > Please confirm your address</h5>
<h5 t-if= "not partner" > Please enter your address</h5>
2013-07-02 12:06:25 +00:00
<address >
2013-07-10 14:29:08 +00:00
<input name= "street" type= "text" required= "True" placeholder= "Street..." t-att-value= "partner and partner.street or ''" /> <br />
<input name= "street2" type= "text" placeholder= "Street..." t-att-value= "partner and partner.street2 or ''" /> <br />
<input name= "zip" type= "text" required= "True" placeholder= "Zip-code..." t-att-value= "partner and partner.zip or ''" />
<input name= "city" type= "text" required= "True" placeholder= "City..." t-att-value= "partner and partner.city or ''" /> <br />
<input name= "country" type= "text" required= "True" placeholder= "Country..." t-att-value= "partner and partner.country_id and partner.country_id.name_get()[0][1] or ''" />
<input name= "state" type= "text" placeholder= "State..." t-att-value= "partner and partner.state_id and partner.state_id.name_get()[0][1] or ''" />
2013-07-02 12:06:25 +00:00
</address>
2013-07-10 14:29:08 +00:00
<button type= "submit" class= "btn btn-success" > Next stage</button> <t t-if= "not partner" > or <button type= "reset" class= "btn btn-primary oe_toggleform" > Sign in</button> </t>
2013-07-02 09:41:38 +00:00
</form>
2013-07-10 14:29:08 +00:00
<t t-call= "website_sale.total" />
2013-07-02 09:41:38 +00:00
</t>
</t>
</field>
</record>
2013-07-02 13:29:40 +00:00
<record id= "order" model= "ir.ui.view" >
<field name= "name" > order</field>
<field name= "type" > qweb</field>
<field name= "arch" type= "xml" >
2013-07-02 15:21:41 +00:00
<t t-call= "website_sale.page" >
2013-07-02 13:29:40 +00:00
<t t-set= "title" > Order</t>
<t t-set= "shop_content" >
<t t-foreach= "order.order_line or []" t-as= "line" >
<t t-set= "product" t-value= "line.product_id" />
<t t-set= "quantity" t-value= "int(line.product_uom_qty)" />
<div class= "media oe_product" >
<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" >
<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>
</div>
</div>
</t>
<div class= "media well" >
<t t-esc= "partner.name" /> <br />
<t t-esc= "partner.phone" /> <br />
<t t-esc= "partner.email" /> <br />
<address >
<t t-esc= "partner.street" /> <br />
<t t-esc= "partner.zip" /> ,
<t t-esc= "partner.city" /> <br />
<t t-esc= "partner.country_id and partner.country_id.name_get()[0][1] or ''" /> ,
<t t-esc= "partner.state_id and partner.state_id.name_get()[0][1] or ''" /> <br />
</address>
</div>
2013-07-02 15:21:41 +00:00
<t t-call= "website_sale.total" />
2013-07-02 13:29:40 +00:00
<a t-if= "order.order_line" href= "/shop/confirm_order" > <button class= "btn btn-success" > Confirm order</button> </a>
</t>
</t>
</field>
</record>
<record id= "thanks" model= "ir.ui.view" >
<field name= "name" > thanks</field>
<field name= "type" > qweb</field>
<field name= "arch" type= "xml" >
2013-07-02 15:21:41 +00:00
<t t-call= "website_sale.page" >
2013-07-02 13:29:40 +00:00
<t t-set= "title" > Order</t>
<t t-set= "shop_content" >
Thanks for your sale order
</t>
</t>
</field>
</record>
2013-06-28 16:28:04 +00:00
</data>
2013-07-01 00:20:54 +00:00
</openerp>