[FIX] eCommerce cart layout
[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">
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-att-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">
289                               <h4>
290                                   <b><span class="oe_price" t-esc="product.product_variant_ids[0].price" /> â‚¬</b>
291
292                                   <t t-if="product.product_variant_ids[0].lst_price != product.product_variant_ids[0].price">
293                                     <span class="text-danger" style="text-decoration: line-through;">
294                                         <t t-esc="product.product_variant_ids[0].lst_price" /> â‚¬
295                                     </span>&amp;nbsp;
296                                   </t>
297                                   <h4><b><span class="oe_price" t-esc="product.product_variant_ids[0].price" /> â‚¬</b></h4>
298                               </h4>
299                           </div>
300                           <button class="btn btn-primary btn-lg mt8">Add to Cart</button>
301                           <hr t-if="product.description_sale"/>
302                           <p t-field="product.description_sale" class="text-muted"/>
303                           <hr/>
304                           <p class="text-muted">
305                               30-day money-back guarantee<br/>
306                               Free Shipping in U.S.<br/>
307                               Buy now, get in 2 days
308                           </p>
309                       </form>
310                   </div>
311                 </div>
312               </section>
313               <div t-field="product.website_description" class="oe_structure" id="product_full_description"/>
314             </div>
315         </t>
316     </template>
317
318     <template id="recommended_products" inherit_id="website_sale.product" inherit_option_id="website_sale.product" name="Recommended Products">
319         <xpath expr="//div[@id='product_full_description']" position="after">
320             <div class="container mt32" t-if="product.recommended_products()">
321                 <h3>Customers who have bought this product also bought:</h3>
322                 <div class='row mt16' style="margin-left: 15px !important;">
323                 <t t-foreach="product.recommended_products()" t-as="product">
324                     <div class='col-md-2 thumbnail' style='width: 170px; margin-right: 16px;'>
325                         <div class='mt16 text-center'>
326                             <span t-field="product.image_small"/>
327                             <h5>
328                                 <a t-href="/shop/product/#{ product.id }/"
329                                    style="display: block">
330                                     <span t-field='product.name'
331                                           style="display: block"/>
332                                 </a>
333                             </h5>
334                         </div>
335                     </div>
336                 </t>
337                 </div>
338             </div>
339         </xpath>
340     </template>
341
342     <!-- Page Shop my cart -->
343
344     <template id="mycart" name="Your Cart" page="True">
345         <t t-call="website.layout">
346             <t t-set="head">
347                 <script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
348                 <link rel='stylesheet' href='/website_sale/static/src/css/website_sale.css'/>
349                 <t t-raw="head or ''"/>
350             </t>
351             <div id="wrap">
352               <div class="container oe_website_sale">
353
354                 <ul class="wizard pull-right">
355                     <li class="text-primary">Review Order<span class="chevron"></span></li>
356                     <li class="text-muted">Shipping &amp; Billing<span class="chevron"></span></li>
357                     <li class="text-muted">Payment<span class="chevron"></span></li>
358                     <li class="text-muted">Confirmation<span class="chevron"></span></li>
359                 </ul>
360                 <h1 class="mb32">Shopping Cart</h1>
361                 <div class="row">
362                     <div class="col-md-3 text-muted" id="right_column">
363                         <h4>Policies</h4>
364                         <ul class="list-unstyled mb32">
365                             <li>&#9745; 30-days money-back guarantee</li>
366                             <li>&#9745; Invoice sent by e-Mail</li>
367                         </ul>
368                         <h4>Secure Payment</h4>
369                         <ul class="list-unstyled mb32">
370                             <li>&#9745; 256 bit encryption</li>
371                             <li>&#9745; Processed by Ogone</li>
372                         </ul>
373                     </div>
374                     <div class="col-md-8 col-md-offset-1 oe_mycart">
375                         <div t-if="not website_sale_order or not website_sale_order.order_line" class="well well-lg">
376                             Your cart is empty!
377                         </div>
378                         <table class='table table-striped table-condensed' id="mycart_products" t-if="website_sale_order and website_sale_order.order_line">
379                             <colgroup>
380                                 <col width="80"/>
381                                 <col/>
382                                 <col width="100"/>
383                                 <col width="120"/>
384                             </colgroup>
385                             <thead>
386                                 <tr>
387                                     <th colspan="2">Product</th>
388                                     <th>Price</th>
389                                     <th>Quantity</th>
390                                 </tr>
391                             </thead>
392                             <tbody>
393                                 <tr t-foreach="website_sale_order.order_line" t-as="line">
394                                     <td colspan="2" t-if="not line.product_id.product_tmpl_id"></td>
395                                     <td t-if="line.product_id.product_tmpl_id">
396                                         <span t-field="line.product_id.image_small"
397                                               t-field-options='{"widget": "image", "class": "img-rounded"}'/>
398                                     </td>
399                                     <td t-if="line.product_id.product_tmpl_id">
400                                         <div>
401                                             <a t-href="/shop/product/#{ line.product_id.product_tmpl_id.id }/">
402                                                 <strong t-field="line.product_id.name"/>
403                                             </a>
404                                         </div>
405                                         <div class="text-muted" t-field="line.product_id.description_sale"/>
406                                     </td>
407                                     <td class="text-center">
408                                        <del class="text-danger" t-if="line.product_id.lst_price &gt; line.price_unit">
409                                            <span t-field="line.product_id.lst_price" t-field-options='{
410                                                "widget": "monetary",
411                                                "display_currency": "website.pricelist_id.currency_id"
412                                            }'/>
413                                        </del>
414                                        <span t-field="line.price_unit" t-field-options='{
415                                            "widget": "monetary",
416                                            "display_currency": "website.pricelist_id.currency_id"
417                                        }'/>
418                                     </td>
419                                     <td>
420                                         <div class="input-group">
421                                             <span class="input-group-addon">
422                                                 <a t-href="./remove_cart/?order_line_id=#{ line.id }" t-att-data-id="line.id" class="mb8 js_add_cart_json">
423                                                     <span class="icon-minus"/>
424                                                 </a>
425                                             </span>
426                                             <input type="text" class="js_quantity form-control"
427                                                 t-att-data-id="line.id" t-att-value="int(line.product_uom_qty)"/>
428                                             <span class="input-group-addon">
429                                                 <a t-href="./add_cart/?order_line_id=#{ line.id }" t-att-data-id="line.id" class="mb8 float_left js_add_cart_json">
430                                                     <span class="icon-plus"/>
431                                                 </a>
432                                             </span>
433                                         </div>
434
435                                     </td>
436                                 </tr>
437                             </tbody>
438                         </table>
439                         <table class='pull-right mb16' id="mycart_total">
440                             <colgroup>
441                                 <col width="100"/>
442                                 <col width="120"/>
443                             </colgroup>
444                             <thead>
445                                 <tr style="border-top: 1px solid #000">
446                                     <th><h3>Total:</h3></th>
447                                     <th class="text-right"><h3>
448                                         <span t-field="website_sale_order.amount_total" t-field-options='{
449                                             "widget": "monetary",
450                                             "display_currency": "website.pricelist_id.currency_id"
451                                         }'/></h3>
452                                     </th>
453                                 </tr>
454                                 <tr class="text-muted">
455                                     <td><abbr title="Taxes may be updated after providing shipping address">Incl. Taxes:</abbr></td>
456                                     <td class="text-right">
457                                         <span t-field="website_sale_order.amount_tax" t-field-options='{
458                                             "widget": "monetary",
459                                             "display_currency": "website.pricelist_id.currency_id"
460                                         }'/>
461                                     </td>
462                                 </tr>
463                             </thead>
464                         </table>
465                         <div class="clearfix"/>
466                         <a t-href="/shop" class="btn btn-default mb32"><span class="icon-long-arrow-left"/> Continue Shopping</a>
467                         <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>
468                         <div class="oe_structure"/>
469                     </div>
470                 </div>
471
472               </div>
473               <div class="oe_structure"/>
474             </div>
475         </t>
476     </template>
477
478     <!-- Page Shop -->
479
480     <template id="products_categories" inherit_option_id="website_sale.products" name="Product Categories">
481         <xpath expr="//div[@id='products_grid']" position="before">
482             <div id="categories" class="col-md-3">
483                 <ul class="nav nav-pills nav-stacked mt16">
484                     <li t-att-class=" '' if search.get('category') else 'active' "><a t-href="/shop/">All Products</a></li>
485                     <t t-set="categ" t-value="Ecommerce.get_categories()"/>
486                     <t t-foreach="categ[0]" t-as="category">
487                         <t t-call="website_sale.categories_recursive"/>
488                     </t>
489                 </ul>
490             </div>
491         </xpath>
492         <xpath expr="//div[@id='products_grid']" position="attributes">
493             <attribute name="class">col-md-9</attribute>
494         </xpath>
495     </template>
496
497     <template id="products_attributes" inherit_option_id="website_sale.products_categories" name="Product Attributes">
498         <xpath expr="//div[@id='categories']" position="inside">
499             <form t-action="/shop/attributes/" method="post" t-keep-query="category,search">
500                 <ul class="nav nav-pills nav-stacked mt16">
501                     <t t-set="attribute_ids" t-value="Ecommerce.get_attribute_ids()"/>
502                     <t t-foreach="attribute_ids" t-as="attribute_id">
503                         <li t-if="attribute_id.value_ids and attribute_id.type == 'distinct'">
504                             <div t-field="attribute_id.name"/>
505                             <ul class="nav nav-pills nav-stacked">
506                                 <t t-foreach="attribute_id.value_ids" t-as="value_id">
507                                     <li t-att-class="Ecommerce.has_search_attributes(attribute_id.id, value_id.id) and 'active' or ''">
508                                         <label style="margin: 0 20px;">
509                                             <input type="checkbox" t-att-name="'att-%s-%s' % (attribute_id.id, value_id.id)"
510                                                 t-att-checked="Ecommerce.has_search_attributes(attribute_id.id, value_id.id) and 'checked' or ''"/>
511                                             <span style="font-weight: normal" t-field="value_id.name"/>
512                                         </label>
513                                     </li>
514                                 </t>
515                             </ul>
516                         </li>
517                         <li t-if="attribute_id.type == 'float' and attribute_id.float_min != attribute_id.float_max">
518                             <div t-field="attribute_id.name"/>
519                             <t t-set="attribute" t-value="Ecommerce.has_search_attributes(attribute_id.id)"/>
520                             <div style="margin: 0 20px;" class="js_slider"
521                               t-att-data-id="attribute_id.id"
522                               t-att-data-value-min="attribute and attribute[1][0] or attribute_id.float_min"
523                               t-att-data-value-max="attribute and attribute[1][1] or attribute_id.float_max"
524                               t-att-data-min="attribute_id.float_min"
525                               t-att-data-max="attribute_id.float_max"></div>
526                         </li>
527                     </t>
528                 </ul>
529                 <button class="btn btn-xs btn-primary mt16">Apply filter</button>
530             </form>
531         </xpath>
532     </template>
533
534     <template id="suggested_products_list" inherit_id="website_sale.mycart" inherit_option_id="website_sale.mycart" name="Suggested Products in list view">
535         <xpath expr="//table[@id='mycart_products']" position="after">
536             <table t-if="suggested_products" class='table table-striped table-condensed'>
537                 <colgroup>
538                     <col width="80"/>
539                     <col/>
540                     <col width="100"/>
541                     <col width="120"/>
542                 </colgroup>
543                 <thead>
544                     <tr>
545                         <th colspan="2">Suggested products</th>
546                     </tr>
547                 </thead>
548                 <tbody>
549                     <tr t-foreach="suggested_products" t-as="product">
550
551                         <td>
552                             <a t-href="/shop/product/#{ product.product_tmpl_id.id }/">
553                                 <span t-field="product.image_small"
554                                       t-field-options='{"widget": "image", "class": "img-rounded"}'/>
555                             </a>
556                         </td>
557                         <td>
558                             <div>
559                                 <a t-href="/shop/product/#{ product.product_tmpl_id.id }/">
560                                     <strong t-field="product.name"/>
561                                 </a>
562                             </div>
563                             <div class="text-muted" t-field="product.description_sale"/>
564                         </td>
565                         <td>
566                             <span t-field="product.lst_price" t-field-options='{
567                                 "widget": "monetary",
568                                 "display_currency": "website.pricelist_id.currency_id"
569                             }'/>
570                         </td>
571                         <td class="text-center">
572                             <a t-href="./add_cart/?product_id=#{ product.id }"><strong>Add to Cart</strong></a>
573                         </td>
574                     </tr>
575                 </tbody>
576             </table>
577         </xpath>
578     </template>
579
580     <template id="reduction_code" inherit_option_id="website_sale.mycart" name="Reduction Code">
581         <xpath expr="//div[@id='right_column']" position="inside">
582             <h4>Coupon Code</h4>
583             <p>
584                 Have a coupon code? Fill in this field and apply.
585             </p>
586             <form t-if="website_sale_order and website_sale_order.order_line" t-action="/shop/mycart/" method="post" class="mb32">
587                 <div class="input-group">
588                     <input name="promo" class='form-control' type="text" placeholder="code..." t-att-value="website_sale_order.pricelist_id.code or ''"/>
589                     <div class="input-group-btn">
590                         <button class="btn btn-default">Apply</button>
591                     </div>
592                 </div>
593             </form>
594         </xpath>
595     </template>
596
597
598     <!-- Page confirm my cart -->
599
600     <template id="checkout">
601         <t t-call="website.layout">
602           <t t-set="head">
603               <script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
604               <link rel='stylesheet' href='/website_sale/static/src/css/website_sale.css'/>
605               <t t-raw="head or ''"/>
606           </t>
607           <t t-set="additional_title">Shop - Checkout</t>
608           <div id="wrap">
609             <div class="container oe_website_sale">
610                 <ul class="wizard pull-right">
611                     <li><a href="/shop/mycart" class="text-success">Review Order<span class="chevron"></span></a></li>
612                     <li class="text-primary">Shipping &amp; Billing<span class="chevron"></span></li>
613                     <li class="text-muted">Payment<span class="chevron"></span></li>
614                     <li class="text-muted">Confirmation<span class="chevron"></span></li>
615                 </ul>
616                 <h1>Your Address</h1>
617                 <form t-action="/shop/confirm_order/" method="post">
618
619                 <div class="row">
620                 <div class="col-md-8 oe_mycart">
621                     <h3 class="page-header mt16">Set Billing Information
622                         <small t-if="user_id.id == website.public_user.id"> or
623                             <a t-if="not partner" t-attf-href="/web#action=redirect&amp;url=#{ request.httprequest.host_url }/shop/checkout/">sign in</a>
624                         </small>
625                     </h3>
626                         <div class="row">
627                             <div t-attf-class="form-group #{error.get('name') and 'has-error' or ''} col-lg-6">
628                                 <label class="control-label" for="contact_name">Your Name</label>
629                                 <input type="text" name="name" class="form-control" t-att-value="checkout.get('name')"/>
630                             </div>
631                             <div t-attf-class="form-group #{error.get('company') and 'has-error' or ''} col-lg-6">
632                                 <label class="control-label" for="company" style="font-weight: normal">Your Company</label>
633                                 <input type="text" name="company" class="form-control" t-att-value="checkout.get('company')"/>
634                             </div>
635                             <div t-attf-class="form-group #{error.get('email') and 'has-error' or ''} col-lg-6">
636                                 <label class="control-label" for="contact_name">Email</label>
637                                 <input type="email" name="email" class="form-control" t-att-value="checkout.get('email')"/>
638                             </div>
639                             <div t-attf-class="form-group #{ error.get('phone') and 'has-error' or ''} col-lg-6">
640                                 <label class="control-label" for="phone">Telephone</label>
641                                 <input type="tel" name="phone" class="form-control" t-att-value="checkout.get('phone')"/>
642                             </div>
643
644                             <div t-attf-class="form-group #{error.get('street') and 'has-error' or ''} col-lg-6">
645                                 <label class="control-label" for="street">Street</label>
646                                 <input type="text" name="street" class="form-control" t-att-value="checkout.get('street')"/>
647                             </div>
648                             <div class="clearfix"/>
649
650                             <div t-attf-class="form-group #{error.get('city') and 'has-error' or ''} col-lg-6">
651                                 <label class="control-label" for="city">City</label>
652                                 <input type="text" name="city" class="form-control" t-att-value="checkout.get('city')"/>
653                             </div>
654                             <div t-attf-class="form-group #{error.get('zip') and 'has-error' or ''} col-lg-6">
655                                 <label class="control-label" for="zip">Zip / Postal Code</label>
656                                 <input type="text" name="zip" class="form-control" t-att-value="checkout.get('zip')"/>
657                             </div>
658                             <div t-attf-class="form-group #{error.get('state_id') and 'has-error' or ''} col-lg-6">
659                                 <label class="control-label" for="state_id" style="font-weight: normal">State / Province</label>
660                                 <select name="state_id" class="form-control">
661                                     <option value="">select...</option>
662                                     <t t-foreach="states or []" t-as="state">
663                                         <option t-att-value="state.id" t-att-selected="state.id == checkout.get('state_id')"><t t-esc="state.name"/></option>
664                                     </t>
665                                 </select>
666                             </div>
667                             <div t-attf-class="form-group #{error.get('country_id') and 'has-error' or ''} col-lg-6">
668                                 <label class="control-label" for="contact_name">Country</label>
669                                 <select name="country_id" class="form-control">
670                                     <option value="">Country...</option>
671                                     <t t-foreach="countries or []" t-as="country">
672                                         <option t-att-value="country.id" t-att-selected="country.id == checkout.get('country_id')"><t t-esc="country.name"/></option>
673                                     </t>
674                                 </select>
675                             </div>
676
677                             <div class="clearfix"/>
678
679                             <div class="form-group col-lg-6">
680                                 <label>
681                                     <input t-if="not shipping" type="checkbox" name="shipping_different"/>
682                                     <input t-if="shipping" type="checkbox" name="shipping_different" checked="1"/>
683                                     Ship to a different address
684                                 </label>
685                             </div>
686                         </div>
687
688                         <div class="js_shipping row mb16" t-att-style="not shipping and 'display:none' or ''">
689                             <h3 class="oe_shipping col-lg-12 mt16">Shipping Information</h3>
690
691                             <div t-attf-class="form-group #{error.get('shipping_name') and 'has-error' or ''} col-lg-6">
692                                 <label class="control-label" for="contact_name">Name (Shipping)</label>
693                                 <input type="text" name="shipping_name" class="form-control" t-att-value="checkout.get('shipping_name', '')"/>
694                             </div>
695                             <div t-attf-class="form-group #{error.get('shipping_phone') and 'has-error' or ''} col-lg-6">
696                                 <label class="control-label" for="contact_name">Telephone</label>
697                                 <input type="tel" name="shipping_phone" class="form-control" t-att-value="checkout.get('shipping_phone', '')"/>
698                             </div>
699                             <div t-attf-class="form-group #{error.get('shipping_street') and 'has-error' or ''} col-lg-6">
700                                 <label class="control-label" for="contact_name">Street</label>
701                                 <input type="text" name="shipping_street" class="form-control" t-att-value="checkout.get('shipping_street', '')"/>
702                             </div>
703                             <div class="clearfix"/>
704                             <div t-attf-class="form-group #{error.get('shipping_city') and 'has-error' or ''} col-lg-6">
705                                 <label class="control-label" for="contact_name">City</label>
706                                 <input type="text" name="shipping_city" class="form-control" t-att-value="checkout.get('shipping_city', '')"/>
707                             </div>
708                             <div t-attf-class="form-group #{error.get('shipping_zip') and 'has-error' or ''} col-lg-6">
709                                 <label class="control-label" for="contact_name">Zip / Postal Code</label>
710                                 <input type="text" name="shipping_zip" class="form-control" t-att-value="checkout.get('shipping_zip', '')"/>
711                             </div>
712                             <div t-attf-class="form-group #{error.get('shipping_state_id') and 'has-error' or ''} col-lg-6">
713                                 <label class="control-label" for="contact_name" style="font-weight: normal">State / Province</label>
714                                 <select name="shipping_state_id" class="form-control">
715                                     <option value="">State / Province...</option>
716                                     <t t-foreach="states or []" t-as="state">
717                                         <option t-att-value="state.id" t-att-selected="state.id == checkout.get('shipping_state_id')"><t t-esc="state.name"/></option>
718                                     </t>
719                                 </select>
720                             </div>
721                             <div t-attf-class="form-group #{error.get('shipping_country_id') and 'has-error' or ''} col-lg-6">
722                                 <label class="control-label" for="contact_name">Country</label>
723                                 <select name="shipping_country_id" class="form-control">
724                                     <option value="">Country...</option>
725                                     <t t-foreach="countries or []" t-as="country">
726                                         <option t-att-value="country.id" t-att-selected="country.id == checkout.get('shipping_country_id')"><t t-esc="country.name"/></option>
727                                     </t>
728                                 </select>
729                             </div>
730                         </div>
731                         <button type="submit" class="btn btn-default btn-primary pull-right mb32">Confirm <span class="icon-long-arrow-right"/></button>
732                 </div>
733                 <div class="col-lg-offset-1 col-lg-3 text-muted">
734                     <h3 class="page-header mt16">Your Order <small><a href="/shop/mycart"><span class="icon-arrow-right"/> change</a></small></h3>
735                     <div class="row">
736                         <div class="col-sm-6 text-right">Subtotal:</div>
737                         <div class="col-sm-6"><span t-esc="website_sale_order.amount_untaxed" t-field-options='{
738                             "widget": "monetary",
739                             "display_currency": "website.pricelist_id.currency_id"
740                         }'/></div>
741                         <div class="col-sm-6 text-right">Taxes:</div>
742                         <div class="col-sm-6"><span t-field="website_sale_order.amount_tax" t-field-options='{
743                             "widget": "monetary",
744                             "display_currency": "website.pricelist_id.currency_id"
745                         }'/></div>
746                         <div class="col-sm-6 text-right"><h4>Total To Pay:</h4></div>
747                         <div class="col-sm-6"><h4><span t-field="website_sale_order.amount_total" t-field-options='{
748                             "widget": "monetary",
749                             "display_currency": "website.pricelist_id.currency_id"
750                         }'/></h4></div>
751                     </div>
752                     <button type="submit" class="btn btn-default btn-primary pull-right mt16" t-if="user_id.id != website.public_user.id">
753                         Confirm <span class="icon-long-arrow-right"/>
754                     </button>
755
756                 </div>
757             </div>
758             </form>
759           </div>
760           </div>
761         </t>
762     </template>
763
764     <template id="payment">
765         <t t-call="website.layout">
766             <t t-set="head">
767                 <script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
768                 <link rel='stylesheet' href='/website_sale/static/src/css/website_sale.css'/>
769                 <t t-raw="head or ''"/>
770             </t>
771             <t t-set="additional_title">Shop - Select Payment Mode</t>
772             <div id="wrap">
773               <div class="container oe_website_sale">
774
775                 <ul class="wizard pull-right">
776                     <li><a href="/shop/mycart" class="text-success">Review Order<span class="chevron"></span></a></li>
777                     <li><a href="/shop/checkout" class="text-success">Shipping &amp; Billing<span class="chevron"></span></a></li>
778                     <li class="text-primary">Payment<span class="chevron"></span></li>
779                     <li class="text-muted">Confirmation<span class="chevron"></span></li>
780                 </ul>
781                 <h1 class="mb32">Validate Order</h1>
782                 <div class="row">
783                 <div class="col-md-8 oe_mycart">
784                     <table class='table table-striped table-condensed' id="mycart_products" t-if="website_sale_order and website_sale_order.order_line">
785                         <colgroup>
786                             <col width="80"/>
787                             <col/>
788                             <col width="100"/>
789                             <col width="120"/>
790                         </colgroup>
791                         <thead>
792                             <tr>
793                                 <th colspan="2">Product</th>
794                                 <th>Price</th>
795                                 <th>Quantity</th>
796                             </tr>
797                         </thead>
798                         <tbody>
799                             <tr t-foreach="website_sale_order.order_line" t-as="line">
800                                 <td colspan="2" t-if="not line.product_id.product_tmpl_id"></td>
801                                 <td t-if="line.product_id.product_tmpl_id">
802                                     <a t-href="/shop/product/#{ line.product_id.product_tmpl_id.id }/">
803                                         <span t-field="line.product_id.image_small"
804                                               t-field-options='{"widget": "image", "class": "img-rounded"}'/>
805                                     </a>
806                                 </td>
807                                 <td t-if="line.product_id.product_tmpl_id">
808                                    <strong t-field="line.product_id.name"/>
809                                 </td>
810                                 <td class="text-center">
811                                    <span t-field="line.price_unit" t-field-options='{
812                                        "widget": "monetary",
813                                        "display_currency": "website.pricelist_id.currency_id"
814                                    }'/>
815                                 </td>
816                                 <td>
817                                    <div t-esc="line.product_uom_qty"/>
818                                 </td>
819                             </tr>
820                         </tbody>
821                     </table>
822                     <table class='pull-right mb16' id="mycart_total">
823                         <colgroup>
824                             <col width="100"/>
825                             <col width="120"/>
826                         </colgroup>
827                         <thead>
828                             <tr style="border-top: 1px solid #000">
829                                 <th><h3>Total:</h3></th>
830                                 <th class="text-right"><h3><span t-field="website_sale_order.amount_total" t-field-options='{
831                                     "widget": "monetary",
832                                     "display_currency": "website.pricelist_id.currency_id"
833                                 }'/></h3></th>
834                             </tr>
835                             <tr class="text-muted">
836                                 <td><abbr title="Taxes may be updated after providing shipping address">Incl. Taxes:</abbr></td>
837                                 <td class="text-right"><span t-field="website_sale_order.amount_tax" t-field-options='{
838                                     "widget": "monetary",
839                                     "display_currency": "website.pricelist_id.currency_id"
840                                 }'/></td>
841                             </tr>
842                         </thead>
843                     </table>
844                     <div class="clearfix"/>
845                     <div class="oe_structure"/>
846                   </div>
847                   <div class="col-md-3 col-md-offset-1 text-muted" id="right_column">
848                       <h4>Bill To:</h4>
849                       <div t-field="website_sale_order.partner_invoice_id"/>
850                       <div>
851                         <a href="/shop/checkout"><span class="icon-arrow-right"/> Change Address</a>
852                       </div>
853
854                       <h4 class="mt32">Ship To:</h4>
855                       <div t-field="website_sale_order.partner_shipping_id"/>
856                       <div>
857                         <a href="/shop/checkout"><span class="icon-arrow-right"/> Change Address</a>
858                       </div>
859
860                   </div>
861                 </div>
862
863                 <div class="js_payment mb64">
864                     <p>Select your payment method:</p>
865                     <div>
866                         <t t-foreach="payments or []" t-as="payment">
867                             <label>
868                                 <input t-att-value="payment.id" type="radio" name="payment_type"/> <t t-esc="payment.name"/>
869                             </label>
870                         </t>
871                     </div>
872                     <t t-foreach="payments or []" t-as="payment">
873                         <div t-att-data-id="payment.id" t-raw="payment._content" class="hidden"/>
874                     </t>
875                     <a t-href="/shop/payment_validate/" class="btn btn-primary mt16">Validate &amp; Pay <span class="icon-long-arrow-right"/></a>
876                 </div>
877
878               </div>
879               <div class="oe_structure"/>
880             </div>
881
882         </t>
883     </template>
884  </data>
885 </openerp>