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