[MERGE] Sync with website-al
[odoo/odoo.git] / addons / website_sale / views / website_sale.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3 <data>
4
5     <!-- Layout add nav and footer -->
6
7     <template id="header" inherit_id="website.layout" name="Custom Header">
8         <xpath expr="//header//ul[@id='top_menu']/li" position="before">
9             <li><a t-href="/shop/">Shop</a></li>
10             <li t-att-class="(not website_sale_order or not website_sale_order.get_total_quantity()) and 'hidden' or ''">
11                 <a t-href="/shop/mycart/">
12                     <i class="icon-shopping-cart"></i>
13                     My cart <sup t-attf-class="my_cart_quantity label label-primary"
14                                   t-esc="website_sale_order and website_sale_order.get_total_quantity() or ''"/>
15                 </a>
16             </li>
17         </xpath>
18     </template>
19
20     <!-- List of categories -->
21
22     <template id="categories_recursive" name="Category list">
23         <li t-att-class="category.id == search.get('category') and 'active' or ''">
24             <a t-att-class="category.id not in categ[1] and 'unpublish' or ''" t-href="/shop/?category=#{ category.id }" t-field="category.name" t-keep-query="search,facettes"></a>
25             <ul t-if="category.child_id" class="nav nav-pills nav-stacked nav-hierarchy">
26                 <t t-foreach="category.child_id" t-as="category">
27                     <t t-if="category.id in categ[1] or editable">
28                         <t t-call="website_sale.categories_recursive"/>
29                     </t>
30                 </t>
31             </ul>
32         </li>
33     </template>
34
35     <!-- Product list -->
36
37     <template id="products_cart" name="Shopping cart">
38       <div class="ribbon-wrapper">
39         <div class="ribbon">Promo</div>
40       </div>
41       <div class="oe_product_description">
42           <a t-href="/shop/product/#{ product.id }/" t-keep-query="category,search,facettes">
43               <b t-field="product.name"/>
44           </a>
45       </div>
46       <div class="product_price" t-if="product.product_variant_ids">
47           <b>
48               <t t-if="product.product_variant_ids[0].lst_price != product.product_variant_ids[0].price">
49                 <del class="text-danger"
50                   t-field="product.product_variant_ids[0].lst_price" t-field-options='{
51                        "widget": "monetary",
52                        "display_currency": "website.pricelist_id.currency_id"
53                   }'/>&amp;nbsp;
54               </t>
55               <span t-field="product.product_variant_ids[0].price"  t-field-options='{
56                    "widget": "monetary",
57                    "display_currency": "website.pricelist_id.currency_id"
58                }'/>
59           </b>
60       </div>
61       <div class="oe_product_image text-center">
62           <a t-href="/shop/product/#{ product.id }/" t-keep-query="category,search,facettes">
63               <span t-field="product.image" t-field-options='{"widget": "image"}'/>
64           </a>
65       </div>
66     </template>
67
68     <template id="products" name="Products" page="True">
69         <t t-call="website.layout">
70             <t t-set="head">
71                 <script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
72                 <link rel='stylesheet' href='/website_sale/static/src/css/website_sale.css'/>
73                 <t t-raw="head or ''"/>
74             </t>
75             <t t-set="additional_title">Shop</t>
76             <div id="wrap">
77               <div class="oe_structure"/>
78               <div class="container oe_website_sale">
79                 <div class="row">
80                     <div class="col-sm-6 pagination" style="padding-left: 15px;">
81                         <a t-if="editable" t-href="/shop/add_product/" class="btn btn-primary btn-default" t-keep-query="category,search,facettes">New Product</a>
82                     </div>
83                     <div class="col-sm-6">
84                         <t t-call="website.pager">
85                             <t t-set="classname">pull-right</t>
86                         </t>
87                         <form t-action="/shop/" method="get" class="pull-right pagination form-inline" style="padding-right: 5px;" t-keep-query="category,search,facettes">
88                             <div class="form-group">
89                                 <input type="text" name="search" class="search-query form-control" placeholder="Search..." t-att-value="search.get('search') or ''"/>
90                             </div>
91                         </form>
92                     </div>
93                 </div>
94
95                 <div class='style_default row'>
96                   <div class="col-md-12" id="products_grid">
97                     <table width="100%">
98                       <tbody>
99                         <t t-set="table_products" t-value="Ecommerce.get_bin_packing_products(product_ids, product_ids_for_holes, 4)"/>
100                         <tr t-foreach="table_products" t-as="tr_product">
101                           <t t-foreach="tr_product" t-as="td_product">
102                             <t t-if="td_product">
103                             <t t-set="product" t-value="td_product['product']"/>
104                             <td t-att-colspan="td_product['x']"
105                                 t-attf-width="#{td_product['x']*25}%"
106                                 t-att-rowspan="td_product['y']"
107                                 t-attf-class="oe_product oe-height-#{td_product['y']*2} #{ td_product['class'] }">
108
109                                 <div class="oe_product_cart" t-att-data-publish="product.website_published and 'on' or 'off'">
110
111                                   <div class="css_options" t-ignore="true" t-if="editable">
112                                     <div t-attf-class="dropdown js_options" t-att-data-id="product.id">
113                                       <a class="btn btn-default" t-att-id="'dopprod-%s' % product.id" role="button" data-toggle="dropdown">Options <span class="caret"></span></a>
114                                       <ul class="dropdown-menu" role="menu" t-att-aria-labelledby="'dopprod-%s' % product.id">
115                                         <li class='dropdown-submenu'>
116                                           <a tabindex="-1" href="#">Size</a>
117                                           <ul class="dropdown-menu" name="size">
118                                             <li><a href="#">
119                                               <table>
120                                                 <tr>
121                                                   <td class="selected"></td>
122                                                   <td t-att-class="product.website_size_x > 1 and 'selected'"></td>
123                                                   <td t-att-class="product.website_size_x > 2 and 'selected'"></td>
124                                                   <td t-att-class="product.website_size_x > 3 and 'selected'"></td>
125                                                 </tr>
126                                                 <tr>
127                                                   <td t-att-class="product.website_size_y > 1 and 'selected'"></td>
128                                                   <td t-att-class="product.website_size_y > 1 and product.website_size_x > 1 and 'selected'"></td>
129                                                   <td t-att-class="product.website_size_y > 1 and product.website_size_x > 2 and 'selected'"></td>
130                                                   <td t-att-class="product.website_size_y > 1 and product.website_size_x > 3 and 'selected'"></td>
131                                                 </tr>
132                                                 <tr>
133                                                   <td t-att-class="product.website_size_y > 2 and 'selected'"></td>
134                                                   <td t-att-class="product.website_size_y > 2 and product.website_size_x > 1 and 'selected'"></td>
135                                                   <td t-att-class="product.website_size_y > 2 and product.website_size_x > 2 and 'selected'"></td>
136                                                   <td t-att-class="product.website_size_y > 2 and product.website_size_x > 3 and 'selected'"></td>
137                                                 </tr>
138                                                 <tr>
139                                                   <td t-att-class="product.website_size_y > 3 and 'selected'"></td>
140                                                   <td t-att-class="product.website_size_y > 3 and product.website_size_x > 1 and 'selected'"></td>
141                                                   <td t-att-class="product.website_size_y > 3 and product.website_size_x > 2 and 'selected'"></td>
142                                                   <td t-att-class="product.website_size_y > 3 and product.website_size_x > 3 and 'selected'"></td>
143                                                 </tr>
144                                               </table>
145                                             </a></li>
146                                           </ul>
147                                         </li>
148                                         <li class='dropdown-submenu'>
149                                           <a tabindex="-1" href="#">Styles</a>
150                                           <ul class="dropdown-menu" name="style">
151                                             <t t-foreach="styles" t-as="style">
152                                               <li t-att-class="style_in_product(style, product) and 'active' or ''"><a href="#" t-att-data-id="style.id" t-att-data-class="style.html_class"><t t-esc="style.name"/></a></li>
153                                             </t>
154                                           </ul>
155                                         </li>
156                                       </ul>
157                                     </div>
158                                   </div>
159
160                                   <t t-call="website_sale.products_cart"/>
161                                 </div>
162
163                             </td>
164                             </t>
165                             <td t-if="td_product == None"/>
166                           </t>
167                         </tr>
168                       </tbody>
169                     </table>
170                   </div>
171                 </div>
172                 <div>
173                     <t t-call="website.pager">
174                         <t t-set="classname">pull-right</t>
175                     </t>
176                 </div>
177               </div>
178               <div class="oe_structure mb32"/>
179             </div>
180         </t>
181     </template>
182
183     <!-- Product Description-->
184
185     <template id="product_description" inherit_option_id="website_sale.products_cart" name="Product Description">
186         <xpath expr="//div[@class='oe_product_description']" position="inside">
187             <p class="text-muted oe_subdescription">
188                 <span t-field="product.description_sale"/>
189             </p>
190         </xpath>
191     </template>
192
193     <!-- Add to cart button-->
194
195     <template id="add_to_basket" inherit_option_id="website_sale.products_cart" name="Add to Cart">
196         <xpath expr="//div[@class='product_price']" position="inside">
197             <a t-href="./add_cart/?product_id=#{ product.id }" class="js_add_cart_json">
198                 <span class="icon-shopping-cart"/>
199             </a>
200         </xpath>
201     </template>
202
203     <!-- List view of products -->
204
205     <template id="list_view" inherit_option_id="website_sale.products" name="List View">
206         <xpath expr="//div[@id='products_grid']/table" position="replace">
207           <div class="row">
208             <t t-set="products" t-value="Ecommerce.get_products(product_ids)"/>
209             <t t-foreach="products" t-as="product">
210               <div class="col-md-12 oe_list_products oe-height-1">
211                 <t t-call="website_sale.products_cart"/>
212               </div>
213             </t>
214           </div>
215         </xpath>
216     </template>
217
218
219     <!-- product -->
220
221     <template id="product" name="Product">
222         <t t-call="website.layout">
223             <t t-set="head">
224                 <script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
225             </t>
226             <t t-set="additional_title" t-value="product.name"/>
227             <div id="wrap">
228
229               <section class="container mt8">
230                 <div class="row">
231                   <div class="col-sm-5">
232                       <ol class="breadcrumb">
233                           <li><a t-href="/shop">Products</a></li>
234                           <li t-if="search.get('category')"><a t-href="/shop/" t-keep-query="category,search,facettes"><span t-field="category.name"/></a></li>
235                           <li class="active"><span t-field="product.name"></span></li>
236                       </ol>
237                   </div><div class="col-sm-3">
238                       <t t-call="website.publish_management">
239                         <t t-set="object" t-value="product"/>
240                         <t t-set="publish_edit" t-value="True"/>
241                         <li class='dropdown-submenu'>
242                             <a tabindex="-1" href="#">Promote</a>
243                             <ul class="dropdown-menu" name="sequence">
244                                 <li><a href="#" class="js_go_to_top">Push to top</a></li>
245                                 <li><a href="#" class="js_go_to_bottom">Push to bottom</a></li>
246                             </ul>
247                         </li>
248                       </t>
249                   </div><div class="col-sm-3 col-sm-offset-1">
250                       <form t-action="/shop/" method="get" class="pull-right" t-keep-query="category,facettes">
251                           <div class="input-group">
252                               <t t-if="search">
253                               <t foreach="search.items()" t-as="key">
254                                   <input t-att-name="key[0]" t-att-value="key[1]"/>
255                               </t>
256                               </t>
257                               <span class="input-group-addon"><span class="glyphicon glyphicon-search"/></span>
258                               <input type="text" name="search" class="search-query form-control" placeholder="Search..." t-att-value="search or ''"/>
259                           </div>
260                       </form>
261                   </div>
262                 </div>
263               </section>
264
265               <section class="container oe_website_sale mb16" id="product_detail">
266                 <div class="row">
267                   <div class="col-sm-7 col-md-7 col-lg-7">
268                       <span t-field="product.image" style="max-height: 500px" t-field-options='{"widget": "image"}'/>
269                   </div><div class="col-sm-5 col-md-5 col-lg-4 col-lg-offset-1">
270                       <h1 t-field="product.name">Product Name</h1>
271
272                       <form t-action="./add_cart/" class="js_add_cart_json">
273                           <input type="hidden" t-if="len(product.product_variant_ids) &lt;= 1" name="product_id" t-att-value="product.id"/>
274                           <t t-if="len(product.product_variant_ids) &gt; 1">
275                               <label label-default="label-default" class="radio" t-foreach="product.product_variant_ids" t-as="product">
276                                   <input type="radio" name="product_id" t-att-value="product.id" t-att-checked="product == product.product_variant_ids[0] or None"/>
277                                   <t t-esc="product.variants or ''">Standard</t>
278                                   <span class="badge" t-if="product.price_extra">
279                                       <t t-esc="product.price_extra > 0 and '+' or ''"/><span t-field="product.price_extra" t-field-options='{
280                                                    "widget": "monetary",
281                                                    "display_currency": "website.pricelist_id.currency_id"
282                                                }'/>
283                                   </span>
284                               </label>
285                               <br/>
286                           </t>
287
288                           <div class="product_price mt16" t-if="product.product_variant_ids">
289                               <h4>
290                                   <b><span class="oe_price" t-esc="product.product_variant_ids[0].price" /> â‚¬</b>
291                                   <t t-if="product.product_variant_ids[0].lst_price != product.product_variant_ids[0].price">
292                                   <span class="text-danger" style="text-decoration: line-through;"
293                                     t-field="product.product_variant_ids[0].lst_price"
294                                     t-field-options='{
295                                        "widget": "monetary",
296                                        "display_currency": "website.pricelist_id.currency_id"
297                                    }'/><br/>
298                                   </t>
299                                   <b class="oe_price"
300                                     t-field="product.product_variant_ids[0].price"
301                                     t-field-options='{
302                                        "widget": "monetary",
303                                        "display_currency": "website.pricelist_id.currency_id"
304                                    }'/>
305                               </h4>
306                           </div>
307                           <button class="btn btn-primary btn-lg mt8">Add to Cart</button>
308                           <hr t-if="product.description_sale"/>
309                           <p t-field="product.description_sale" class="text-muted"/>
310                           <hr/>
311                           <p class="text-muted">
312                               30-day money-back guarantee<br/>
313                               Free Shipping in U.S.<br/>
314                               Buy now, get in 2 days
315                           </p>
316                       </form>
317                   </div>
318                 </div>
319               </section>
320               <div t-field="product.website_description" class="oe_structure" id="product_full_description"/>
321             </div>
322         </t>
323     </template>
324
325     <template id="recommended_products" inherit_id="website_sale.product" inherit_option_id="website_sale.product" name="Recommended Products">
326         <xpath expr="//div[@id='product_full_description']" position="after">
327             <div class="container mt32" t-if="product.recommended_products()">
328                 <h3>Customers who have bought this product also bought:</h3>
329                 <div class='row mt16' style="margin-left: 15px !important;">
330                 <t t-foreach="product.recommended_products()" t-as="product">
331                     <div class='col-md-2 thumbnail' style='width: 170px; margin-right: 16px;'>
332                         <div class='mt16 text-center'>
333                             <span t-field="product.image_small"/>
334                             <h5>
335                                 <a t-href="/shop/product/#{ product.id }/"
336                                    style="display: block">
337                                     <span t-field='product.name'
338                                           style="display: block"/>
339                                 </a>
340                             </h5>
341                         </div>
342                     </div>
343                 </t>
344                 </div>
345             </div>
346         </xpath>
347     </template>
348
349     <!-- Page Shop my cart -->
350
351     <template id="mycart" name="Your Cart" page="True">
352         <t t-call="website.layout">
353             <t t-set="head">
354                 <script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
355                 <link rel='stylesheet' href='/website_sale/static/src/css/website_sale.css'/>
356                 <t t-raw="head or ''"/>
357             </t>
358             <div id="wrap">
359               <div class="container oe_website_sale">
360
361                 <ul class="wizard pull-right">
362                     <li class="text-primary">Review Order<span class="chevron"></span></li>
363                     <li class="text-muted">Shipping &amp; Billing<span class="chevron"></span></li>
364                     <li class="text-muted">Payment<span class="chevron"></span></li>
365                     <li class="text-muted">Confirmation<span class="chevron"></span></li>
366                 </ul>
367                 <h1 class="mb32">Shopping Cart</h1>
368                 <div class="row">
369                     <div class="col-md-3 text-muted" id="right_column">
370                         <h4>Policies</h4>
371                         <ul class="list-unstyled mb32">
372                             <li>&#9745; 30-days money-back guarantee</li>
373                             <li>&#9745; Invoice sent by e-Mail</li>
374                         </ul>
375                         <h4>Secure Payment</h4>
376                         <ul class="list-unstyled mb32">
377                             <li>&#9745; 256 bit encryption</li>
378                             <li>&#9745; Processed by Ogone</li>
379                         </ul>
380                     </div>
381                     <div class="col-md-8 col-md-offset-1 oe_mycart">
382                         <div t-if="not website_sale_order or not website_sale_order.order_line" class="well well-lg">
383                             Your cart is empty!
384                         </div>
385                         <table class='table table-striped table-condensed' id="mycart_products" t-if="website_sale_order and website_sale_order.order_line">
386                             <colgroup>
387                                 <col width="80"/>
388                                 <col/>
389                                 <col width="100"/>
390                                 <col width="120"/>
391                             </colgroup>
392                             <thead>
393                                 <tr>
394                                     <th colspan="2">Product</th>
395                                     <th>Price</th>
396                                     <th>Quantity</th>
397                                 </tr>
398                             </thead>
399                             <tbody>
400                                 <tr t-foreach="website_sale_order.order_line" t-as="line">
401                                     <td colspan="2" t-if="not line.product_id.product_tmpl_id"></td>
402                                     <td t-if="line.product_id.product_tmpl_id">
403                                         <span t-field="line.product_id.image_small"
404                                               t-field-options='{"widget": "image", "class": "img-rounded"}'/>
405                                     </td>
406                                     <td t-if="line.product_id.product_tmpl_id">
407                                         <div>
408                                             <a t-href="/shop/product/#{ line.product_id.product_tmpl_id.id }/">
409                                                 <strong t-field="line.product_id.name"/>
410                                             </a>
411                                         </div>
412                                         <div class="text-muted" t-field="line.product_id.description_sale"/>
413                                     </td>
414                                     <td class="text-center">
415                                        <del class="text-danger" t-if="line.product_id.lst_price &gt; line.price_unit">
416                                            <span t-field="line.product_id.lst_price" t-field-options='{
417                                                "widget": "monetary",
418                                                "display_currency": "website.pricelist_id.currency_id"
419                                            }'/>
420                                        </del>
421                                        <span t-field="line.price_unit" t-field-options='{
422                                            "widget": "monetary",
423                                            "display_currency": "website.pricelist_id.currency_id"
424                                        }'/>
425                                     </td>
426                                     <td>
427                                         <div class="input-group">
428                                             <span class="input-group-addon">
429                                                 <a t-href="./remove_cart/?order_line_id=#{ line.id }" t-att-data-id="line.id" class="mb8 js_add_cart_json">
430                                                     <span class="icon-minus"/>
431                                                 </a>
432                                             </span>
433                                             <input type="text" class="js_quantity form-control"
434                                                 t-att-data-id="line.id" t-att-value="int(line.product_uom_qty)"/>
435                                             <span class="input-group-addon">
436                                                 <a t-href="./add_cart/?order_line_id=#{ line.id }" t-att-data-id="line.id" class="mb8 float_left js_add_cart_json">
437                                                     <span class="icon-plus"/>
438                                                 </a>
439                                             </span>
440                                         </div>
441
442                                     </td>
443                                 </tr>
444                             </tbody>
445                         </table>
446                         <table class='pull-right mb16' id="mycart_total">
447                             <colgroup>
448                                 <col width="100"/>
449                                 <col width="120"/>
450                             </colgroup>
451                             <thead>
452                                 <tr style="border-top: 1px solid #000">
453                                     <th><h3>Total:</h3></th>
454                                     <th class="text-right"><h3>
455                                         <span t-field="website_sale_order.amount_total" t-field-options='{
456                                             "widget": "monetary",
457                                             "display_currency": "website.pricelist_id.currency_id"
458                                         }'/></h3>
459                                     </th>
460                                 </tr>
461                                 <tr class="text-muted">
462                                     <td><abbr title="Taxes may be updated after providing shipping address">Incl. Taxes:</abbr></td>
463                                     <td class="text-right">
464                                         <span t-field="website_sale_order.amount_tax" t-field-options='{
465                                             "widget": "monetary",
466                                             "display_currency": "website.pricelist_id.currency_id"
467                                         }'/>
468                                     </td>
469                                 </tr>
470                             </thead>
471                         </table>
472                         <div class="clearfix"/>
473                         <a t-href="/shop" class="btn btn-default mb32"><span class="icon-long-arrow-left"/> Continue Shopping</a>
474                         <a t-if="website_sale_order and website_sale_order.order_line" t-href="/shop/checkout/" class="btn btn-primary pull-right mb32">Process Checkout <span class="icon-long-arrow-right"/></a>
475                         <div class="oe_structure"/>
476                     </div>
477                 </div>
478
479               </div>
480               <div class="oe_structure"/>
481             </div>
482         </t>
483     </template>
484
485     <!-- Page Shop -->
486
487     <template id="products_categories" inherit_option_id="website_sale.products" name="Product Categories">
488         <xpath expr="//div[@id='products_grid']" position="before">
489             <div id="categories" class="col-md-3">
490                 <ul class="nav nav-pills nav-stacked mt16">
491                     <li t-att-class=" '' if search.get('category') else 'active' "><a t-href="/shop/">All Products</a></li>
492                     <t t-set="categ" t-value="Ecommerce.get_categories()"/>
493                     <t t-foreach="categ[0]" t-as="category">
494                         <t t-call="website_sale.categories_recursive"/>
495                     </t>
496                 </ul>
497             </div>
498         </xpath>
499         <xpath expr="//div[@id='products_grid']" position="attributes">
500             <attribute name="class">col-md-9</attribute>
501         </xpath>
502     </template>
503
504     <template id="products_attributes" inherit_option_id="website_sale.products_categories" name="Product Attributes">
505         <xpath expr="//div[@id='categories']" position="inside">
506             <form t-action="/shop/attributes/" method="post" t-keep-query="category,search">
507                 <ul class="nav nav-pills nav-stacked mt16">
508                     <t t-set="attribute_ids" t-value="Ecommerce.get_attribute_ids()"/>
509                     <t t-foreach="attribute_ids" t-as="attribute_id">
510                         <li t-if="attribute_id.value_ids and attribute_id.type == 'distinct'">
511                             <div t-field="attribute_id.name"/>
512                             <ul class="nav nav-pills nav-stacked">
513                                 <t t-foreach="attribute_id.value_ids" t-as="value_id">
514                                     <li t-att-class="Ecommerce.has_search_attributes(attribute_id.id, value_id.id) and 'active' or ''">
515                                         <label style="margin: 0 20px;">
516                                             <input type="checkbox" t-att-name="'att-%s-%s' % (attribute_id.id, value_id.id)"
517                                                 t-att-checked="Ecommerce.has_search_attributes(attribute_id.id, value_id.id) and 'checked' or ''"/>
518                                             <span style="font-weight: normal" t-field="value_id.name"/>
519                                         </label>
520                                     </li>
521                                 </t>
522                             </ul>
523                         </li>
524                         <li t-if="attribute_id.type == 'float' and attribute_id.float_min != attribute_id.float_max">
525                             <div t-field="attribute_id.name"/>
526                             <t t-set="attribute" t-value="Ecommerce.has_search_attributes(attribute_id.id)"/>
527                             <div style="margin: 0 20px;" class="js_slider"
528                               t-att-data-id="attribute_id.id"
529                               t-att-data-value-min="attribute and attribute[1][0] or attribute_id.float_min"
530                               t-att-data-value-max="attribute and attribute[1][1] or attribute_id.float_max"
531                               t-att-data-min="attribute_id.float_min"
532                               t-att-data-max="attribute_id.float_max"></div>
533                         </li>
534                     </t>
535                 </ul>
536                 <button class="btn btn-xs btn-primary mt16">Apply filter</button>
537             </form>
538         </xpath>
539     </template>
540
541     <template id="suggested_products_list" inherit_id="website_sale.mycart" inherit_option_id="website_sale.mycart" name="Suggested Products in list view">
542         <xpath expr="//table[@id='mycart_products']" position="after">
543             <table t-if="suggested_products" class='table table-striped table-condensed'>
544                 <colgroup>
545                     <col width="80"/>
546                     <col/>
547                     <col width="100"/>
548                     <col width="120"/>
549                 </colgroup>
550                 <thead>
551                     <tr>
552                         <th colspan="2">Suggested products</th>
553                     </tr>
554                 </thead>
555                 <tbody>
556                     <tr t-foreach="suggested_products" t-as="product">
557
558                         <td>
559                             <a t-href="/shop/product/#{ product.product_tmpl_id.id }/">
560                                 <span t-field="product.image_small"
561                                       t-field-options='{"widget": "image", "class": "img-rounded"}'/>
562                             </a>
563                         </td>
564                         <td>
565                             <div>
566                                 <a t-href="/shop/product/#{ product.product_tmpl_id.id }/">
567                                     <strong t-field="product.name"/>
568                                 </a>
569                             </div>
570                             <div class="text-muted" t-field="product.description_sale"/>
571                         </td>
572                         <td>
573                             <span t-field="product.lst_price" t-field-options='{
574                                 "widget": "monetary",
575                                 "display_currency": "website.pricelist_id.currency_id"
576                             }'/>
577                         </td>
578                         <td class="text-center">
579                             <a t-href="./add_cart/?product_id=#{ product.id }"><strong>Add to Cart</strong></a>
580                         </td>
581                     </tr>
582                 </tbody>
583             </table>
584         </xpath>
585     </template>
586
587     <template id="reduction_code" inherit_option_id="website_sale.mycart" name="Reduction Code">
588         <xpath expr="//div[@id='right_column']" position="inside">
589             <h4>Coupon Code</h4>
590             <p>
591                 Have a coupon code? Fill in this field and apply.
592             </p>
593             <form t-if="website_sale_order and website_sale_order.order_line" t-action="/shop/mycart/" method="post" class="mb32">
594                 <div class="input-group">
595                     <input name="promo" class='form-control' type="text" placeholder="code..." t-att-value="website_sale_order.pricelist_id.code or ''"/>
596                     <div class="input-group-btn">
597                         <button class="btn btn-default">Apply</button>
598                     </div>
599                 </div>
600             </form>
601         </xpath>
602     </template>
603
604
605     <!-- Page confirm my cart -->
606
607     <template id="checkout">
608         <t t-call="website.layout">
609           <t t-set="head">
610               <script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
611               <link rel='stylesheet' href='/website_sale/static/src/css/website_sale.css'/>
612               <t t-raw="head or ''"/>
613           </t>
614           <t t-set="additional_title">Shop - Checkout</t>
615           <div id="wrap">
616             <div class="container oe_website_sale">
617                 <ul class="wizard pull-right">
618                     <li><a href="/shop/mycart" class="text-success">Review Order<span class="chevron"></span></a></li>
619                     <li class="text-primary">Shipping &amp; Billing<span class="chevron"></span></li>
620                     <li class="text-muted">Payment<span class="chevron"></span></li>
621                     <li class="text-muted">Confirmation<span class="chevron"></span></li>
622                 </ul>
623                 <h1>Your Address</h1>
624                 <form t-action="/shop/confirm_order/" method="post">
625
626                 <div class="row">
627                 <div class="col-md-8 oe_mycart">
628                     <h3 class="page-header mt16">Billing Information
629                         <small t-if="user_id.id == website.public_user.id"> or
630                             <a t-if="not partner" t-attf-href="/web#action=redirect&amp;url=#{ request.httprequest.host_url }/shop/checkout/">sign in</a>
631                         </small>
632                     </h3>
633                         <div class="row">
634                             <div t-attf-class="form-group #{error.get('name') and 'has-error' or ''} col-lg-6">
635                                 <label class="control-label" for="contact_name">Your Name</label>
636                                 <input type="text" name="name" class="form-control" t-att-value="checkout.get('name')"/>
637                             </div>
638                             <div t-attf-class="form-group #{error.get('company') and 'has-error' or ''} col-lg-6">
639                                 <label class="control-label" for="company" style="font-weight: normal">Your Company</label>
640                                 <input type="text" name="company" class="form-control" t-att-value="checkout.get('company')"/>
641                             </div>
642                             <div t-attf-class="form-group #{error.get('email') and 'has-error' or ''} col-lg-6">
643                                 <label class="control-label" for="contact_name">Email</label>
644                                 <input type="email" name="email" class="form-control" t-att-value="checkout.get('email')"/>
645                             </div>
646                             <div t-attf-class="form-group #{ error.get('phone') and 'has-error' or ''} col-lg-6">
647                                 <label class="control-label" for="phone">Telephone</label>
648                                 <input type="tel" name="phone" class="form-control" t-att-value="checkout.get('phone')"/>
649                             </div>
650
651                             <div t-attf-class="form-group #{error.get('street') and 'has-error' or ''} col-lg-6">
652                                 <label class="control-label" for="street">Street</label>
653                                 <input type="text" name="street" class="form-control" t-att-value="checkout.get('street')"/>
654                             </div>
655                             <div class="clearfix"/>
656
657                             <div t-attf-class="form-group #{error.get('city') and 'has-error' or ''} col-lg-6">
658                                 <label class="control-label" for="city">City</label>
659                                 <input type="text" name="city" class="form-control" t-att-value="checkout.get('city')"/>
660                             </div>
661                             <div t-attf-class="form-group #{error.get('zip') and 'has-error' or ''} col-lg-6">
662                                 <label class="control-label" for="zip">Zip / Postal Code</label>
663                                 <input type="text" name="zip" class="form-control" t-att-value="checkout.get('zip')"/>
664                             </div>
665                             <div t-attf-class="form-group #{error.get('state_id') and 'has-error' or ''} col-lg-6">
666                                 <label class="control-label" for="state_id" style="font-weight: normal">State / Province</label>
667                                 <select name="state_id" class="form-control">
668                                     <option value="">select...</option>
669                                     <t t-foreach="states or []" t-as="state">
670                                         <option t-att-value="state.id" t-att-selected="state.id == checkout.get('state_id')"><t t-esc="state.name"/></option>
671                                     </t>
672                                 </select>
673                             </div>
674                             <div t-attf-class="form-group #{error.get('country_id') and 'has-error' or ''} col-lg-6">
675                                 <label class="control-label" for="contact_name">Country</label>
676                                 <select name="country_id" class="form-control">
677                                     <option value="">Country...</option>
678                                     <t t-foreach="countries or []" t-as="country">
679                                         <option t-att-value="country.id" t-att-selected="country.id == checkout.get('country_id')"><t t-esc="country.name"/></option>
680                                     </t>
681                                 </select>
682                             </div>
683
684                             <div class="clearfix"/>
685
686                             <div class="form-group col-lg-6">
687                                 <label>
688                                     <input t-if="not shipping" type="checkbox" name="shipping_different"/>
689                                     <input t-if="shipping" type="checkbox" name="shipping_different" checked="1"/>
690                                     Ship to a different address
691                                 </label>
692                             </div>
693                         </div>
694
695                         <div class="js_shipping row mb16" t-att-style="not shipping and 'display:none' or ''">
696                             <h3 class="oe_shipping col-lg-12 mt16">Shipping Information</h3>
697
698                             <div t-attf-class="form-group #{error.get('shipping_name') and 'has-error' or ''} col-lg-6">
699                                 <label class="control-label" for="contact_name">Name (Shipping)</label>
700                                 <input type="text" name="shipping_name" class="form-control" t-att-value="checkout.get('shipping_name', '')"/>
701                             </div>
702                             <div t-attf-class="form-group #{error.get('shipping_phone') and 'has-error' or ''} col-lg-6">
703                                 <label class="control-label" for="contact_name">Telephone</label>
704                                 <input type="tel" name="shipping_phone" class="form-control" t-att-value="checkout.get('shipping_phone', '')"/>
705                             </div>
706                             <div t-attf-class="form-group #{error.get('shipping_street') and 'has-error' or ''} col-lg-6">
707                                 <label class="control-label" for="contact_name">Street</label>
708                                 <input type="text" name="shipping_street" class="form-control" t-att-value="checkout.get('shipping_street', '')"/>
709                             </div>
710                             <div class="clearfix"/>
711                             <div t-attf-class="form-group #{error.get('shipping_city') and 'has-error' or ''} col-lg-6">
712                                 <label class="control-label" for="contact_name">City</label>
713                                 <input type="text" name="shipping_city" class="form-control" t-att-value="checkout.get('shipping_city', '')"/>
714                             </div>
715                             <div t-attf-class="form-group #{error.get('shipping_zip') and 'has-error' or ''} col-lg-6">
716                                 <label class="control-label" for="contact_name">Zip / Postal Code</label>
717                                 <input type="text" name="shipping_zip" class="form-control" t-att-value="checkout.get('shipping_zip', '')"/>
718                             </div>
719                             <div t-attf-class="form-group #{error.get('shipping_state_id') and 'has-error' or ''} col-lg-6">
720                                 <label class="control-label" for="contact_name" style="font-weight: normal">State / Province</label>
721                                 <select name="shipping_state_id" class="form-control">
722                                     <option value="">State / Province...</option>
723                                     <t t-foreach="states or []" t-as="state">
724                                         <option t-att-value="state.id" t-att-selected="state.id == checkout.get('shipping_state_id')"><t t-esc="state.name"/></option>
725                                     </t>
726                                 </select>
727                             </div>
728                             <div t-attf-class="form-group #{error.get('shipping_country_id') and 'has-error' or ''} col-lg-6">
729                                 <label class="control-label" for="contact_name">Country</label>
730                                 <select name="shipping_country_id" class="form-control">
731                                     <option value="">Country...</option>
732                                     <t t-foreach="countries or []" t-as="country">
733                                         <option t-att-value="country.id" t-att-selected="country.id == checkout.get('shipping_country_id')"><t t-esc="country.name"/></option>
734                                     </t>
735                                 </select>
736                             </div>
737                         </div>
738                         <button type="submit" class="btn btn-default btn-primary pull-right mb32">Confirm <span class="icon-long-arrow-right"/></button>
739                 </div>
740                 <div class="col-lg-offset-1 col-lg-3 text-muted">
741                     <h3 class="page-header mt16">Your Order <small><a href="/shop/mycart"><span class="icon-arrow-right"/> change</a></small></h3>
742                     <div class="row">
743                         <div class="col-sm-6 text-right">Subtotal:</div>
744                         <div class="col-sm-6"><span t-esc="website_sale_order.amount_untaxed" t-field-options='{
745                             "widget": "monetary",
746                             "display_currency": "website.pricelist_id.currency_id"
747                         }'/></div>
748                         <div class="col-sm-6 text-right">Taxes:</div>
749                         <div class="col-sm-6"><span t-field="website_sale_order.amount_tax" t-field-options='{
750                             "widget": "monetary",
751                             "display_currency": "website.pricelist_id.currency_id"
752                         }'/></div>
753                         <div class="col-sm-6 text-right"><h4>Total To Pay:</h4></div>
754                         <div class="col-sm-6"><h4><span t-field="website_sale_order.amount_total" t-field-options='{
755                             "widget": "monetary",
756                             "display_currency": "website.pricelist_id.currency_id"
757                         }'/></h4></div>
758                     </div>
759                 </div>
760             </div>
761             </form>
762           </div>
763           </div>
764         </t>
765     </template>
766
767     <template id="payment">
768         <t t-call="website.layout">
769             <t t-set="head">
770                 <script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
771                 <link rel='stylesheet' href='/website_sale/static/src/css/website_sale.css'/>
772                 <t t-raw="head or ''"/>
773             </t>
774             <t t-set="additional_title">Shop - Select Payment Mode</t>
775             <div id="wrap">
776               <div class="container oe_website_sale">
777
778                 <ul class="wizard pull-right">
779                     <li><a href="/shop/mycart" class="text-success">Review Order<span class="chevron"></span></a></li>
780                     <li><a href="/shop/checkout" class="text-success">Shipping &amp; Billing<span class="chevron"></span></a></li>
781                     <li class="text-primary">Payment<span class="chevron"></span></li>
782                     <li class="text-muted">Confirmation<span class="chevron"></span></li>
783                 </ul>
784                 <h1 class="mb32">Validate Order</h1>
785                 <div class="row">
786                   <div class="col-md-8 oe_mycart">
787                     <table class='table table-striped table-condensed' id="mycart_products" t-if="website_sale_order and website_sale_order.order_line">
788                         <colgroup>
789                             <col width="80"/>
790                             <col/>
791                             <col width="100"/>
792                             <col width="120"/>
793                         </colgroup>
794                         <thead>
795                             <tr>
796                                 <th colspan="2">Product</th>
797                                 <th>Price</th>
798                                 <th>Quantity</th>
799                             </tr>
800                         </thead>
801                         <tbody>
802                             <tr t-foreach="website_sale_order.order_line" t-as="line">
803                                 <td colspan="2" t-if="not line.product_id.product_tmpl_id"></td>
804                                 <td t-if="line.product_id.product_tmpl_id">
805                                     <a t-href="/shop/product/#{ line.product_id.product_tmpl_id.id }/">
806                                         <span t-field="line.product_id.image_small"
807                                               t-field-options='{"widget": "image", "class": "img-rounded"}'/>
808                                     </a>
809                                 </td>
810                                 <td t-if="line.product_id.product_tmpl_id">
811                                    <strong t-field="line.product_id.name"/>
812                                 </td>
813                                 <td class="text-center">
814                                    <span t-field="line.price_unit" t-field-options='{
815                                        "widget": "monetary",
816                                        "display_currency": "website.pricelist_id.currency_id"
817                                    }'/>
818                                 </td>
819                                 <td>
820                                    <div t-esc="line.product_uom_qty"/>
821                                 </td>
822                             </tr>
823                         </tbody>
824                     </table>
825                     <table class='pull-right mb16' id="mycart_total">
826                         <colgroup>
827                             <col width="100"/>
828                             <col width="120"/>
829                         </colgroup>
830                         <thead>
831                             <tr style="border-top: 1px solid #000">
832                                 <th><h3>Total:</h3></th>
833                                 <th class="text-right"><h3><span t-field="website_sale_order.amount_total" t-field-options='{
834                                     "widget": "monetary",
835                                     "display_currency": "website.pricelist_id.currency_id"
836                                 }'/></h3></th>
837                             </tr>
838                             <tr class="text-muted">
839                                 <td><abbr title="Taxes may be updated after providing shipping address">Incl. Taxes:</abbr></td>
840                                 <td class="text-right"><span t-field="website_sale_order.amount_tax" t-field-options='{
841                                     "widget": "monetary",
842                                     "display_currency": "website.pricelist_id.currency_id"
843                                 }'/></td>
844                             </tr>
845                         </thead>
846                     </table>
847                     <div class="clearfix"/>
848                     <div class="oe_structure"/>
849                   </div>
850                   <div class="col-md-3 col-md-offset-1 text-muted" id="right_column">
851                       <h4>Bill To:</h4>
852                       <div t-field="website_sale_order.partner_invoice_id"/>
853                       <div>
854                         <a href="/shop/checkout"><span class="icon-arrow-right"/> Change Address</a>
855                       </div>
856
857                       <h4 class="mt32">Ship To:</h4>
858                       <div t-field="website_sale_order.partner_shipping_id"/>
859                       <div>
860                         <a href="/shop/checkout"><span class="icon-arrow-right"/> Change Address</a>
861                       </div>
862
863                   </div>
864                 </div>
865
866                 <div class="js_payment mb64" t-if="not payment_acquirer_id and payments">
867                     <p>Select your payment method:</p>
868                     <div>
869                         <t t-foreach="payments" t-as="payment">
870                             <label t-if="payment._content">
871                                 <input t-att-value="payment.id" type="radio" name="payment_type"/> <t t-esc="payment.name"/>
872                             </label>
873                         </t>
874                     </div>
875                     <t t-foreach="payments" t-as="payment">
876                         <div t-att-data-id="payment.id" t-raw="payment._content" class="hidden"/>
877                     </t>
878                 </div>
879
880                 <div class="js_payment_validation mb64" t-if="payment_acquirer_id">
881                     Please wait, we validate your payment.
882                     <div>
883                       <t t-esc="validation"/>
884                     </div>
885                 </div>
886
887               </div>
888               <div class="oe_structure"/>
889             </div>
890
891         </t>
892     </template>
893
894     <template id="confirmation">
895         <t t-call="website.layout">
896             <t t-set="head">
897                 <link rel='stylesheet' href='/website_sale/static/src/css/website_sale.css'/>
898                 <t t-raw="head or ''"/>
899             </t>
900             <t t-set="additional_title">Shop - Confirmed</t>
901             <div id="wrap">
902               <div class="container oe_website_sale">
903
904                 <ul class="wizard pull-right">
905                     <li class="text-muted">Review Order<span class="chevron"></span></li>
906                     <li class="text-muted">Shipping &amp; Billing<span class="chevron"></span></li>
907                     <li class="text-muted">Payment<span class="chevron"></span></li>
908                     <li class="text-primary">Confirmation<span class="chevron"></span></li>
909                 </ul>
910                 <h1 class="mb32">Validate Order</h1>
911                 <div class="row">
912                   <div class="col-md-8 oe_mycart">
913                     <table class='table table-striped table-condensed' id="mycart_products" t-if="website_sale_order and website_sale_order.order_line">
914                         <colgroup>
915                             <col width="80"/>
916                             <col/>
917                             <col width="100"/>
918                             <col width="120"/>
919                         </colgroup>
920                         <thead>
921                             <tr>
922                                 <th colspan="2">Product</th>
923                                 <th>Price</th>
924                                 <th>Quantity</th>
925                             </tr>
926                         </thead>
927                         <tbody>
928                             <tr t-foreach="website_sale_order.order_line" t-as="line">
929                                 <td colspan="2" t-if="not line.product_id.product_tmpl_id"></td>
930                                 <td t-if="line.product_id.product_tmpl_id">
931                                     <a t-href="/shop/product/#{ line.product_id.product_tmpl_id.id }/">
932                                         <span t-field="line.product_id.image_small"
933                                               t-field-options='{"widget": "image", "class": "img-rounded"}'/>
934                                     </a>
935                                 </td>
936                                 <td t-if="line.product_id.product_tmpl_id">
937                                    <strong t-field="line.product_id.name"/>
938                                 </td>
939                                 <td class="text-center">
940                                    <span t-field="line.price_unit" t-field-options='{
941                                        "widget": "monetary",
942                                        "display_currency": "website.pricelist_id.currency_id"
943                                    }'/>
944                                 </td>
945                                 <td>
946                                    <div t-esc="line.product_uom_qty"/>
947                                 </td>
948                             </tr>
949                         </tbody>
950                     </table>
951                     <table class='pull-right mb16' id="mycart_total">
952                         <colgroup>
953                             <col width="100"/>
954                             <col width="120"/>
955                         </colgroup>
956                         <thead>
957                             <tr style="border-top: 1px solid #000">
958                                 <th><h3>Total:</h3></th>
959                                 <th class="text-right"><h3><span t-field="website_sale_order.amount_total" t-field-options='{
960                                     "widget": "monetary",
961                                     "display_currency": "website.pricelist_id.currency_id"
962                                 }'/></h3></th>
963                             </tr>
964                             <tr class="text-muted">
965                                 <td><abbr title="Taxes may be updated after providing shipping address">Incl. Taxes:</abbr></td>
966                                 <td class="text-right"><span t-field="website_sale_order.amount_tax" t-field-options='{
967                                     "widget": "monetary",
968                                     "display_currency": "website.pricelist_id.currency_id"
969                                 }'/></td>
970                             </tr>
971                         </thead>
972                     </table>
973                     <div class="clearfix"/>
974                     <div class="oe_structure"/>
975                   </div>
976                   <div class="col-md-3 col-md-offset-1 text-muted" id="right_column">
977                       <h4>Bill To:</h4>
978                       <div t-field="website_sale_order.partner_invoice_id"/>
979
980                       <h4 class="mt32">Ship To:</h4>
981                       <div t-field="website_sale_order.partner_shipping_id"/>
982                   </div>
983                 </div>
984
985                 <h2>Tanks you for your order.</h2>
986
987               </div>
988               <div class="oe_structure"/>
989             </div>
990
991         </t>
992     </template>
993  </data>
994 </openerp>