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