[IMP] website_sale: no widget, all in xml

bzr revid: chm@openerp.com-20130723081813-wdsuv2g6uc62dm65
This commit is contained in:
Christophe Matthieu 2013-07-23 10:18:13 +02:00
parent 596c38e7d7
commit f2610aa370
4 changed files with 289 additions and 351 deletions

View File

@ -36,7 +36,7 @@
<li><a href="https://plus.google.com/+openerp/posts"><i class="icon-google-plus-sign"></i>Google+</a></li>
</ul>
</div>
<div class="span4">
<div class="span4" name="about_us">
<h5 t-esc="res_company.name">Company name</h5>
<ul>
<li><a href="/page/website.contactus">Contact us</a></li>

View File

@ -1,69 +0,0 @@
$(document).ready(function (){
$('.oe_ecommerce').on('click', '.oe_product .btn-success,.oe_product .btn-primary, .oe_product .btn-inverse, .oe_product_detail .btn-success,.oe_product_detail .btn-primary, .oe_product_detail .btn-inverse', function (e) {
var mycart = !!$('.oe_ecommerce .oe_mycart').size();
var $button = $(e.currentTarget);
var link = $button.hasClass('btn-inverse') ? '/shop/remove_cart' : '/shop/add_cart';
var $add = $button.parent().find('.btn-success,.btn-primary');
var $remove = $button.parent().find('.btn-inverse');
$.get(link, {'product_id': $button.data('id')}, function (result) {
var result = JSON.parse(result);
var quantity = parseInt(result.quantity);
$add.find('.oe_quantity').html(quantity);
$add.toggleClass('btn-primary', !quantity).toggleClass('btn-success', !!quantity);
$remove.toggleClass('oe_hidden', !quantity);
if (mycart && !quantity) {
$button.parents('.oe_product:first').remove()
}
$('.oe_ecommerce .oe_total').replaceWith(''+result.totalHTML);
});
});
});
openerp.website = function(instance) {
instance.website.sale = {};
instance.website.sale.Checkout = instance.web.Widget.extend({
template: 'Website.sale.Checkout',
events: {
'click .oe_error_payment': 'error_payment',
},
start: function() {
var self = this;
this._super.apply(this, arguments);
this.$('input[name="shipping_different"]').on('change', function (ev) {
self.$('.oe_shipping').toggle();
});
},
get_payment_image: function () {
// model: portal.payment.acquirer => form_template
// see Setting => Accounting => Bank & Cash => Configure payment acquiring methods
},
save: function () {
},
error_payment: function () {
alert("error_payment");
},
});
};
$(document).ready(function () {
if (!$('.oe_checkout').size())
return;
// Init headless webclient
// TODO: Webclient research : use iframe embedding mode
// Meanwhile, let's HACK !!!
var s = new openerp.init(['web', 'website']);
s.web.WebClient.bind_hashchange = s.web.WebClient.show_common = s.web.blockUI = s.web.unblockUI = function() {};
s.web.WebClient.include({ do_push_state: function() {} });
var wc = new s.web.WebClient();
wc.start();
var instance = openerp.instances[wc.session.name];
// Another hack since we have no callback when webclient has loaded modules.
instance.web.qweb.add_template('/website_sale/static/src/xml/ecommerce.xml');
var editor = new instance.website.sale.Checkout(instance.webclient);
editor.appendTo($('.oe_checkout'));
});

View File

@ -1,49 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-name="Website.sale.Checkout">
<div class="oe_checkout">
<div>
<h3 class="span8">Billing Information</h3>
<button class="btn btn-success">Log me, I have an account</button>
<label class="span8">Name and firstname<input class="span7" type="text" name="name" placeholder="Name and firstname"/></label>
<label class="span4">Telephone<input type="text" name="tel" placeholder="Telephone"/></label>
<label class="span4">Fax<input type="text" name="fax" placeholder="Fax"/></label>
<label class="span4">Company<input type="text" name="company" placeholder="Company"/></label>
<label class="span4">Email address<input type="email" name="email" placeholder="Email address"/></label>
<label class="span8">Street<input class="span7" type="text" name="street" placeholder="Street address"/></label>
<label class="span4">City<input type="text" name="city" placeholder="City"/></label>
<label class="span4">State/Province<input type="text" name="state" placeholder="State/Province"/></label>
<label class="span4">Zip/Postal Code<input type="text" name="zip" placeholder="Zip/Postal Code"/></label>
<label class="span4">Country<input type="text" name="state" placeholder="Country"/></label>
<label class="checkbox">Ship to different address<input type="checkbox" name="shipping_different"/></label>
</div>
<div class="oe_shipping" style="display:none">
<h3 class="span8 oe_shipping" style="display:none">Shipping Information</h3>
<label class="span8">Name and firstname<input class="span7" type="text" name="name" placeholder="Name and firstname"/></label>
<label class="span4">Telephone<input type="text" name="tel" placeholder="Telephone"/></label>
<label class="span4">Fax<input type="text" name="fax" placeholder="Fax"/></label>
<label class="span4">Company<input type="text" name="company" placeholder="Company"/></label>
<label class="span8">Street<input class="span7" type="text" name="street" placeholder="Street address"/></label>
<label class="span4">City<input type="text" name="city" placeholder="City"/></label>
<label class="span4">State/Province<input type="text" name="state" placeholder="State/Province"/></label>
<label class="span4">Zip/Postal Code<input type="text" name="zip" placeholder="Zip/Postal Code"/></label>
<label class="span4">Country<input type="text" name="state" placeholder="Country"/></label>
</div>
<div class="oe_payment">
<div class="oe_error_payment"></div>
% if object.company_id.paypal_account:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
<input type="hidden" name="cmd" value="_xclick"/>
<input type="hidden" name="business" value="${object.company_id.paypal_account}"/>
<input type="hidden" name="item_name" value="${object.company_id.name} ${kind.title()} ${reference}"/>
<input type="hidden" name="amount" value="${amount}"/>
<input type="hidden" name="currency_code" value="${currency.name}"/>
<input type="image" name="submit" src="https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif"/>
</form>
% endif
</div>
</div>
</t>
</templates>

View File

@ -1,250 +1,306 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Layout add nav and footer -->
<data>
<!-- Layout add nav and footer -->
<!--record id="header_ecommerce" model="ir.ui.view">
<field name="name">header_ecommerce</field>
<field name="inherit_id" ref="website.header"/>
<field name="arch" type="xml">
<data>
<xpath expr="(//li)[last()]" position="after">
<li class="pull-right"><a href="/shop/mycart"><i class="icon-shopping-cart icon-large"></i> My cart</a></li>
<li class="pull-right"><a href="/shop">Shop</a></li>
</xpath>
</data>
</field>
</record>
<record id="footer_ecommerce" model="ir.ui.view">
<field name="name">footer_ecommerce</field>
<field name="inherit_id" ref="website.footer"/>
<field name="arch" type="xml">
<data>
<xpath expr="/div/div/div[3]" position="inside">
SHOP Footer
</xpath>
</data>
</field>
</record-->
<record id="header_ecommerce" model="ir.ui.view">
<field name="name">header_ecommerce</field>
<field name="inherit_id" ref="website.header"/>
<field name="arch" type="xml">
<data>
<xpath expr="(//li)[last()]" position="after">
<li class="pull-right"><a href="/shop/mycart"><i class="icon-shopping-cart icon-large"></i> My cart</a></li>
<li class="pull-right"><a href="/shop">Shop</a></li>
</xpath>
</data>
</field>
</record>
<!-- Page Shop -->
<!-- Page Shop -->
<template id="page">
<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="website_sale.categories_recursive"/>
</t>
</ul>
</div>
<div class="span8">
<t t-raw="shop_content">
</t>
</div>
</div>
</div>
</t>
</template>
<!-- List of categories -->
<template id="categories_recursive">
<li t-att-class="category.id == current_category and 'active' or ''">
<a t-att-href="'/shop/category/%%s' %% category.id"><span t-record="category" t-field="name"><t t-esc="category.name"/></span></a>
<ul t-if="category.child_id" class="nav nav-list">
<t t-foreach="category.child_id" t-as="category">
<template id="page">
<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="website_sale.categories_recursive"/>
</t>
</ul>
</li>
</template>
</ul>
</div>
<div class="span8">
<t t-raw="shop_content">
</t>
</div>
</div>
</div>
</t>
</template>
<!-- Product list -->
<!-- List of categories -->
<template id="products">
<t t-call="website_sale.page">
<t t-set="title">Product</t>
<t t-set="shop_content">
<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>
<template id="categories_recursive">
<li t-att-class="category.id == current_category and 'active' or ''">
<a t-att-href="'/shop/category/%%s' %% category.id"><span t-record="category" t-field="name"><t t-esc="category.name"/></span></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.page">
<t t-set="title">Product</t>
<t t-set="shop_content">
<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>
<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>
</t>
</t>
</template>
<template id="product_card">
<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>
<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>
<div class="media-body">
<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>
<div class="oe_button_cart">
<button 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">Add to cart
<span class="oe_txt">(<span class="oe_quantity"><t t-esc="quantity"/></span>)</span>
</button>
</div>
</div>
</div>
<script>
$('.oe_ecommerce').on('click', '.oe_product .btn', function (e) {
var $button = $(e.currentTarget);
var $product = $button.parents('.oe_product:first');
var link = $button.hasClass('btn-inverse') ? '/shop/remove_cart' : '/shop/add_cart';
var $add = $product.find('.btn-success,.btn-primary');
var $remove = $product.find('.btn-inverse');
$.get(link, {'product_id': $button.data('id')}, function (result) {
var result = JSON.parse(result);
var quantity = parseInt(result.quantity);
$add.find('.oe_quantity')
.html(quantity);
$add.toggleClass('btn-primary', !quantity)
.toggleClass('btn-success', !!quantity);
$remove.toggleClass('oe_hidden', !quantity);
if ($('.oe_mycart').size() &amp;&amp; !quantity) {
$product.remove()
}
$('.oe_ecommerce .oe_total').replaceWith(''+result.totalHTML);
});
});
</script>
</template>
<template id="product_recommended">
<div class="oe_recommended media well well-small" t-if="recommended_products">
<h6>Other customers have also take this products:</h6>
<t t-foreach="recommended_products or []" t-as="product">
<a t-att-href="'/shop/product/%%s' %% product.id"><img t-att-src="'data:image/png;base64,' + product.image"/></a>
</t>
</div>
</template>
<!-- product -->
<template id="product">
<t t-call="website_sale.page">
<t t-set="title">Product</t>
<t t-set="shop_content">
<div class="oe_product_detail">
<h1><span t-record="product" t-field="name"><t t-esc="product.name"/></span></h1>
<div class="oe_button_cart">
<button 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">Add to cart
<span class="oe_txt">(<span class="oe_quantity"><t t-esc="quantity"/></span>)</span>
</button>
</div>
<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>
<t t-call="website_sale.product_recommended"/>
</div>
</t>
</t>
</template>
<!-- Page Shop my cart -->
<template id="mycart">
<t t-call="website_sale.page">
<t t-set="title">My cart</t>
<t t-set="shop_content">
<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>
<div class="media well well-small">
<form action="/shop/mycart" class="navbar-form">
<input name="code" type="text" placeholder="Reduction Code..."/>
<button class="btn">Submit your Reduction Code</button>
</form>
</div>
<t t-call="website_sale.product_recommended"/>
<t t-call="website_sale.total"/>
<a t-if="order.order_line" href="/shop/checkout"><button class="btn btn-success">Next stage</button></a>
</span>
</t>
</t>
</template>
<!-- Total Shop my cart -->
<template id="total">
<div class="oe_total">
<div class="media well well-small">
<table t-if="order.order_line">
<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>
<span t-if="not order.order_line">Your cart is empty</span>
</div>
</div>
</template>
<!-- Page confirm my cart -->
<template id="checkout">
<t t-call="website.layout">
<t t-set="title">Shop - Checkout</t>
<div class="container oe_ecommerce">
<div class="row">
<div class="span4 oe_total">
<table class="table table-condensed" t-if="order.order_line">
<thead>
<tr><th>Product</th><th>Qty.</th><th>Price</th></tr>
</thead>
<tbody>
<t t-foreach="order.order_line or []" t-as="line">
<tr><td><t t-esc="line.product_id.name"/></td><td><t t-esc="int(line.product_uom_qty)"/></td><td></td></tr>
</t>
<tr><td colspan="3" style="visibility: hidden; border: 0">-</td></tr>
<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>
</tbody>
</table>
</div>
<div class="span8 oe_checkout">
<div>
<h3 class="span8">Billing Information</h3>
<button class="btn btn-success">Log me, I have an account</button>
<label class="span8">Name and firstname<input class="span7" type="text" name="name" placeholder="Name and firstname"/></label>
<label class="span4">Telephone<input type="text" name="tel" placeholder="Telephone"/></label>
<label class="span4">Fax<input type="text" name="fax" placeholder="Fax"/></label>
<label class="span4">Company<input type="text" name="company" placeholder="Company"/></label>
<label class="span4">Email address<input type="email" name="email" placeholder="Email address"/></label>
<label class="span8">Street<input class="span7" type="text" name="street" placeholder="Street address"/></label>
<label class="span4">City<input type="text" name="city" placeholder="City"/></label>
<label class="span4">State/Province<input type="text" name="state" placeholder="State/Province"/></label>
<label class="span4">Zip/Postal Code<input type="text" name="zip" placeholder="Zip/Postal Code"/></label>
<label class="span4">Country<input type="text" name="state" placeholder="Country"/></label>
<label class="checkbox">Ship to different address<input type="checkbox" name="shipping_different"/></label>
</div>
<div class="oe_shipping" style="display:none">
<h3 class="span8 oe_shipping" style="display:none">Shipping Information</h3>
<label class="span8">Name and firstname<input class="span7" type="text" name="name" placeholder="Name and firstname"/></label>
<label class="span4">Telephone<input type="text" name="tel" placeholder="Telephone"/></label>
<label class="span4">Fax<input type="text" name="fax" placeholder="Fax"/></label>
<label class="span4">Company<input type="text" name="company" placeholder="Company"/></label>
<label class="span8">Street<input class="span7" type="text" name="street" placeholder="Street address"/></label>
<label class="span4">City<input type="text" name="city" placeholder="City"/></label>
<label class="span4">State/Province<input type="text" name="state" placeholder="State/Province"/></label>
<label class="span4">Zip/Postal Code<input type="text" name="zip" placeholder="Zip/Postal Code"/></label>
<label class="span4">Country<input type="text" name="state" placeholder="Country"/></label>
</div>
<div class="oe_payment">
<div class="oe_error_payment"></div>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
<input type="hidden" name="cmd" value="_xclick"/>
<input type="hidden" name="business" value="${object.company_id.paypal_account}"/>
<input type="hidden" name="item_name" value="${object.company_id.name} ${kind.title()} ${reference}"/>
<input type="hidden" name="amount" value="${amount}"/>
<input type="hidden" name="currency_code" value="${currency.name}"/>
<input type="image" name="submit" src="https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif"/>
</form>
</div>
<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>
</t>
</t>
</template>
<template id="product_card">
<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>
<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>
<div class="media-body">
<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>
<div class="oe_button_cart">
<button 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">Add to cart
<span class="oe_txt">(<span class="oe_quantity"><t t-esc="quantity"/></span>)</span>
</button>
</div>
</div>
<script>
$(".oe_ecommerce input[name='shipping_different']").change(function() {
$(".oe_ecommerce .oe_shipping").toggle();
});
</script>
</div>
</template>
<template id="product_recommended">
<div class="oe_recommended media well well-small" t-if="recommended_products">
<h6>Other customers have also take this products:</h6>
<t t-foreach="recommended_products or []" t-as="product">
<a t-att-href="'/shop/product/%%s' %% product.id"><img t-att-src="'data:image/png;base64,' + product.image"/></a>
</t>
</div>
</template>
<!-- product -->
<template id="product">
<t t-call="website_sale.page">
<t t-set="title">Product</t>
<t t-set="shop_content">
<div class="oe_product_detail">
<h1><span t-record="product" t-field="name"><t t-esc="product.name"/></span></h1>
<div class="oe_button_cart">
<button 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">Add to cart
<span class="oe_txt">(<span class="oe_quantity"><t t-esc="quantity"/></span>)</span>
</button>
</div>
<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>
<t t-call="website_sale.product_recommended"/>
</div>
</t>
</template>
<template id="order">
<t t-call="website_sale.page">
<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>
</t>
</t>
</template>
<!-- Page Shop my cart -->
<template id="mycart">
<t t-call="website_sale.page">
<t t-set="title">My cart</t>
<t t-set="shop_content">
<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>
<div class="media well well-small">
<form action="/shop/mycart" class="navbar-form">
<input name="code" type="text" placeholder="Reduction Code..."/>
<button class="btn">Submit your Reduction Code</button>
</form>
</div>
<t t-call="website_sale.product_recommended"/>
<t t-call="website_sale.total"/>
<a t-if="order.order_line" href="/shop/checkout"><button class="btn btn-success">Next stage</button></a>
</span>
</t>
</t>
</template>
<!-- Total Shop my cart -->
<template id="total">
<div class="oe_total">
<div class="media well well-small">
<table t-if="order.order_line">
<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>
<span t-if="not order.order_line">Your cart is empty</span>
</div>
</div>
</template>
<!-- Page confirm my cart -->
<template id="checkout">
<t t-call="website.layout">
<t t-set="title">Shop - Checkout</t>
<div class="container oe_ecommerce">
<div class="row">
<div class="span4 oe_total">
<table class="table table-condensed" t-if="order.order_line">
<thead>
<tr><th>Product</th><th>Qty.</th><th>Price</th></tr>
</thead>
<tbody>
<t t-foreach="order.order_line or []" t-as="line">
<tr><td><t t-esc="line.product_id.name"/></td><td><t t-esc="int(line.product_uom_qty)"/></td><td></td></tr>
</t>
<tr><td colspan="3" style="visibility: hidden; border: 0">-</td></tr>
<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>
</tbody>
</table>
</div>
<div class="span8 oe_checkout"></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>
</template>
<template id="order">
<t t-call="website_sale.page">
<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>
<t t-call="website_sale.total"/>
<a t-if="order.order_line" href="/shop/confirm_order"><button class="btn btn-success">Confirm order</button></a>
</t>
</t>
</template>
<template id="thanks">
<t t-call="website_sale.page">
<t t-set="title">Order</t>
<t t-set="shop_content">
Thanks for your sale order
</t>
</t>
</template>
</data>
<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>
<t t-call="website_sale.total"/>
<a t-if="order.order_line" href="/shop/confirm_order"><button class="btn btn-success">Confirm order</button></a>
</t>
</t>
</template>
<template id="thanks">
<t t-call="website_sale.page">
<t t-set="title">Order</t>
<t t-set="shop_content">
Thanks for your sale order
</t>
</t>
</template>
</data>
</openerp>