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