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