[IMP] website_sale: basic cleaning of checkout method about getting partner data...
[odoo/odoo.git] / addons / website_sale / views / website_sale.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3 <data>
4
5     <record id="product_normal_form_view" model="ir.ui.view">
6         <field name="name">product.normal.form.inherit</field>
7         <field name="model">product.product</field>
8         <field name="inherit_id" ref="product.product_normal_form_view"/>
9         <field name="arch" type="xml">
10             <!-- add state field in header -->
11             <xpath expr="//sheet" position="before">
12                 <div class="oe_form_box_info oe_text_center" attrs="{'invisible': [('sale_ok', '=', False)]}">
13                     <p attrs="{'invisible': [('website_published', '=', True)]}">
14                         This product is <b>not available</b> for public user in your ecommerce.
15                     </p>
16                     <p attrs="{'invisible': [('website_published', '=', False)]}">
17                         This product is <b>available</b> for public user in your ecommerce.
18                     </p>
19                     <p>Website view: <field class="oe_inline" name="website_url" widget="url"/></p>
20                 </div>
21             </xpath>
22
23             <group name="sale" position="inside">
24                 <group name="website" string="Website">
25                     <field name="website_published"/>
26                     <field name="suggested_product_ids" widget="many2many_tags"/>
27                 </group>
28             </group>
29         </field>
30     </record>
31
32     <record model="ir.ui.view" id="product_pricelist_view">
33         <field name="name">product.pricelist.website.form</field>
34         <field name="model">product.pricelist</field>
35         <field name="inherit_id" ref="product.product_pricelist_view"/>
36         <field name="arch" type="xml">
37             <field name="active" position="after">
38                 <field name="code"/>
39             </field>
40         </field>
41     </record>
42     
43     <!-- Layout add nav and footer -->
44
45     <template id="header_footer" inherit_id="website.layout" name="Custom Footer">
46         <xpath expr="//header//ul[@id='top_menu']/li" position="before">
47             <li><a href="/shop/">Shop</a></li>
48             <li>
49                 <a href="/shop/mycart/">
50                     <i class="icon-shopping-cart"></i>
51                     My cart <span t-attf-class="my_cart_quantity badge #{(not website_sale_order or not website_sale_order.get_total_quantity()) and 'hidden' or ''}"
52                                   t-esc="website_sale_order and website_sale_order.get_total_quantity() or ''"/>
53                 </a>
54             </li>
55         </xpath>
56         <xpath expr="//footer//ul[@name='products']" position="inside">
57             <li><a href="/shop/">Shop</a></li>
58             <li>
59                 <a href="/shop/mycart/">
60                     <i class="icon-shopping-cart"></i>
61                     My cart <span t-attf-class="my_cart_quantity badge #{(not website_sale_order or not website_sale_order.get_total_quantity()) and 'hidden' or ''}"
62                                   t-esc="website_sale_order and website_sale_order.get_total_quantity() or ''"/>
63                 </a>
64             </li>
65         </xpath>
66     </template>
67     <!-- List of categories -->
68
69     <template id="categories_recursive">
70         <li t-att-class="category.id == category_id and 'active' or ''">
71             <a t-att-class="category.id not in categ[1] and 'unpublish' or ''" t-attf-href="/shop/category/#{ category.id }/" t-field="category.name"></a>
72             <ul t-if="category.child_id" class="nav nav-pills nav-stacked nav-hierarchy">
73                 <t t-foreach="category.child_id" t-as="category">
74                     <t t-if="category.id in categ[1] or editable">
75                         <t t-call="website_sale.categories_recursive"/>
76                     </t>
77                 </t>
78             </ul>
79         </li>
80     </template>
81
82     <!-- Product list --> 
83
84     <template id="products" page="True">
85         <t t-call="website.layout">
86             <t t-set="head">
87                 <script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
88                 <link rel='stylesheet' href='/website_sale/static/src/css/website_sale.css'/>
89                 <t t-raw="head or ''"/>
90             </t>
91             <t t-set="title">Our Products</t>
92             <div id="wrap">
93               <div class="oe_structure"/>
94               <div class="container oe_website_sale">
95                 <div class="row">
96                     <div class="col-sm-4">
97                         <h1>Our Products</h1>
98                     </div><div class="col-sm-4 pagination text-center">
99                         <a t-if="editable" t-attf-href="/shop/#{ category_id and ('category/%s/' % category_id) or ''}add_product/" class="btn btn-default">New Product</a>
100                     </div><div class="col-sm-4">
101                         <form t-attf-action="/shop/#{ category_id and ('category/%s/' % category_id) or ''}" method="get" class="pull-right pagination">
102                             <div class="input-group">
103                                 <span class="input-group-addon"><span class="glyphicon glyphicon-search"/></span>
104                                 <input type="text" name="search" class="search-query form-control" placeholder="Search..." t-att-value="search or ''"/>
105                             </div>
106                         </form>
107                         <t t-call="website.pager">
108                             <t t-set="classname">pull-left</t>
109                         </t>
110                     </div>
111                 </div>
112
113                 <div class='row style_default'>
114                   <div class="col-md-12" id="products_grid">
115                     <t t-foreach="products" t-as="product">
116                         <div t-attf-class="col-md-#{ search and 3 or product.website_sizex } oe_product oe-height-#{ search and 2 or product.website_sizey } #{ product.website_product_class}" t-att-data-publish="product.website_published and 'on' or 'off'" id="products_layout">
117
118                             <div class="oe_product_description">
119                                 <a t-attf-href="/shop/product/#{ product.id }/?#{ search and ('search=%s' % search) or ''}#{ category_id and ('&amp;category_id=%s' % category_id) or ''}">
120                                     <b t-field="product.name"/>
121                                 </a>
122                                 <!-- This should be an option -->
123                                 <div t-if="product.description_sale" class="text-muted oe_subdescription">
124                                     <div id="product_description" t-att-data-name="product.id"/>
125                                 </div>
126                                 <div>
127                                     <b>
128                                         <t t-if="product.product_variant_ids[0].lst_price != product.product_variant_ids[0].price">
129                                           <span class="text-danger" style="text-decoration: line-through;">
130                                               <t t-esc="product.product_variant_ids[0].lst_price" /> €
131                                           </span>&amp;nbsp;
132                                         </t>
133                                         <t t-esc="product.product_variant_ids[0].price" /> €
134                                     </b>
135                                     <span id="add_to_cart" t-att-data-name="product.id"/>
136                                 </div>
137                             </div>
138
139                             <div class="oe_product_image text-center">
140                                 <a t-attf-href="/shop/product/#{ product.id }/?#{ search and ('search=%s' % search) or ''}#{ category_id and ('&amp;category_id=%s' % category_id) or ''}">
141                                     <img class="img" t-att-src="product.img('image')"/>
142                                 </a>
143                             </div>
144
145                         </div>
146                     </t>
147                   </div>
148                 </div>
149                 <div class="text-center">
150                     <t t-call="website.pager" />
151                 </div>
152               </div>
153               <div class="oe_structure mb32"/>
154             </div>
155         </t>
156     </template>
157
158     <!-- Product Description-->
159
160     <template id="product_description" inherit_option_id="website_sale.products" name="Product Description">
161         <xpath expr="//div[@id='product_description']" position="replace">
162             <small>
163                 <t t-field="product.description_sale"/>
164             </small>
165         </xpath>
166     </template>
167
168     <!-- Add to cart button-->
169
170     <template id="add_to_basket" inherit_option_id="website_sale.products" name="Add to Cart">
171         <xpath expr="//span[@id='add_to_cart']" position="replace">
172             <a t-attf-href="./add_cart/?product_id=#{ product.id }">
173                 <span class="icon-shopping-cart"/>
174             </a>
175         </xpath>
176     </template>
177
178     <!-- List view of products -->
179
180     <template id="list_view" inherit_option_id="website_sale.products" name="List View">
181         <xpath  expr="//div[@id='products_layout']" position="attributes">
182             <attribute name="class">col-md-12 oe_products oe-height-1</attribute>
183         </xpath>
184
185     </template>
186
187
188     <!-- product --> 
189
190     <template id="product" name="Product">
191         <t t-call="website.layout">
192             <t t-set="head">
193                 <script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
194             </t>
195             <t t-set="title" t-raw="product.name"/>
196             <div id="wrap">
197
198               <section class="container mt8">
199                 <div class="row">
200                   <div class="col-sm-5">
201                       <ol class="breadcrumb">
202                           <li><a href="/shop">Products</a></li>
203                           <li t-if="category"><a t-att-href="'/shop/category/%s' % (category_id,)"><t t-field="category.name"/></a></li>
204                           <li class="active" t-field="product.name">Product Name</li>
205                       </ol>
206                   </div><div class="col-sm-3">
207                       <t t-call="website.publish"><t t-set="object" t-value="product"/></t>
208                   </div><div class="col-sm-3 col-sm-offset-1">
209                       <form t-attf-action="/shop/#{ category_id and ('category/%s/' % category_id) or ''}" method="get" class="pull-right">
210                           <div class="input-group">
211                               <span class="input-group-addon"><span class="glyphicon glyphicon-search"/></span>
212                               <input type="text" name="search" class="search-query form-control" placeholder="Search..." t-att-value="search or ''"/>
213                           </div>
214                       </form>
215                   </div>
216                 </div>
217               </section>
218
219               <section class="container oe_website_sale mb16" id="product_detail">
220                 <div class="row">
221                   <div class="col-sm-7 col-md-7 col-lg-7">
222                       <img class="img" t-att-src="product.img('image')" style="max-height: 500px"/>
223                   </div><div class="col-sm-5 col-md-5 col-lg-4 col-lg-offset-1">
224                       <h1 t-field="product.name">Product Name</h1>
225
226                       <form action="./add_cart/">
227                           <input type="hidden" t-if="len(product.product_variant_ids) &lt;= 1" name="product_id" t-att-value="product.id"/>
228                           <t t-if="len(product.product_variant_ids) &gt; 1">
229                               <label label-default="label-default" class="radio" t-foreach="product.product_variant_ids" t-as="product">
230                                   <input type="radio" name="product_id" t-att-value="product.id" t-att-checked="product == product.product_variant_ids[0] or None"/>
231                                   <t t-esc="product.variants or ''">Standard</t>
232                                   <span class="badge" t-if="product.price_extra">
233                                       <t t-esc="product.price_extra > 0 and '+' or ''"/><t t-esc="product.price_extra"/> €
234                                   </span>
235                               </label>
236                               <br/>
237                           </t>
238                           <div>
239                               <t t-if="product.product_variant_ids[0].lst_price != product.product_variant_ids[0].price">
240                               <h5 class="text-error" style="text-decoration: line-through;" title="Price without reduction"><t t-field="product.product_variant_ids[0].lst_price" /> €</h5>
241                               <h4><t t-esc="product.product_variant_ids[0].price" /> €</h4>
242                               </t>
243                               <h4 t-if="product.product_variant_ids[0].lst_price == product.product_variant_ids[0].price">
244                                   <b><t t-field="product.product_variant_ids[0].lst_price" /> €</b>
245                               </h4>
246                           </div>
247                           <button class="btn btn-primary btn-lg mt8">Add to Cart</button>
248                           <hr t-if="product.description_sale"/>
249                           <p t-field="product.description_sale" class="text-muted"/>
250                           <hr/>
251                           <p class="text-muted">
252                               30-day money-back guarantee<br/>
253                               Free Shipping in U.S.<br/>
254                               Buy now, get in 2 days
255                           </p>
256                       </form>
257                   </div>
258                 </div>
259               </section>
260               <div t-field="product.website_description" class="oe_structure" id="product_full_description"/>
261             </div>
262         </t>
263     </template>
264
265     <template id="recommended_products" inherit_id="website_sale.product" inherit_option_id="website_sale.product" name="Recommended Products">
266         <xpath expr="//div[@id='product_full_description']" position="after">
267             <div class="container mt32" t-if="product.recommended_products()">
268                 <h3>Customers who have bought this product also bought:</h3>
269                 <div class='row mt16' style="margin-left: 15px !important;">
270                 <t t-foreach="product.recommended_products()" t-as="product">
271                     <div class='col-md-2 thumbnail' style='width: 170px; margin-right: 16px;'>
272                         <div class='mt16 text-center'>
273                             <img t-att-src="product.img('image_small')"/>
274                             <h5>
275                                 <a t-attf-href="/shop/product/#{ product.id }/"
276                                    style="display: block">
277                                     <span t-field='product.name'
278                                           style="display: block"/>
279                                 </a>
280                             </h5>
281                         </div>
282                     </div>
283                 </t>
284                 </div>
285             </div>
286         </xpath>
287     </template>
288
289     <!-- Page Shop my cart --> 
290
291     <template id="mycart" name="My cart" page="True">
292         <t t-call="website.layout">
293             <t t-set="head">
294                 <script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
295                 <t t-raw="head or ''"/>
296             </t>
297             <t t-set="title">Your Cart</t>
298             <div id="wrap">
299               <div class="container oe_website_sale">
300                 <div class="col-md-12 oe_mycart">
301                     <h1>My Shopping Cart</h1>
302                     <table class='table' id="mycart_products">
303                         <colgroup>
304                             <col width="80"/>
305                             <col/>
306                             <col width="80"/>
307                             <col width="160"/>
308                         </colgroup>
309                         <thead>
310                             <tr>
311                                 <th colspan="2">Product</th>
312                                 <th>Price</th>
313                                 <th>Quantity</th>
314                             </tr>
315                         </thead>
316                         <tbody t-if="not website_sale_order or not website_sale_order.order_line">
317                             <tr><td colspan="4"><h3>Your cart is empty</h3></td></tr>
318                         </tbody>
319                         <tbody t-if="website_sale_order and website_sale_order.order_line">
320                             <t t-foreach="website_sale_order.order_line" t-as="line">
321                                 <tr>
322                                     <td colspan="2" t-if="not line.product_id.product_tmpl_id"></td>
323                                     <td t-if="line.product_id.product_tmpl_id">
324                                         <a t-attf-href="/shop/product/#{ line.product_id.product_tmpl_id.id }/"><img class="img-rounded" t-att-src="line.product_id.img('image_small')"/></a>
325                                     </td>
326                                     <td t-if="line.product_id.product_tmpl_id">
327                                         <a t-attf-href="/shop/product/#{ line.product_id.product_tmpl_id.id }/"><span t-field="line.name"/></a><br/>
328                                         <small t-field="line.product_id.description_sale"/>
329                                     </td>
330                                     <td>
331                                         <t t-if="line.product_id.product_tmpl_id and line.product_id.lst_price != line.price_unit">
332                                         <small class="text-error" style="text-decoration: line-through;"><t t-esc="line.product_id.lst_price" /> €</small>
333                                         </t>
334                                        <span t-field="line.price_unit"></span> €
335                                     </td>
336                                     <td>
337                                         <div class="pull-right">
338                                             <input type="text" class="js_quantity input-sm col-md-5" t-att-data-id="line.id" t-att-value="line.product_uom_qty"/>
339                                             <a t-attf-href="./remove_cart/?order_line_id=#{ line.id }" class="btn btn-default mb8 btn-sm btn-inverse">-</a>
340                                             <a t-attf-href="./add_cart/?order_line_id=#{ line.id }" class="btn btn-default mb8 btn-sm btn-success">+</a>
341                                         </div>
342                                     </td>
343                                 </tr>
344                             </t>
345                         </tbody>
346                     </table>
347                     <table class='table table-hover table-condensed' id="mycart_total">
348                         <colgroup>
349                             <col width="80"/>
350                             <col/>
351                             <col width="80"/>
352                             <col width="160"/>
353                         </colgroup>
354                         <thead>
355                             <tr> <th colspan="3">Subtotal </th>      <th><t t-esc="website_sale_order and website_sale_order.amount_untaxed or 0"/> €</th></tr>
356                             <tr> <th colspan="3">Taxes </th>         <th><t t-esc="website_sale_order and website_sale_order.amount_tax or 0"/> €</th></tr>
357                             <tr> <th colspan="3"><h4>Total</h4></th> <th><h4><t t-esc="website_sale_order and website_sale_order.amount_total or 0"/> €</h4></th></tr>
358                         </thead>
359                     </table>
360                     <a t-if="website_sale_order and website_sale_order.order_line" href="/shop/checkout/" class="btn btn-success">Proceed To Payment</a>
361                 </div>
362               </div>
363               <div class="oe_structure"/>
364             </div>
365         </t>
366     </template>
367
368     <!-- Page Shop --> 
369
370     <template id="products_categories" inherit_option_id="website_sale.products" name="Product Categories">
371         <xpath expr="//div[@id='products_grid']" position="before">
372             <div class="col-md-3">
373                 <ul class="nav nav-pills nav-stacked mt16">
374                     <li t-att-class=" '' if category_id else 'active' "><a href="/shop/">All Products</a></li>
375                     <t t-set="categ" t-value="get_categories()"/>
376                     <t t-foreach="categ[0]" t-as="category">
377                         <t t-call="website_sale.categories_recursive"/>
378                     </t>
379                 </ul>
380             </div>
381         </xpath>
382         <xpath expr="//div[@id='products_grid']" position="attributes">
383             <attribute name="class">col-md-9</attribute>
384         </xpath>
385     </template>
386
387
388     <template id="suggested_products_list" inherit_id="website_sale.mycart" inherit_option_id="website_sale.mycart" name="Suggested Products in list view">
389         <xpath expr="//table[@id='mycart_products']" position="after">
390             <table t-if="suggested_products" class='table table-hover table-condensed'>
391                 <colgroup>
392                     <col/>
393                     <col width="80"/>
394                     <col width="160"/>
395                 </colgroup>
396                 <thead>
397                     <tr>
398                         <th>Suggested products</th>
399                     </tr>
400                 </thead>
401                 <tbody>
402                     <t t-foreach="suggested_products" t-as="product">
403                         <tr>
404                             <td>
405                                 <a t-attf-href="/shop/product/#{ product.id }/"><span t-field="product.name"/></a><br/>
406                                 <small t-field="product.description_sale"/>
407                             </td>
408                             <td>
409                                <span t-field="product.list_price"></span>€
410                             </td>
411                             <td>
412                                 <div class="pull-right">
413                                     <a t-attf-href="./add_cart/?product_id=#{ product.id }" class="btn btn-sm btn-success">+</a>
414                                 </div>
415                             </td>
416                         </tr>
417                     </t>
418                 </tbody>
419             </table>
420         </xpath>
421     </template>
422     <template id="suggested_products_cell" inherit_option_id="website_sale.mycart" name="Suggested Products in card view">
423         <xpath expr="//table[@id='mycart_products']" position="after">
424             <div class="mt16 mb32" t-if="suggested_products">
425                 <h4>Suggested products</h4>
426                 <div class='row mt16'>
427                 <t t-foreach="suggested_products" t-as="product">
428                     <div class='col-md-2 thumbnail'>
429                         <a t-attf-href="/shop/product/#{ product.id }/">
430                             <div class='mt16 text-center'>
431                                 <img t-att-src="product.img('image_small')"/>
432                                 <h5 t-field='product.name'></h5>
433                             </div>
434                         </a>
435                     </div>
436                 </t>
437                 </div>
438             </div>
439         </xpath>
440     </template>
441     <template id="reduction_code" inherit_option_id="website_sale.mycart" name="Reduction Code">
442         <xpath expr="//table[@id='mycart_total']" position="after">
443             <form t-if="website_sale_order and website_sale_order.order_line" class="well" action="/shop/mycart/" method="post">
444                 <input name="promo" class='input' type="text" placeholder="Reduction Code..." t-att-value="website_sale_order.pricelist_id.code or ''"/>
445                 <button class="btn">Apply Code</button>
446             </form>
447         </xpath>
448     </template>
449
450
451     <!-- Page confirm my cart -->
452
453     <template id="checkout">
454         <t t-call="website.layout">
455           <t t-set="head">
456               <script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
457               <t t-raw="head or ''"/>
458           </t>
459           <t t-set="title">Shop - Checkout</t>
460           <div id="wrap">
461             <div class="container oe_website_sale">
462                 <div class="row">
463                     <div class="col-md-4">
464                         <table class="table table-condensed">
465                             <thead>
466                                 <tr>
467                                     <th>Product</th>
468                                     <th>Price</th>
469                                     <th>Qty.</th>
470                                 </tr>
471                             </thead>
472                             <tbody t-if="website_sale_order.order_line">
473                                 <t t-foreach="website_sale_order.order_line" t-as="line">
474                                     <tr>
475                                         <td><t t-esc="line.name"/></td>
476                                         <td><t t-esc="line.product_uom_qty"/></td>
477                                         <td><t t-esc="line.price_unit"/> €</td>
478                                     </tr>
479                                 </t>
480                             </tbody>
481                             <tfoot>
482                                 <tr><th>Untaxed Amount</th><td></td><td><t t-esc="website_sale_order.amount_untaxed"/> €</td></tr>
483                                 <tr><th>Taxes</th><td></td><td><t t-esc="website_sale_order.amount_tax"/> €</td></tr>
484                                 <tr><th>Total</th><td></td><td><t t-esc="website_sale_order.amount_total"/> €</td></tr>
485                             </tfoot>
486                         </table>
487                     </div>
488                     <form class="col-md-8 form-horizontal" action="/shop/confirm_order/" method="post">
489                         <div class=" row">
490                             <a t-if="not partner" t-attf-href="/admin#action=redirect&amp;url=#{ request.httprequest.host_url }/shop/checkout/" class="btn btn-primary">Log me, I have an account</a>
491                             <h3 class="col-md-10">Billing Information</h3>
492                             <div t-attf-class="form-group #{error.get('name') and 'has-error' or ''}">
493                                 <label class="col-lg-3 control-label" for="contact_name">Name and firstname</label>
494                                 <div class="col-lg-4">
495                                     <input type="text" name="name" class="form-control" t-att-value="checkout['name']"/>
496                                 </div>
497                             </div>
498                             <div t-attf-class="form-group #{ error.get('phone') and 'has-error' or ''}">
499                                 <label class="col-lg-3 control-label" for="contact_name">Telephone</label>
500                                 <div class="col-lg-4">
501                                     <input type="tel" name="phone" class="form-control" t-att-value="checkout['phone']"/>
502                                 </div>
503                             </div>
504                             <div t-attf-class="form-group #{error.get('fax') and 'has-error' or ''}">
505                                 <label class="col-lg-3 control-label" for="contact_name">Fax</label>
506                                 <div class="col-lg-4">
507                                     <input type="tel" name="fax" class="form-control" t-att-value="checkout['fax']"/>
508                                 </div>
509                             </div>
510                             <div t-attf-class="form-group #{error.get('company') and 'has-error' or ''}">
511                                 <label class="col-lg-3 control-label" for="contact_name">Company</label>
512                                 <div class="col-lg-4">
513                                     <input type="text" name="company" class="form-control" t-att-value="checkout['company']"/>
514                                 </div>
515                             </div>
516                             <div t-attf-class="form-group #{error.get('email') and 'has-error' or ''}">
517                                 <label class="col-lg-3 control-label" for="contact_name">Email address</label>
518                                 <div class="col-lg-4">
519                                     <input type="email" name="email" class="form-control" t-att-value="checkout['email']"/>
520                                 </div>
521                             </div>
522                             <div t-attf-class="form-group #{error.get('street') and 'has-error' or ''}">
523                                 <label class="col-lg-3 control-label" for="contact_name">Street</label>
524                                 <div class="col-lg-4">
525                                     <input type="text" name="street" class="form-control" t-att-value="checkout['street']"/>
526                                 </div>
527                             </div>
528                             <div t-attf-class="form-group #{error.get('city') and 'has-error' or ''}">
529                                 <label class="col-lg-3 control-label" for="contact_name">City</label>
530                                 <div class="col-lg-4">
531                                     <input type="text" name="city" class="form-control" t-att-value="checkout['city']"/>
532                                 </div>
533                             </div>
534                             <div t-attf-class="form-group #{error.get('state_id') and 'has-error' or ''}">
535                                 <label class="col-lg-3 control-label" for="contact_name">State / Province</label>
536                                 <div class="col-lg-4">
537                                     <select name="state_id" class="form-control">
538                                         <option value="">State / Province...</option>
539                                         <t t-foreach="states or []" t-as="state">
540                                             <option t-att-value="state.id" t-att-selected="state.id == checkout['state_id']"><t t-esc="state.name"/></option>
541                                         </t>
542                                     </select>
543                                 </div>
544                             </div>
545                             <div t-attf-class="form-group #{error.get('zip') and 'has-error' or ''}">
546                                 <label class="col-lg-3 control-label" for="contact_name">Zip / Postal Code</label>
547                                 <div class="col-lg-4">
548                                     <input type="text" name="zip" class="form-control" t-att-value="checkout['zip']"/>
549                                 </div>
550                             </div>
551                             <div t-attf-class="form-group #{error.get('country_id') and 'has-error' or ''}">
552                                 <label class="col-lg-3 control-label" for="contact_name">Country</label>
553                                 <div class="col-lg-4">
554                                     <select name="country_id" class="form-control">
555                                         <option value="">Country...</option>
556                                         <t t-foreach="countries or []" t-as="country">
557                                             <option t-att-value="country.id" t-att-selected="country.id == checkout['country_id']"><t t-esc="country.name"/></option>
558                                         </t>
559                                     </select>
560                                 </div>
561                             </div>
562                             <div class="form-group checkbox">
563                                 <div class="col-lg-7 col-md-offset-3">
564                                     <label>
565                                         <input t-if="not shipping" type="checkbox" name="shipping_different"/>
566                                         <input t-if="shipping" type="checkbox" name="shipping_different" checked="1"/>
567                                         Ship to different address
568                                     </label>
569                                 </div>
570                             </div>
571                         </div>
572                         <div class="js_shipping row" t-att-style="not shipping and 'display:none' or ''">
573                             <h3 class="col-md-12 oe_shipping">Shipping Information</h3>
574                              <div t-attf-class="form-group #{error.get('shipping_name') and 'has-error' or ''}">
575                                 <label class="col-lg-3 control-label" for="contact_name">Name and firstname</label>
576                                 <div class="col-lg-4">
577                                     <input type="text" name="shipping_name" class="form-control" t-att-value="checkout.get('shipping_name', '')"/>
578                                 </div>
579                             </div>
580                             <div t-attf-class="form-group #{error.get('shipping_phone') and 'has-error' or ''}">
581                                 <label class="col-lg-3 control-label" for="contact_name">Telephone</label>
582                                 <div class="col-lg-4">
583                                     <input type="tel" name="shipping_phone" class="form-control" t-att-value="checkout.get('shipping_phone', '')"/>
584                                 </div>
585                             </div>
586                             <div t-attf-class="form-group #{error.get('shipping_fax') and 'has-error' or ''}">
587                                 <label class="col-lg-3 control-label" for="contact_name">Fax</label>
588                                 <div class="col-lg-4">
589                                     <input type="tel" name="shipping_fax" class="form-control" t-att-value="checkout.get('shipping_fax', '')"/>
590                                 </div>
591                             </div>
592                             <div t-attf-class="form-group #{error.get('shipping_street') and 'has-error' or ''}">
593                                 <label class="col-lg-3 control-label" for="contact_name">Street</label>
594                                 <div class="col-lg-4">
595                                     <input type="text" name="shipping_street" class="form-control" t-att-value="checkout.get('shipping_street', '')"/>
596                                 </div>
597                             </div>
598                             <div t-attf-class="form-group #{error.get('shipping_city') and 'has-error' or ''}">
599                                 <label class="col-lg-3 control-label" for="contact_name">City</label>
600                                 <div class="col-lg-4">
601                                     <input type="text" name="shipping_city" class="form-control" t-att-value="checkout.get('shipping_city', '')"/>
602                                 </div>
603                             </div>
604                             <div t-attf-class="form-group #{error.get('shipping_state_id') and 'has-error' or ''}">
605                                 <label class="col-lg-3 control-label" for="contact_name">State / Province</label>
606                                 <div class="col-lg-4">
607                                     <select name="shipping_state_id" class="form-control">
608                                         <option value="">State / Province...</option>
609                                         <t t-foreach="states or []" t-as="state">
610                                             <option t-att-value="state.id" t-att-selected="state.id == checkout.get('shipping_state_id')"><t t-esc="state.name"/></option>
611                                         </t>
612                                     </select>
613                                 </div>
614                             </div>
615                             <div t-attf-class="form-group #{error.get('shipping_zip') and 'has-error' or ''}">
616                                 <label class="col-lg-3 control-label" for="contact_name">Zip / Postal Code</label>
617                                 <div class="col-lg-4">
618                                     <input type="text" name="shipping_zip" class="form-control" t-att-value="checkout.get('shipping_zip', '')"/>
619                                 </div>
620                             </div>
621                             <div t-attf-class="form-group #{error.get('shipping_country_id') and 'has-error' or ''}">
622                                 <label class="col-lg-3 control-label" for="contact_name">Country</label>
623                                 <div class="col-lg-4">
624                                     <select name="shipping_country_id" class="form-control">
625                                         <option value="">Country...</option>
626                                         <t t-foreach="countries or []" t-as="country">
627                                             <option t-att-value="country.id" t-att-selected="country.id == checkout.get('shipping_country_id')"><t t-esc="country.name"/></option>
628                                         </t>
629                                     </select>
630                                 </div>
631                             </div>
632                         </div>
633                         <button type="submit" class="btn btn-default">Confirm</button>
634                     </form>
635                 </div>
636             </div>
637           </div>
638         </t>
639     </template>
640
641     <template id="payment">
642         <t t-call="website.layout">
643           <t t-set="head">
644               <script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
645               <t t-raw="head or ''"/>
646           </t>
647           <t t-set="title">Shop - Payment</t>
648           <div id="wrap">
649             <div class="container oe_website_sale">
650                 <div class="row">
651                     <div class="col-md-4">
652                         <table class="table table-condensed" t-if="order">
653                             <thead>
654                                 <tr>
655                                     <th>Product</th>
656                                     <th>Price</th>
657                                     <th>Qty.</th>
658                                 </tr>
659                             </thead>
660                             <tbody t-if="website_sale_order.order_line">
661                                 <t t-foreach="website_sale_order.order_line" t-as="line">
662                                     <tr>
663                                         <td><t t-esc="line.name"/></td>
664                                         <td><t t-esc="line.product_uom_qty"/></td>
665                                         <td><t t-esc="line.price_unit"/> €</td>
666                                     </tr>
667                                 </t>
668                             </tbody>
669                             <tfoot>
670                                 <tr><th>Untaxed Amount</th><td></td><td><t t-esc="website_sale_order.amount_untaxed"/> €</td></tr>
671                                 <tr><th>Taxes</th><td></td><td><t t-esc="website_sale_order.amount_tax"/> €</td></tr>
672                                 <tr><th>Total</th><td></td><td><t t-esc="website_sale_order.amount_total"/> €</td></tr>
673                             </tfoot>
674                         </table>
675                     </div>
676                     <div class="col-md-8">
677                         <div class="js_payment row">
678                             <h3 class="col-md-12">Click on your payment method</h3>
679                             <div class="col-md-2">
680                                 <t t-foreach="payments or []" t-as="payment">
681                                     <label>
682                                         <input t-att-value="payment.id" type="radio" name="payment_type"/> <t t-esc="payment.name"/>
683                                     </label>
684                                 </t>
685                             </div>
686                             <t t-foreach="payments or []" t-as="payment">
687                                 <div t-att-data-id="payment.id" t-raw="payment._content" class="hidden col-md-6"/>
688                             </t>
689                             <a href="/shop/payment_validate/" class="hidden btn btn-default">I validate my payment</a>
690                         </div>
691                     </div>
692                 </div>
693             </div>
694           </div>
695         </t>
696     </template>
697  </data>
698 </openerp>