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