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