odoo/addons/website_sale/views/website_sale.xml

463 lines
25 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record model="ir.ui.view" id="product_pricelist_view">
<field name="name">product.pricelist.website.form</field>
<field name="model">product.pricelist</field>
<field name="inherit_id" ref="product.product_pricelist_view"/>
<field name="arch" type="xml">
<field name="active" position="after">
<field name="code"/>
</field>
</field>
</record>
<!-- Layout add nav and footer -->
<template id="footer_custom" inherit_id="website.layout" name="Custom Footer">
<xpath expr="//body/header//ul[@id='top_menu']/li" position="before">
<li><a href="/shop/">Shop</a></li>
<li>
<a href="/shop/mycart/">
<i class="icon-shopping-cart"></i>
My cart
<t t-if="order.get_total_quantity()">
<span class="badge badge-success" t-esc="order.get_total_quantity()"/>
</t>
</a>
</li>
</xpath>
</template>
<record id="product_normal_form_view" model="ir.ui.view">
<field name="name">product.normal.form.inherit</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="stock.view_normal_procurement_locations_form"/>
<field name="arch" type="xml">
<group name="sale" position="before">
<group name="pos" string="Website">
<field name="website_published"/>
</group>
</group>
</field>
</record>
<!-- Page Shop -->
<template id="layout" name="Products Layout">
<t t-call="website.layout">
<t t-set="head">
<script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
<t t-raw="head or ''"/>
</t>
<t t-set="title">Shop - <t t-raw="title">Categories</t></t>
<div class="container mt48 oe_website_sale">
<div class="row">
<div class="span12" id="shop_content">
<t t-raw="shop_content" />
</div>
</div>
</div>
</t>
</template>
<template id="products_categories" inherit_id="website_sale.layout" inherit_option_id="website_sale.layout" name="Products Left Categories">
<xpath expr="//div[@id='shop_content']" position="before">
<div class="span4">
<ul class="nav nav-list">
<li t-att-class=" '' if current_category else 'active' " class='active'><a href="/shop/">All Products</a></li>
<t t-foreach="categories" t-as="category">
<t t-call="website_sale.categories_recursive"/>
</t>
</ul>
</div>
</xpath>
<xpath expr="//div[@id='shop_content']" position="attributes">
<attribute name="class">span8</attribute>
</xpath>
</template>
<!-- List of categories -->
<template id="categories_recursive">
<li t-att-class="category.id == current_category and 'active' or ''">
<a t-attf-href="/shop/category/#{ category.id }/" t-field="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="website_sale.categories_recursive"/>
</t>
</ul>
</li>
</template>
<!-- Product list -->
<template id="products">
<t t-call="website_sale.layout">
<t t-set="title">Product</t>
<t t-set="shop_content">
<div class='navbar navbar-inverse'>
<div class='navbar-inner'>
<t t-call="website.pager" >
<t t-set="classname">pull-left</t>
</t>
<form action="/shop/" method="get" class="navbar-search pull-right pagination">
<input type="text" name="search" class="search-query span2" placeholder="Search" t-att-value="search or '' or ''"/>
</form>
</div>
</div>
<div class='row grid grid-align-top'>
<div t-foreach="products" t-as="product" class="span2 mb16 thumbnail text-center">
<a t-attf-href="/shop/product/#{ product.id }/ ">
<h5 t-field="product.name"> </h5>
</a>
<a t-attf-href="/shop/product/#{ product.id }/">
<img class="img-rounded" t-att-src="product.img('image_small')"/>
</a>
<div>
<div t-field="product.description_sale"></div>
<div><span t-field="product.list_price"></span></div>
<div class="mb8 mt8">
<a t-attf-href="./add_cart/#{ product.id }/" class="btn btn-small btn-success">Add to cart</a>
</div>
</div>
</div>
</div>
<div class="text-center">
<t t-call="website.pager" />
</div>
</t>
</t>
</template>
<!-- product -->
<template id="product" name="Product">
<t t-call="website_sale.layout">
<t t-set="title">Product</t>
<t t-set="shop_content">
<div id="product_detail">
<t t-call="website.publish"><t t-set="object" t-value="product"/></t>
<h2 t-field="product.name"></h2>
<a t-attf-href="./add_cart/#{ product.id }/" class="btn btn-small btn-success pull-right">Add to cart</a>
<img class="media-object" t-att-src="product.img('image')"/>
<div t-field="product.description_website"></div>
<div><t t-field="product.list_price" /></div>
</div>
</t>
</t>
</template>
<template id="recommended_products" inherit_id="website_sale.product" inherit_option_id="website_sale.product" name="Recommended Products">
<xpath expr="//div[@id='product_detail']" position="inside">
<div class="well mt32" t-if="product.recommended_products()">
<h4>Customers who have bought this item also bought</h4>
<div class='row mt16'>
<t t-foreach="product.recommended_products()" t-as="product">
<div class='span2 thumbnail'>
<a t-attf-href="/shop/product/#{ product.id }/">
<div class='mt16 text-center'>
<img t-att-src="product.img('image_small')"/>
<h5 t-field='product.name'></h5>
</div>
</a>
</div>
</t>
</div>
</div>
</xpath>
</template>
<!-- Page Shop my cart -->
<template id="mycart">
<t t-call="website_sale.layout">
<t t-set="title">My cart</t>
<t t-set="shop_content">
<div class="span8 oe_mycart">
<h2>My Shopping Cart</h2>
<table class='table table-hover'>
<thead>
<tr>
<th width="80">Product</th>
<th></th>
<th width="80">Price</th>
<th width="150">Quantity</th>
</tr>
</thead>
<tbody t-if="not order.order_line">
<tr><td colspan="4"><h3>Your cart is empty</h3></td></tr>
</tbody>
<tbody t-if="order.order_line">
<t t-foreach="order.order_line" t-as="line">
<tr>
<td>
<a t-attf-href="/shop/product/#{ line.product_id.id }/"><img class="img-rounded" t-att-src="line.product_id.img('image_small')"/></a>
</td>
<td>
<a t-attf-href="/shop/product/#{ line.product_id.id }/"><span t-field="line.product_id.name"/></a><br/>
<small t-field="line.product_id.description_sale"/>
</td>
<td>
<span t-field="line.product_id.list_price"></span>
</td>
<td>
<div class="mb8 mt8">
<input type="text" class="input-mini" t-att-data-id="line.product_id.id" t-att-value="line.product_uom_qty"/>
<a t-attf-href="./remove_cart/#{ line.product_id.id }/" class="btn mb8 btn-small btn-inverse">-</a>
<a t-attf-href="./add_cart/#{ line.product_id.id }/" class="btn mb8 btn-small btn-success">+</a>
</div>
</td>
</tr>
</t>
</tbody>
<tfoot>
<tr> <td colspan="3">Subtotal </td> <td><t t-esc="order.amount_untaxed"/></td></tr>
<tr> <td colspan="3">Taxes </td> <td><t t-esc="order.amount_tax"/></td></tr>
<tr> <td colspan="3"><h4>Total</h4></td> <td><h4><t t-esc="order.amount_total"/></h4></td></tr>
</tfoot>
</table>
<form t-if="order.order_line" class="well form-search" action="/shop/mycart/" method="post">
<input name="code" class='input' type="text" placeholder="Reduction Code..."/>
<button class="btn">Apply Code</button>
</form>
<a t-if="order.order_line" href="/shop/checkout/"><button class="btn btn-success">Proceed To Payment</button></a>
</div>
</t>
</t>
</template>
<!-- Page confirm my cart -->
<template id="checkout">
<t t-call="website.layout">
<t t-set="head">
<script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
<t t-raw="head or ''"/>
</t>
<t t-set="title">Shop - Checkout</t>
<div class="container mt48 oe_website_sale">
<div class="row">
<div class="span4">
<table class="table table-condensed">
<thead>
<tr>
<th>Product</th>
<th>Price</th>
<th>Qty.</th>
</tr>
</thead>
<tbody t-if="order.order_line">
<t t-foreach="order.order_line" t-as="line">
<tr>
<td><t t-esc="line.name"/></td>
<td><t t-esc="line.product_uom_qty"/></td>
<td><t t-esc="line.product_id.list_price"/></td>
</tr>
</t>
</tbody>
<tfoot>
<tr><th>Untaxed Amount</th><td></td><td><t t-esc="order.amount_untaxed"/></td></tr>
<tr><th>Taxes</th><td></td><td><t t-esc="order.amount_tax"/></td></tr>
<tr><th>Total</th><td></td><td><t t-esc="order.amount_total"/></td></tr>
</tfoot>
</table>
</div>
<form class="span8 form-horizontal" action="/shop/confirm_order/" method="post">
<div class=" row">
<a t-if="not partner" t-att-href="'/admin#action=redirect&amp;url=%%s/shop/checkout/' %% host_url" class="btn btn-primary">Log me, I have an account</a>
<h3 class="span8">Billing Information</h3>
<div t-attf-class="control-group #{error.get('name', '')}">
<label class="control-label" for="contact_name">Name and firstname</label>
<div class="controls">
<input type="text" name="name" t-att-value="checkout.get('name', '')"/>
</div>
</div>
<div t-attf-class="control-group #{error.get('phone', '')}">
<label class="control-label" for="contact_name">Telephone</label>
<div class="controls">
<input type="tel" name="phone" t-att-value="checkout.get('phone', '')"/>
</div>
</div>
<div t-attf-class="control-group #{error.get('fax', '')}">
<label class="control-label" for="contact_name">Fax</label>
<div class="controls">
<input type="tel" name="fax" t-att-value="checkout.get('fax', '')"/>
</div>
</div>
<div t-attf-class="control-group #{error.get('company', '')}">
<label class="control-label" for="contact_name">Company</label>
<div class="controls">
<input type="tel" name="company" t-att-value="checkout.get('company', '')"/>
</div>
</div>
<div t-attf-class="control-group #{error.get('email', '')}">
<label class="control-label" for="contact_name">Email address</label>
<div class="controls">
<input type="tel" name="email" t-att-value="checkout.get('email', '')"/>
</div>
</div>
<div t-attf-class="control-group #{error.get('street', '')}">
<label class="control-label" for="contact_name">Street</label>
<div class="controls">
<input type="tel" name="street" t-att-value="checkout.get('street', '')"/>
</div>
</div>
<div t-attf-class="control-group #{error.get('city', '')}">
<label class="control-label" for="contact_name">City</label>
<div class="controls">
<input type="tel" name="city" t-att-value="checkout.get('city', '')"/>
</div>
</div>
<div t-attf-class="control-group #{error.get('state_id', '')}">
<label class="control-label" for="contact_name">State / Province</label>
<div class="controls">
<select name="state_id">
<option value="">State / Province...</option>
<t t-foreach="states or []" t-as="state">
<option t-att-value="state.id" t-att-selected="state.id == checkout.get('state_id')"><t t-esc="state.name"/></option>
</t>
</select>
</div>
</div>
<div t-attf-class="control-group #{error.get('zip', '')}">
<label class="control-label" for="contact_name">Zip / Postal Code</label>
<div class="controls">
<input type="tel" name="zip" t-att-value="checkout.get('zip', '')"/>
</div>
</div>
<div t-attf-class="control-group #{error.get('country_id', '')}">
<label class="control-label" for="contact_name">Country</label>
<div class="controls">
<select name="country_id">
<option value="">Country...</option>
<t t-foreach="countries or []" t-as="country">
<option t-att-value="country.id" t-att-selected="country.id == checkout.get('country_id')"><t t-esc="country.name"/></option>
</t>
</select>
</div>
</div>
<div class="control-group checkbox">
<div class="controls">
<label class="checkbox">
<input t-if="not shipping" type="checkbox" name="shipping_different"/>
<input t-if="shipping" type="checkbox" name="shipping_different" checked="1"/>
Ship to different address
</label>
</div>
</div>
</div>
<div class="js_shipping row" t-att-style="not shipping and 'display:none' or ''">
<h3 class="span8 oe_shipping">Shipping Information</h3>
<div t-attf-class="control-group #{error.get('shipping_name', '')}">
<label class="control-label" for="contact_name">Name and firstname</label>
<div class="controls">
<input type="text" name="shipping_name" t-att-value="checkout.get('shipping_name', '')"/>
</div>
</div>
<div t-attf-class="control-group #{error.get('shipping_phone', '')}">
<label class="control-label" for="contact_name">Telephone</label>
<div class="controls">
<input type="tel" name="shipping_phone" t-att-value="checkout.get('shipping_phone', '')"/>
</div>
</div>
<div t-attf-class="control-group #{error.get('shipping_fax', '')}">
<label class="control-label" for="contact_name">Fax</label>
<div class="controls">
<input type="tel" name="shipping_fax" t-att-value="checkout.get('shipping_fax', '')"/>
</div>
</div>
<div t-attf-class="control-group #{error.get('shipping_street', '')}">
<label class="control-label" for="contact_name">Street</label>
<div class="controls">
<input type="tel" name="shipping_street" t-att-value="checkout.get('shipping_street', '')"/>
</div>
</div>
<div t-attf-class="control-group #{error.get('shipping_city', '')}">
<label class="control-label" for="contact_name">City</label>
<div class="controls">
<input type="tel" name="shipping_city" t-att-value="checkout.get('shipping_city', '')"/>
</div>
</div>
<div t-attf-class="control-group #{error.get('shipping_state_id', '')}">
<label class="control-label" for="contact_name">State / Province</label>
<div class="controls">
<select name="shipping_state_id">
<option value="">State / Province...</option>
<t t-foreach="states or []" t-as="state">
<option t-att-value="state.id" t-att-selected="state.id == checkout.get('shipping_state_id')"><t t-esc="state.name"/></option>
</t>
</select>
</div>
</div>
<div t-attf-class="control-group #{error.get('shipping_zip', '')}">
<label class="control-label" for="contact_name">Zip / Postal Code</label>
<div class="controls">
<input type="tel" name="shipping_zip" t-att-value="checkout.get('shipping_zip', '')"/>
</div>
</div>
<div t-attf-class="control-group #{error.get('shipping_country_id', '')}">
<label class="control-label" for="contact_name">Country</label>
<div class="controls">
<select name="shipping_country_id">
<option value="">Country...</option>
<t t-foreach="countries or []" t-as="country">
<option t-att-value="country.id" t-att-selected="country.id == checkout.get('shipping_country_id')"><t t-esc="country.name"/></option>
</t>
</select>
</div>
</div>
</div>
<button type="submit">Last stape</button>
</form>
</div>
</div>
</t>
</template>
<template id="payment">
<t t-call="website.layout">
<t t-set="title">Shop - Payment</t>
<div class="container mt48 oe_website_sale">
<div class="row">
<div class="span4">
<table class="table table-condensed">
<thead>
<tr>
<th>Product</th>
<th>Price</th>
<th>Qty.</th>
</tr>
</thead>
<tbody t-if="order.order_line">
<t t-foreach="order.order_line" t-as="line">
<tr>
<td><t t-esc="line.name"/></td>
<td><t t-esc="line.product_uom_qty"/></td>
<td><t t-esc="line.product_id.list_price"/></td>
</tr>
</t>
</tbody>
<tfoot>
<tr><th>Untaxed Amount</th><td></td><td><t t-esc="order.amount_untaxed"/></td></tr>
<tr><th>Taxes</th><td></td><td><t t-esc="order.amount_tax"/></td></tr>
<tr><th>Total</th><td></td><td><t t-esc="order.amount_total"/></td></tr>
</tfoot>
</table>
</div>
<div class="span8">
<div class="row">
<h3 class="span8">Click on your payment method</h3>
<t t-foreach="payments or []" t-as="payment">
<div t-att-title="payment.name">
<t t-raw="payment._content"/>
</div>
</t>
</div>
</div>
</div>
</div>
</t>
</template>
</data>
</openerp>