[FIX] website_sale: typo and preview display all time in modal
[odoo/odoo.git] / addons / website_sale / views / templates.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3 <data>
4
5 <!-- Layout and common templates -->
6
7 <template id="debugger" inherit_id="website.debugger" name="Event Debugger">
8     <xpath expr='//t[@t-set="debugger_hook"]' position="after">
9         <script type="text/javascript" src="/website_sale/static/src/js/website.tour.sale.js"></script>
10     </xpath>
11 </template>
12
13 <template id="assets_editor" inherit_id="website.assets_editor" name="Shop Editor" groups="base.group_sale_manager">
14   <xpath expr="." position="inside">
15       <script type="text/javascript" src="/website_sale/static/src/js/website_sale.editor.js"></script>
16       <script type="text/javascript" src="/website_sale/static/src/js/website.tour.shop.js"></script>
17   </xpath>
18 </template>
19
20 <template id="header" inherit_id="website.layout" name="Header Shop My Cart Link">
21   <xpath expr="//header//ul[@id='top_menu']/li" position="before">
22       <t t-set="website_sale_order" t-value="website.sale_get_order()"/>
23       <li t-att-class="'' if website_sale_order and website_sale_order.cart_quantity else 'hidden'">
24           <a href="/shop/cart">
25               <i class="fa fa-shopping-cart"></i>
26               My cart <sup t-attf-class="my_cart_quantity label label-primary" t-esc="website_sale_order and website_sale_order.cart_quantity or ''"/>
27           </a>
28       </li>
29   </xpath>
30 </template>
31 <template id="search" name="Search hidden fields">
32   <t t-if="attrib_values">
33     <t t-foreach="attrib_values" t-as="a">
34       <input type="hidden" name="attrib" t-att-value="'%s,%s' % (a[0], a[1])"/>
35     </t>
36   </t>
37   <input t-if="category" type="hidden" name="category" t-att-value="int(category or 0)"/>
38   <div class="input-group">
39     <input type="text" name="search" class="search-query form-control" placeholder="Search..." t-att-value="search"/>
40     <span class="input-group-btn">
41       <a class="btn btn-default a-submit"><i class="fa fa-search"/></a>
42     </span>
43   </div>
44 </template>
45
46 <template id="404">
47   <t t-call="website.layout">
48       <div id="wrap">
49           <div class="oe_structure oe_empty">
50               <div class="container">
51                   <h1 class="mt32">Product not found!</h1>
52                   <p>Sorry, this product is not available anymore.</p>
53                   <p><a t-attf-href="/shop">Return to the product list.</a></p>
54               </div>
55           </div>
56       </div>
57   </t>
58 </template>
59
60 <!-- Product item used by /shop and /shop/cart -->
61
62 <template id="products_item" name="Product item">
63   <div itemscope="itemscope" itemtype="http://schema.org/Product">
64   <div class="ribbon-wrapper">
65     <div class="ribbon btn btn-danger">Sale</div>
66   </div>
67   <div class="oe_product_image">
68       <a itemprop="url" t-att-href="keep('/shop/product/%s' % slug(product), page=(pager['page']['num'] if pager['page']['num']>1 else None))">
69           <img itemprop="image" class="img img-responsive" t-attf-src="/website/image/product.template/#{product.id}/image#{'' if product_image_big else '?max_width=300&amp;max_height=300'}"/>
70       </a>
71   </div>
72   <section>
73       <h5><strong><a itemprop="name" t-att-href="keep('/shop/product/%s' % slug(product), page=(pager['page']['num'] if pager['page']['num']>1 else None))" t-field="product.name"/></strong></h5>
74       <div itemprop="offers" itemscope="itemscope" itemtype="http://schema.org/Offer" class="product_price" t-if="product.product_variant_ids">
75           <b>
76               <t t-if="abs(product.lst_price - product.price) &gt; 0.2">
77                 <del class="text-danger" t-field="product.lst_price" t-field-options='{ "widget": "monetary", "display_currency": "pricelist.currency_id" }'/>&amp;nbsp;
78               </t>
79               <span t-field="product.price"  t-field-options='{
80                    "widget": "monetary",
81                    "display_currency": "website.pricelist_id.currency_id"
82                }'>
83               </span>
84               <span itemprop="price" style="display:none;" t-esc="product.price"/>
85               <span itemprop="priceCurrency" style="display:none;" t-esc="website.pricelist_id.currency_id.name"/>
86           </b>
87       </div>
88   </section>
89   </div>
90 </template>
91
92 <template id="products_description" inherit_id="website_sale.products_item" optional="disabled" name="Product Description">
93   <xpath expr="//div[@class='product_price']" position="before">
94       <div class="text-info oe_subdescription" contenteditable="false">
95         <div itemprop="description" t-field="product.description_sale"></div>
96       </div>
97   </xpath>
98 </template>
99
100 <template id="products_add_to_cart" inherit_id="website_sale.products_item" optional="disabled" name="Add to Cart">
101   <xpath expr="//div[@class='product_price']" position="inside">
102       <form action="/shop/cart/update" method="post" style="display: inline-block;">
103           <input name="product_id" t-att-value="product.product_variant_ids[0].id" type="hidden"/>
104           <a class="btn btn-default btn-xs fa fa-shopping-cart a-submit"/>
105       </form>
106   </xpath>
107 </template>
108
109 <!-- /shop product listing -->
110
111 <template id="products" name="Products">
112   <t t-call="website.layout">
113       <t t-set="head">
114           <t t-call="web.jqueryui_conflict">
115             <script type="text/javascript" src="/web/static/lib/jquery.ui/js/jquery-ui-1.9.1.custom.js"></script>
116           </t>
117           <link rel='stylesheet' href="/web/static/lib/jquery.ui/css/smoothness/jquery-ui-1.9.1.custom.css"/>
118           <script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
119           <link rel='stylesheet' href='/website_sale/static/src/css/website_sale.css'/>
120           <t t-raw="head or ''"/>
121       </t>
122       <t t-set="additional_title">Shop</t>
123       <div id="wrap" class="js_sale">
124         <div class="oe_structure"/>
125         <div class="container oe_website_sale">
126           <div class="products_pager">
127             <div class="row">
128               <form t-att-action="keep('/shop',search='')" method="get" class="pagination form-inline col-md-3">
129                 <t t-call="website_sale.search"/>
130               </form>
131               <t t-call="website.pager"/>
132             </div>
133           </div>
134           <div class='row'>
135             <div class="hidden" id="products_grid_before"></div>
136             <div class="col-md-12" id="products_grid">
137               <table width="100%">
138                 <tbody>
139                   <tr t-ignore="true">
140                     <td t-foreach="range(0,rows)" t-as="row" t-attf-width="#{100/rows}%"></td>
141                   </tr>
142                   <tr t-foreach="bins" t-as="tr_product">
143                     <t t-foreach="tr_product" t-as="td_product">
144                       <t t-if="td_product">
145                       <t t-set="product" t-value="td_product['product']"/>
146                       <td t-att-colspan="td_product['x'] != 1 and td_product['x']"
147                           t-att-rowspan="td_product['y'] != 1 and td_product['y']"
148                           t-attf-class="oe_product oe_grid oe-height-#{td_product['y']*2} #{ td_product['class'] }">
149
150                           <div class="oe_product_cart" t-att-data-publish="product.website_published and 'on' or 'off'">
151
152                             <div class="css_options" t-ignore="true" groups="base.group_website_publisher">
153                               <div t-attf-class="dropdown js_options" t-att-data-id="product.id">
154                                 <button class="btn btn-default" t-att-id="'dopprod-%s' % product.id" role="button" data-toggle="dropdown">Options <span class="caret"></span></button>
155                                 <ul class="dropdown-menu" role="menu" t-att-aria-labelledby="'dopprod-%s' % product.id">
156                                   <li class='dropdown-submenu'>
157                                     <a tabindex="-1" href="#">Size</a>
158                                     <ul class="dropdown-menu" name="size">
159                                       <li><a href="#">
160                                         <table>
161                                           <tr>
162                                             <td class="selected"></td>
163                                             <td t-att-class="product.website_size_x > 1 and 'selected'"></td>
164                                             <td t-att-class="product.website_size_x > 2 and 'selected'"></td>
165                                             <td t-att-class="product.website_size_x > 3 and 'selected'"></td>
166                                           </tr>
167                                           <tr>
168                                             <td t-att-class="product.website_size_y > 1 and 'selected'"></td>
169                                             <td t-att-class="product.website_size_y > 1 and product.website_size_x > 1 and 'selected'"></td>
170                                             <td t-att-class="product.website_size_y > 1 and product.website_size_x > 2 and 'selected'"></td>
171                                             <td t-att-class="product.website_size_y > 1 and product.website_size_x > 3 and 'selected'"></td>
172                                           </tr>
173                                           <tr>
174                                             <td t-att-class="product.website_size_y > 2 and 'selected'"></td>
175                                             <td t-att-class="product.website_size_y > 2 and product.website_size_x > 1 and 'selected'"></td>
176                                             <td t-att-class="product.website_size_y > 2 and product.website_size_x > 2 and 'selected'"></td>
177                                             <td t-att-class="product.website_size_y > 2 and product.website_size_x > 3 and 'selected'"></td>
178                                           </tr>
179                                           <tr>
180                                             <td t-att-class="product.website_size_y > 3 and 'selected'"></td>
181                                             <td t-att-class="product.website_size_y > 3 and product.website_size_x > 1 and 'selected'"></td>
182                                             <td t-att-class="product.website_size_y > 3 and product.website_size_x > 2 and 'selected'"></td>
183                                             <td t-att-class="product.website_size_y > 3 and product.website_size_x > 3 and 'selected'"></td>
184                                           </tr>
185                                         </table>
186                                       </a></li>
187                                     </ul>
188                                   </li>
189                                   <li class='dropdown-submenu'>
190                                     <a tabindex="-1" href="#">Styles</a>
191                                     <ul class="dropdown-menu" name="style">
192                                       <t t-foreach="styles" t-as="style">
193                                         <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>
194                                       </t>
195                                     </ul>
196                                   </li>
197                                   <li class='dropdown-submenu'>
198                                       <a tabindex="-1" href="#">Promote</a>
199                                       <ul class="dropdown-menu" name="sequence">
200                                           <li><a href="#" class="js_go_to_top">Push to top</a></li>
201                                           <li><a href="#" class="js_go_up">Push up</a>
202                                           </li>
203                                           <li><a href="#" class="js_go_down">Push down</a></li>
204                                           <li><a href="#" class="js_go_to_bottom">Push to bottom</a></li>
205                                       </ul>
206                                   </li>
207                                 </ul>
208                               </div>
209                             </div>
210                             <t t-set="product_image_big" t-value="td_product['x']+td_product['y'] > 2"/>
211                             <t t-call="website_sale.products_item"/>
212                           </div>
213
214                       </td>
215                       </t>
216                       <td t-if="not td_product" class="oe-height-2"/>
217                     </t>
218                   </tr>
219                 </tbody>
220               </table>
221               <t t-if="not bins">
222                 <div class="text-center text-muted">
223                   <h3 class="css_editable_display">No product defined.</h3>
224                   <t groups="base.group_website_publisher">
225                     <p groups="base.group_sale_manager">Use the <i>'Content'</i> top menu to create a new product.</p>
226                   </t>
227                 </div>
228               </t>
229             </div>
230           </div>
231           <div class="products_pager">
232               <t t-call="website.pager"/>
233           </div>
234         </div>
235         <div class="oe_structure mb32"/>
236       </div>
237   </t>
238 </template>
239
240 <!-- Add to cart button-->
241
242 <template id="categories_recursive" name="Category list">
243   <li t-att-class="'active' if c.id == category else ''">
244       <a t-att-href="keep('/shop/category/' + slug(c), category=0)" t-field="c.name"></a>
245       <ul t-if="c.child_id" class="nav nav-pills nav-stacked nav-hierarchy">
246           <t t-foreach="c.child_id" t-as="c">
247               <t t-call="website_sale.categories_recursive"/>
248           </t>
249       </ul>
250   </li>
251 </template>
252
253 <template id="products_categories" inherit_id="website_sale.products" optional="disabled" name="Product Categories">
254   <xpath expr="//div[@id='products_grid_before']" position="inside">
255       <ul class="nav nav-pills nav-stacked mt16">
256           <li t-att-class=" '' if category else 'active' "><a t-att-href="keep('/shop',category=0)">All Products</a></li>
257           <t t-foreach="categories" t-as="c">
258               <t t-call="website_sale.categories_recursive"/>
259           </t>
260       </ul>
261   </xpath>
262   <xpath expr="//div[@id='products_grid_before']" position="attributes">
263       <attribute name="class">col-md-3 hidden-xs</attribute>
264   </xpath>
265   <xpath expr="//div[@id='products_grid']" position="attributes">
266       <attribute name="class">col-md-9</attribute>
267   </xpath>
268 </template>
269
270 <template id="products_attributes" inherit_id="website_sale.products" optional="disabled" name="Product Attribute's Filters">
271   <xpath expr="//div[@id='products_grid_before']" position="inside">
272       <form class="js_attributes" method="get">
273           <input type="hidden" name="search" t-att-value="search"/>
274           <ul class="nav nav-pills nav-stacked mt16">
275               <t t-foreach="attributes" t-as="a">
276                   <li t-if="a.value_ids and len(a.value_ids) > 1">
277                       <div><strong t-field="a.name"/></div>
278                       <t t-if="a.type == 'select'">
279                         <select class="form-control" name="attrib">
280                           <option value=""/>
281                           <t t-foreach="a.value_ids" t-as="v">
282                             <option t-att-value="'%s,%s' % (a.id,v.id)" t-field="v.name" t-att-selected="'selected' if v.id in attrib_set else ''"/>
283                           </t>
284                         </select>
285                       </t>
286                       <t t-if="a.type == 'radio'">
287                         <ul class="nav nav-pills nav-stacked">
288                             <t t-foreach="a.value_ids" t-as="v">
289                                 <li t-att-class="'active' if v.id in attrib_set else ''">
290                                     <label style="margin: 0 20px;">
291                                         <input type="checkbox" name="attrib" t-att-value="'%s,%s' % (a.id,v.id)" t-att-checked="'checked' if v.id in attrib_set else ''"/>
292                                         <span style="font-weight: normal" t-field="v.name"/>
293                                     </label>
294                                 </li>
295                             </t>
296                         </ul>
297                       </t>
298                       <t t-if="a.type == 'color'">
299                         <t t-foreach="a.value_ids" t-as="v">
300                           <label t-attf-style="background-color:#{v.color or v.name}"
301                               t-attf-class="css_attribute_color #{'active' if v.id in attrib_set else ''}">
302                               <input type="checkbox"
303                                   name="attrib"
304                                   t-att-value="'%s,%s' % (a.id,v.id)"
305                                   t-att-checked="'checked' if v.id in attrib_set else ''"
306                                   t-att-title="v.name"/>
307                           </label>
308                         </t>
309                       </t>
310                   </li>
311               </t>
312           </ul>
313       </form>
314   </xpath>
315   <xpath expr="//div[@id='products_grid_before']" position="attributes">
316       <attribute name="class">col-md-3 hidden-xs</attribute>
317   </xpath>
318   <xpath expr="//div[@id='products_grid']" position="attributes">
319       <attribute name="class">col-md-9</attribute>
320   </xpath>
321 </template>
322
323 <template id="products_list_view" inherit_id="website_sale.products" optional="disabled" name="List View">
324   <xpath expr="//div[@id='products_grid']//table" position="replace">
325     <t t-foreach="products" t-as="product">
326       <div class="oe_product oe_list oe_product_cart" t-att-data-publish="product.website_published and 'on' or 'off'">
327         <t t-call="website_sale.products_item"/>
328       </div>
329     </t>
330   </xpath>
331 </template>
332
333 <!-- /shop/product product page -->
334
335 <template id="product" name="Product">
336   <t t-call="website.layout">
337       <t t-set="head">
338           <script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
339           <link rel='stylesheet' href='/website_sale/static/src/css/website_sale.css'/>
340           <link rel='stylesheet' href='/website_sale/static/src/css/website_mail.css'/>
341       </t>
342       <t t-set="additional_title" t-value="product.name"/>
343       <div itemscope="itemscope" itemtype="http://schema.org/Product" id="wrap" class="js_sale">
344
345         <section class="container mt8">
346           <div class="row">
347             <div class="col-sm-4">
348                 <ol class="breadcrumb">
349                     <li><a t-att-href="keep(category=0)" onclick="history.go(-1); return false;">Products</a></li>
350                     <li t-if="category"><a t-att-href="keep()" t-field="category.name"/></li>
351                     <li class="active"><span t-field="product.name"/></li>
352                 </ol>
353             </div>
354             <div class="col-sm-3">
355               <form t-att-action="keep(search=0)" method="get" class="pull-right">
356                   <t t-call="website_sale.search"/>
357               </form>
358             </div>
359             <div class="col-sm-4" groups="base.group_sale_manager">
360                 <t t-call="website.publish_management">
361                   <t t-set="object" t-value="product"/>
362                   <t t-set="publish_edit" t-value="True"/>
363                   <t t-set="action" t-value="'product.product_template_action'"/>
364                 </t>
365             </div>
366           </div>
367         </section>
368
369         <section class="container oe_website_sale" id="product_detail">
370           <div class="row">
371             <div class="col-sm-7 col-md-7 col-lg-7">
372                 <span itemprop="image" t-field="product.image" t-field-options='{"widget": "image", "class": "product_detail_img"}'/>
373             </div><div class="col-sm-5 col-md-5 col-lg-4 col-lg-offset-1">
374                 <h1 itemprop="name" t-field="product.name">Product Name</h1>
375                 <span itemprop="url" style="display:none;" t-esc="'/shop/product/%s' % slug(product)"/>
376
377                 <form t-att-action="keep('/shop/cart/update')" class="js_add_cart_variants" method="POST">
378
379                   <div class="js_product">
380                     <t t-placeholder="select">
381                       <input type="hidden" class="product_id" name="product_id" t-att-value="int(product.product_variant_ids[0]) if len(product.product_variant_ids) == 1 else '0'"/>
382                       <t t-call="website_sale.variants">
383                         <t t-set="ul_class" t-value="'nav-stacked'"/>
384                       </t>
385                     </t>
386
387                     <t t-call="website_sale.product_price"/>
388                     <p t-if="len(product.product_variant_ids) > 1" class="css_not_available_msg bg-danger" style="padding: 15px;">Product not available</p>
389
390                     <t t-placeholder="button">
391                       <a t-if="not optional_product_ids" class="btn btn-primary btn-lg mt8 a-submit js_check_product">Add to Cart</a>
392                       <a t-if="optional_product_ids" class="btn btn-primary btn-lg mt8 js_check_product" href="#" data-toggle="modal" data-target="#modal_optional_products">Add to Cart</a>
393                     </t>
394                   </div>
395
396                   <div t-if="optional_product_ids" id="modal_optional_products" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
397                     <div class="modal-dialog modal-lg">
398                       <div class="modal-content">
399                         <div class="modal-header">
400                           <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
401                           <h4 class="modal-title" id="myModalLabel">Product to add in your shopping cart</h4>
402                         </div>
403                         <div class="modal-body">
404
405                           <table class="table table-striped table-condensed">
406                             <thead>
407                                 <tr>
408                                     <th colspan="2" width="100">Product</th>
409                                     <th width="100">Price</th>
410                                     <th width="120">Quantity</th>
411                                 </tr>
412                             </thead>
413                             <tbody>
414                                 <tr id="product_confirmation">
415                                   <td width="100">
416                                     <span t-field="product.image_medium" t-field-options='{"widget": "image" }'/>
417                                   </td>
418                                   <td>
419                                     <strong t-field="product.name"/>
420                                     <div class="text-muted">
421                                       <div t-field="product.description_sale"/>
422                                       <div class="js_attributes"></div>
423                                     </div>
424                                   </td>
425                                   <td>
426                                     <t t-if="product.lst_price != product.price">
427                                     <span class="text-danger" style="text-decoration: line-through;"
428                                       t-field="product.lst_price"
429                                       t-field-options='{
430                                          "widget": "monetary",
431                                          "display_currency": "website.pricelist_id.currency_id"
432                                      }'/><br/>
433                                     </t>
434                                     <span class="oe_price"
435                                       t-field="product.price"
436                                       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-attf-href="#" class="mb8 js_add_cart_json">
445                                                 <i class="fa fa-minus"></i>
446                                             </a>
447                                         </span>
448                                         <input type="text" class="js_quantity form-control" data-min="1" name="add_qty" value="1"/>
449                                         <span class="input-group-addon">
450                                             <a t-attf-href="#" class="mb8 float_left js_add_cart_json">
451                                                 <i class="fa fa-plus"></i>
452                                             </a>
453                                         </span>
454                                     </div>
455                                   </td>
456                                 </tr>
457                                 <tr t-if="optional_product_ids"><td colspan="4"><h4>Select Your Options:</h4></td></tr>
458                                 <t t-set="option_inc" t-value="0"/>
459                                 <tr class="js_product" t-foreach="optional_product_ids" t-as="product">
460                                   <td width="100">
461                                     <input type="hidden" class="optional_product_id" t-attf-name="optional-product-#{option_inc}" t-att-value="int(product.product_variant_ids[0]) if len(product.product_variant_ids) == 1 else '0'"/>
462                                     <span t-field="product.image_small" t-field-options='{"widget": "image"}'/>
463                                   </td>
464                                   <td>
465                                     <div class="pull-left">
466                                       <strong class="media-heading" t-field="product.name"/>
467                                       <div class="text-muted" t-field="product.description_sale"/>
468                                     </div>
469                                     <div class="pull-right">
470                                       <t t-call="website_sale.variants"/>
471                                     </div>
472                                   </td>
473                                   <td>
474                                     <t t-if="product.lst_price != product.price">
475                                     <span class="text-danger" style="text-decoration: line-through;"
476                                       t-field="product.lst_price"
477                                       t-field-options='{
478                                          "widget": "monetary",
479                                          "display_currency": "website.pricelist_id.currency_id"
480                                      }'/><br/>
481                                     </t>
482                                     <span class="oe_price"
483                                       t-field="product.price"
484                                       t-field-options='{
485                                          "widget": "monetary",
486                                          "display_currency": "website.pricelist_id.currency_id"
487                                      }'/>
488                                     <p class="css_not_available_msg bg-danger" style="position:absolute; padding: 15px;">Product not available</p>
489                                   </td>
490                                   <td>
491                                     <input type="hidden" class="js_optional_same_quantity" value="0"/>
492                                     <input type="hidden" class="js_quantity" t-attf-name="optional-quantity-#{option_inc}" value="0"/>
493                                     <a href="#" class="js_add"><strong>Add to Cart</strong></a>
494                                     <span class="js_remove hidden">
495                                       <span class="js_item">1 Item</span><span class="js_items hidden">5 Items</span><br/>
496                                       <a href="#" class="js_remove"><small>Remove from cart</small></a>
497                                     </span>
498                                   </td>
499                                 </tr>
500                             </tbody>
501                           </table>
502                         </div>
503                         <div class="modal-footer">
504                           <a class="btn btn-default a-submit js_goto_shop"><i class="fa fa-chevron-left"></i> Continue shopping</a>
505                           <a class="btn btn-primary pull-right a-submit"><i class="fa fa-shopping-cart fa-fw"></i> Proceed to checkout</a>
506                         </div>
507                       </div>
508                     </div>
509                   </div>
510
511                 </form>
512
513                 <hr t-if="product.description_sale"/>
514                 <div><p t-field="product.description_sale" class="text-muted"/></div>
515                 <hr/>
516                 <p class="text-muted">
517                     30-day money-back guarantee<br/>
518                     Free Shipping in U.S.<br/>
519                     Buy now, get in 2 days
520                 </p>
521             </div>
522           </div>
523         </section>
524         <div itemprop="description" t-field="product.website_description" class="oe_structure mt16" id="product_full_description"/>
525
526       </div>
527   </t>
528 </template>
529
530 <template id="product_confirmation" inherit_id="website_sale.product" optional="disabled" name="Confirm: Add To Cart">
531   <xpath expr="//div[@id='modal_optional_products']" position="attributes">
532     <attribute name="t-if">True</attribute>
533   </xpath>
534   <xpath expr="//t[@t-placeholder='button']" position="replace">
535     <t t-placeholder="button">
536       <a class="btn btn-primary btn-lg mt8 js_check_product" href="#" data-toggle="modal" data-target="#modal_optional_products">Add to Cart</a>
537     </t>
538   </xpath>
539 </template>
540
541 <template id="product_quantity" inherit_id="website_sale.product" optional="enabled" name="Select Quantity">
542   <xpath expr="//t[@t-placeholder='button']" position="before">
543     <div class="input-group" style="width: 108px;">
544         <span class="input-group-addon">
545             <a t-attf-href="#" class="mb8 js_add_cart_json">
546                 <i class="fa fa-minus"></i>
547             </a>
548         </span>
549         <input type="text" class="js_quantity form-control" data-min="1" name="add_qty" value="1"/>
550         <span class="input-group-addon">
551             <a t-attf-href="#" class="mb8 float_left js_add_cart_json">
552                 <i class="fa fa-plus"></i>
553             </a>
554         </span>
555     </div>
556   </xpath>
557 </template>
558
559 <template id="product_price">
560   <div itemprop="offers" itemscope="itemscope" itemtype="http://schema.org/Offer" class="product_price mt16">
561       <h4 class="oe_price_h4">
562           <t t-if="product.lst_price != product.price">
563           <span class="text-danger" style="text-decoration: line-through;"
564             t-field="product.lst_price"
565             t-field-options='{
566                "widget": "monetary",
567                "display_currency": "website.pricelist_id.currency_id"
568            }'/><br/>
569           </t>
570           <b class="oe_price"
571             t-field="product.price"
572             t-field-options='{
573                "widget": "monetary",
574                "display_currency": "website.pricelist_id.currency_id"
575            }'/>
576           <span itemprop="price" style="display:none;" t-esc="product.price"/>
577           <span itemprop="priceCurrency" style="display:none;" t-esc="website.pricelist_id.currency_id.name"/>
578       </h4>
579   </div>
580 </template>
581
582 <template id="product_variants" inherit_id="website_sale.product" optional="disabled" name="List View of Variants">
583   <xpath expr="//t[@t-placeholder='select']" position="replace">
584     <input type="hidden" t-if="len(product.product_variant_ids) == 1" name="product_id" t-att-value="product.product_variant_ids[0].id"/>
585     <t t-if="len(product.product_variant_ids) &gt; 1">
586       <label label-default="label-default" class="radio" t-foreach="product.product_variant_ids" t-as="variant_id">
587         <input type="radio" name="product_id" t-att-value="variant_id.id"/>
588         <span t-esc="variant_id.name_get()[0][1]"/>
589         <span class="badge" t-if="variant_id.price_extra">
590           <t t-esc="variant_id.price_extra > 0 and '+' or ''"/><span t-field="variant_id.price_extra" t-field-options='{ "widget": "monetary", "display_currency": "pricelist.currency_id" }'/>
591         </span>
592       </label>
593     </t>
594   </xpath>
595 </template>
596
597 <template id="variants">
598   <ul t-attf-class="list-unstyled js_add_cart_variants #{ul_class}" t-att-data-attribute_value_ids="[[p.id, map(int, p.attribute_value_ids), p.price] for p in product.product_variant_ids]">
599     <t t-foreach="product.attribute_line_ids" t-as="variant_id">
600       <li t-if="len(variant_id.value_ids) > 1">
601
602         <strong t-field="variant_id.attribute_id.name"/>
603
604         <t t-if="variant_id.attribute_id.type == 'select'">
605           <select class="form-control js_variant_change" t-att-name="'attribute-%s-%s' % (product.id, variant_id.attribute_id.id)">
606             <t t-foreach="variant_id.value_ids" t-as="value_id">
607               <option t-att-value="value_id.id">
608                   <span t-field="value_id.name"/>
609                   <span t-if="value_id.price_extra">
610                       <t t-esc="value_id.price_extra > 0 and '+' or ''"/><span t-field="value_id.price_extra" t-field-options='{
611                                "widget": "monetary",
612                                "display_currency": "website.pricelist_id.currency_id"
613                            }'/>
614                   </span>
615               </option>
616             </t>
617           </select>
618         </t>
619
620         <t t-if="variant_id.attribute_id.type == 'radio'">
621           <ul class="list-unstyled">
622               <t t-set="inc" t-value="0"/>
623               <t t-foreach="variant_id.value_ids" t-as="value_id">
624                   <li t-if="value_id.product_ids" class="form-group js_attribute_value" style="margin: 0;">
625                       <label class="control-label" style="margin: 0 20px;">
626                           <input type="radio" class="js_variant_change" t-att-checked="'checked' if not inc else ''" t-att-name="'attribute-%s-%s' % (product.id, variant_id.attribute_id.id)" t-att-value="value_id.id" style="vertical-align: top; margin-right: 10px;"/>
627                           <span t-field="value_id.name"/>
628                           <span class="badge" t-if="value_id.price_extra">
629                               <t t-esc="value_id.price_extra > 0 and '+' or ''"/><span t-field="value_id.price_extra" t-field-options='{
630                                            "widget": "monetary",
631                                            "display_currency": "website.pricelist_id.currency_id"
632                                        }'/>
633                           </span>
634                       </label>
635                   </li>
636                   <t t-set="inc" t-value="inc+1"/>
637               </t>
638           </ul>
639         </t>
640
641         <t t-if="variant_id.attribute_id.type == 'color'">
642           <ul class="list-inline">
643               <t t-set="inc" t-value="0"/>
644               <li t-foreach="variant_id.value_ids" t-as="value_id">
645                   <label t-attf-style="background-color:#{value_id.color or value_id.name}"
646                       t-attf-class="css_attribute_color #{'active' if not inc else ''}">
647                     <input type="radio" class="js_variant_change"
648                       t-att-checked="'checked' if not inc else ''"
649                       t-att-name="'attribute-%s-%s' % (product.id, variant_id.attribute_id.id)"
650                       t-att-value="value_id.id"
651                       t-att-title="value_id.name"/>
652                   </label>
653                   <t t-set="inc" t-value="inc+1"/>
654               </li>
655           </ul>
656         </t>
657
658       </li>
659     </t>
660   </ul>
661 </template>
662
663 <template id="recommended_products" inherit_id="website_sale.product" optional="enabled" name="Alternative Products">
664   <xpath expr="//div[@id='product_full_description']" position="after">
665       <div class="container mt32" t-if="product.alternative_product_ids">
666           <h3>Suggested alternatives:</h3>
667           <div class='row mt16' style="margin-left: 15px !important;">
668           <t t-foreach="product.alternative_product_ids" t-as="product">
669               <div class='col-md-2 thumbnail' style='width: 170px; margin-right: 16px;'>
670                   <div class='mt16 text-center'>
671                       <span t-field="product.image_small" t-field-options='{"widget": "image", "class": "img-rounded shadow" }'/>
672                       <h5>
673                           <a t-attf-href="/shop/product/#{ slug(product) }" style="display: block">
674                               <span t-field='product.name' style="display: block"/>
675                           </a>
676                       </h5>
677                   </div>
678               </div>
679           </t>
680           </div>
681       </div>
682   </xpath>
683 </template>
684
685 <template id="product_attributes" inherit_id="website_sale.product" optional="enabled" name="Product attributes">
686   <xpath expr="//p[@t-field='product.description_sale']" position="after">
687     <hr t-if="sum([(1 if len(l.value_ids)==1 else 0) for l in product.attribute_line_ids])"/>
688     <p class="text-muted">
689       <t t-foreach="product.attribute_line_ids" t-as="variant_id">
690         <t t-if="len(variant_id.value_ids)==1">
691           <span t-field="variant_id.attribute_id"/>: <span t-field="variant_id.value_ids[0].name"/><br/>
692         </t>
693       </t>
694     </p>
695   </xpath>
696 </template>
697
698 <!-- Product options: OpenChatter -->
699
700 <template id="product_comment" inherit_id="website_sale.product" optional="disabled" name="Discussion">
701     <xpath expr="//div[@t-field='product.website_description']" position="after">
702         <hr class="mb32"/>
703         <section class="container">
704             <div class="row col-md-10 col-md-offset-1">
705                 <div class="text-muted">
706                     <h3 class="fa fa-comment-o">
707                         <a id="comments">
708                             <t t-if="len(product.website_message_ids) &lt;= 1" ><t t-esc="len(product.website_message_ids)"/> comment</t>
709                             <t t-if="len(product.website_message_ids) > 1"><t t-esc="len(product.website_message_ids)"/> comments</t>
710                         </a>
711                     </h3>
712                 </div>
713                 <ul class="media-list" id="comments-list"  t-if="product.website_message_ids">
714                     <li t-foreach="product.website_message_ids" t-as="message" class="media">
715                         <div class="media-body oe_msg">
716                             <img class="media-object pull-left oe_msg_avatar" t-att-src="'/website/image?model=res.partner&amp;field=image_small&amp;id='+str(message.author_id.id)" style="width: 50px; margin-right: 10px;"/>
717                             <div class="media-body oe_msg_content">
718                                 <t t-call="website.publish_short">
719                                     <t t-set="object" t-value="message"/>
720                                 </t>
721                                 <h5 class="media-heading">
722                                     <span t-field="message.author_id"/> <small>on <span t-field="message.date"/></small>
723                                 </h5>
724                                 <div t-field="message.body"/>
725                                 <div>
726                                     <div class="oe_msg_attachment" t-foreach='message.attachment_ids' t-as='attachment'>
727                                         <a t-att-href="'/mail/download_attachment?model=mail.message&amp;id='+str(message.id)+'&amp;method=download_attachment&amp;attachment_id='+str(attachment.id)" target="_blank">
728                                             <t t-if="attachment.file_type_icon == 'webimage'">
729                                                 <img t-att-src="'/web/binary/image?model=ir.attachment&amp;field=datas&amp;id=' + str(attachment.id) + '&amp;resize=100,80'"
730                                                     class='oe_attachment_embedded'></img>
731                                             </t>
732                                             <t t-if="attachment.file_type_icon != 'webimage'">
733                                                 <img t-att-src="'/mail/static/src/img/mimetypes/' + attachment.file_type + '.png'"
734                                                     class='oe_attachment_webimage'></img>
735                                             </t>
736                                             <div class='oe_attachment_name'><t t-raw='attachment.name' /></div>
737                                         </a>
738                                     </div>
739                                 </div>
740                             </div>
741                         </div>
742                     </li>
743                 </ul>
744                 <div class="css_editable_mode_hidden">
745                     <form id="comment" t-attf-action="/shop/product/comment/#{product.id}" method="POST">
746                         <img class="img pull-left img-rounded" t-att-src="'/website/image?model=res.partner&amp;field=image_small&amp;id='+str(user_id.partner_id.id)" style="width: 50px; margin-right: 10px;"/>
747                         <div class="pull-left mb32" style="width: 75%%">
748                             <textarea rows="3" name="comment" class="form-control" placeholder="Write a comment..."></textarea>
749                             <a class="btn btn-primary mt8 a-submit">Post</a>
750                         </div>
751                     </form>
752                 </div>
753             </div>
754         </section>
755     </xpath>
756 </template>
757
758 <!-- /shop/cart -->
759
760 <template id="cart" name="Shopping Cart">
761   <t t-call="website.layout">
762       <t t-set="head">
763           <script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
764           <link rel='stylesheet' href='/website_sale/static/src/css/website_sale.css'/>
765           <t t-raw="head or ''"/>
766       </t>
767       <div id="wrap">
768         <div class="container oe_website_sale">
769
770           <ul class="wizard pull-right">
771               <li class="text-primary">Review Order<span class="chevron"></span></li>
772               <li class="text-muted">Shipping &amp; Billing<span class="chevron"></span></li>
773               <li class="text-muted">Payment<span class="chevron"></span></li>
774               <li class="text-muted">Confirmation<span class="chevron"></span></li>
775           </ul>
776           <h1 class="mb32">Shopping Cart</h1>
777           <div class="row">
778               <div class="col-md-8 col-sm-9 oe_cart">
779                   <t t-set="website_sale_order" t-value="website.sale_get_order()"/>
780                   <div t-if="not website_sale_order or not website_sale_order.website_order_line" class="well well-lg">
781                       Your cart is empty!
782                   </div>
783                   <table class='table table-striped table-condensed' id="cart_products" t-if="website_sale_order and website_sale_order.website_order_line">
784                       <thead>
785                           <tr>
786                               <th colspan="2" width="100">Product</th>
787                               <th width="100">Price</th>
788                               <th width="120">Quantity</th>
789                           </tr>
790                       </thead>
791                       <tbody>
792                           <tr t-foreach="website_sale_order.website_order_line" t-as="line">
793                               <td colspan="2" t-if="not line.product_id.product_tmpl_id"></td>
794                               <td align="center" t-if="line.product_id.product_tmpl_id">
795                                   <span t-field="line.product_id.image_small"
796                                         t-field-options='{"widget": "image", "class": "img-rounded"}'/>
797                               </td>
798                               <td t-if="line.product_id.product_tmpl_id">
799                                   <div>
800                                       <a t-attf-href="/shop/product/#{ slug(line.product_id.product_tmpl_id) }">
801                                           <strong t-esc="line.product_id.name_get()[0][1]"/>
802                                       </a>
803                                   </div>
804                                   <div class="text-muted" t-field="line.product_id.description_sale"/>
805                               </td>
806                               <td class="text-center" name="price">
807                                 <t t-if="abs(line.product_id.lst_price - line.price_unit) &gt; 0.2">
808                                   <del class="text-danger"
809                                     t-field="line.product_id.lst_price" t-field-options='{
810                                          "widget": "monetary",
811                                          "display_currency": "website.pricelist_id.currency_id"
812                                     }'/>&amp;nbsp;
813                                 </t>
814                                 <span t-field="line.price_unit"  t-field-options='{
815                                      "widget": "monetary",
816                                      "display_currency": "website.pricelist_id.currency_id"
817                                  }'/>
818                               </td>
819                               <td>
820                                   <div class="input-group">
821                                       <span class="input-group-addon">
822                                           <a t-attf-href="#" class="mb8 js_add_cart_json">
823                                               <i class="fa fa-minus"></i>
824                                           </a>
825                                       </span>
826                                       <input type="text" class="js_quantity form-control"
827                                           t-att-data-line-id="line.id" 
828                                           t-att-data-product-id="line.product_id.id"
829                                           t-att-value="int(line.product_uom_qty)"/>
830                                       <span class="input-group-addon">
831                                           <a t-attf-href="#" class="mb8 float_left js_add_cart_json">
832                                               <i class="fa fa-plus"></i>
833                                           </a>
834                                       </span>
835                                   </div>
836
837                               </td>
838                           </tr>
839                       </tbody>
840                   </table>
841                   <t t-call="website_sale.total"/>
842                   <div class="clearfix"/>
843
844                   <a t-if="not optional_products and website_sale_order and website_sale_order.website_order_line" class="btn btn-primary pull-right mb32" href="/shop/checkout">Process Checkout <span class="fa fa-long-arrow-right"/></a>
845
846                   <div class="oe_structure"/>
847               </div>
848               <div class="col-lg-3 col-lg-offset-1 col-sm-3 col-md-3 text-muted" id="right_column">
849                   <h4>Policies</h4>
850                   <ul class="list-unstyled mb32">
851                       <li>&#9745; 30-days money-back guarantee</li>
852                       <li>&#9745; Invoice sent by e-Mail</li>
853                   </ul>
854                   <h4>Secure Payment</h4>
855                   <ul class="list-unstyled mb32">
856                       <li>&#9745; 256 bit encryption</li>
857                       <li>&#9745; Processed by Ogone</li>
858                   </ul>
859               </div>
860           </div>
861
862         </div>
863         <div class="oe_structure"/>
864       </div>
865   </t>
866 </template>
867
868 <template id="suggested_products_list" inherit_id="website_sale.cart" optional="enabled" name="Suggested Products in my cart">
869   <xpath expr="//table[@id='cart_products']" position="after">
870       <table t-if="suggested_products" class='table table-striped table-condensed'>
871           <colgroup>
872               <col width="80"/>
873               <col/>
874               <col width="100"/>
875               <col width="120"/>
876           </colgroup>
877           <thead>
878               <tr>
879                   <th colspan="4">Suggested products:</th>
880               </tr>
881           </thead>
882           <tbody>
883               <tr t-foreach="suggested_products" t-as="product">
884
885                   <td>
886                       <a t-attf-href="/shop/product/#{ slug(product.product_tmpl_id) }">
887                           <span t-field="product.image_small"
888                                 t-field-options='{"widget": "image", "class": "img-rounded"}'/>
889                       </a>
890                   </td>
891                   <td>
892                       <div>
893                           <a t-attf-href="/shop/product/#{ slug(product.product_tmpl_id) }">
894                               <strong t-field="product.name"/>
895                           </a>
896                       </div>
897                       <div class="text-muted" t-field="product.description_sale"/>
898                   </td>
899                   <td>
900                       <t t-if="abs(product.lst_price - product.price) &gt; 0.2">
901                         <del class="text-danger"
902                           t-field="product.lst_price" t-field-options='{
903                                "widget": "monetary",
904                                "display_currency": "website.pricelist_id.currency_id"
905                           }'/>&amp;nbsp;
906                       </t>
907                       <span t-field="product.price"  t-field-options='{
908                            "widget": "monetary",
909                            "display_currency": "website.pricelist_id.currency_id"
910                        }'/>
911                   </td>
912                   <td class="text-center">
913                       <form action="/shop/cart/update" method="post">
914                           <input name="product_id" t-att-value="product.id" type="hidden"/>
915                           <a class="btn btn-link a-submit"><strong>Add to Cart</strong></a>
916                       </form>
917                   </td>
918               </tr>
919           </tbody>
920       </table>
921   </xpath>
922 </template>
923
924 <template id="continue_shopping" inherit_id="website_sale.cart" optional="enabled" name="Continue Shopping Button">
925   <xpath expr="//a[@href='/shop/checkout']" position="before">
926     <a href="/shop" class="btn btn-default mb32"><span class="fa fa-long-arrow-left"/> Continue Shopping</a>
927   </xpath>
928 </template>
929
930 <template id="reduction_code" inherit_id="website_sale.cart" optional="disabled" name="Reduction Code">
931   <xpath expr="//div[@id='right_column']" position="inside">
932       <h4>Coupon Code</h4>
933       <p>
934           Have a coupon code? Fill in this field and apply.
935       </p>
936       <form t-if="website_sale_order and website_sale_order.website_order_line" action="/shop/pricelist" method="post" class="mb32">
937           <div class="input-group">
938               <input name="promo" class='form-control' type="text" placeholder="code..." t-att-value="website_sale_order.pricelist_id.code or ''"/>
939               <div class="input-group-btn">
940                   <a class="btn btn-default a-submit">Apply</a>
941               </div>
942           </div>
943       </form>
944   </xpath>
945 </template>
946
947 <!-- /shop/checkout -->
948
949 <template id="checkout">
950   <t t-call="website.layout">
951     <t t-set="head">
952         <script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
953         <link rel='stylesheet' href='/website_sale/static/src/css/website_sale.css'/>
954         <t t-raw="head or ''"/>
955     </t>
956     <t t-set="additional_title">Shop - Checkout</t>
957     <div id="wrap">
958       <div class="container oe_website_sale">
959           <ul class="wizard pull-right">
960               <li><a href="/shop/cart" class="text-success">Review Order<span class="chevron"></span></a></li>
961               <li class="text-primary">Shipping &amp; Billing<span class="chevron"></span></li>
962               <li class="text-muted">Payment<span class="chevron"></span></li>
963               <li class="text-muted">Confirmation<span class="chevron"></span></li>
964           </ul>
965           <h1>Your Address</h1>
966           <form action="/shop/confirm_order" method="post">
967
968           <div class="row">
969           <div class="col-md-8 oe_cart">
970               <h3 class="page-header mt16">Billing Information
971                   <small groups="base.group_public"> or
972                       <a class='btn btn-primary' t-if="not partner" t-attf-href="/web?redirect=#{ request.httprequest.url }">Sign in</a>
973                   </small>
974               </h3>
975               <div class="row">
976                   <div t-attf-class="form-group #{error.get('name') and 'has-error' or ''} col-lg-6">
977                       <label class="control-label" for="contact_name">Your Name</label>
978                       <input type="text" name="name" class="form-control" t-att-value="checkout.get('name')"/>
979                   </div>
980                   <div t-attf-class="form-group #{error.get('street2') and 'has-error' or ''} col-lg-6">
981                       <label class="control-label" for="street2" style="font-weight: normal">Company Name</label>
982                       <input type="text" name="street2" class="form-control" t-att-value="checkout.get('street2')"/>
983                   </div>
984                   <div class="col-lg-6"> </div>
985                   <div t-attf-class="form-group #{error.get('vat') and 'has-error' or ''} col-lg-6">
986                       <label class="control-label" for="vat" style="font-weight: normal">VAT Number</label>
987                       <input type="text" name="vat" class="form-control" t-att-value="checkout.get('vat')"/>
988                   </div>
989                   <div t-attf-class="form-group #{error.get('email') and 'has-error' or ''} col-lg-6">
990                       <label class="control-label" for="contact_name">Email</label>
991                       <input type="email" name="email" class="form-control" t-att-value="checkout.get('email')"/>
992                   </div>
993                   <div t-attf-class="form-group #{error.get('phone') and 'has-error' or ''} col-lg-6">
994                       <label class="control-label" for="phone">Phone</label>
995                       <input type="tel" name="phone" class="form-control" t-att-value="checkout.get('phone')"/>
996                   </div>
997
998                   <div t-attf-class="form-group #{error.get('street') and 'has-error' or ''} col-lg-6">
999                       <label class="control-label" for="street">Street</label>
1000                       <input type="text" name="street" class="form-control" t-att-value="checkout.get('street')"/>
1001                   </div>
1002                   <div class="clearfix"/>
1003
1004                   <div t-attf-class="form-group #{error.get('city') and 'has-error' or ''} col-lg-6">
1005                       <label class="control-label" for="city">City</label>
1006                       <input type="text" name="city" class="form-control" t-att-value="checkout.get('city')"/>
1007                   </div>
1008                   <div t-attf-class="form-group #{error.get('zip') and 'has-error' or ''} col-lg-6">
1009                       <label class="control-label" for="zip">Zip / Postal Code</label>
1010                       <input type="text" name="zip" class="form-control" t-att-value="checkout.get('zip')"/>
1011                   </div>
1012                   <div t-attf-class="form-group #{error.get('state_id') and 'has-error' or ''} col-lg-6">
1013                       <label class="control-label" for="state_id" style="font-weight: normal">State / Province</label>
1014                       <select name="state_id" class="form-control">
1015                           <option value="">select...</option>
1016                           <t t-foreach="states or []" t-as="state">
1017                               <option t-att-value="state.id" t-att-selected="state.id == checkout.get('state_id')"><t t-esc="state.name"/></option>
1018                           </t>
1019                       </select>
1020                   </div>
1021                   <div t-attf-class="form-group #{error.get('country_id') and 'has-error' or ''} col-lg-6">
1022                       <label class="control-label" for="contact_name">Country</label>
1023                       <select name="country_id" class="form-control">
1024                           <option value="">Country...</option>
1025                           <t t-foreach="countries or []" t-as="country">
1026                               <option t-att-value="country.id" t-att-selected="country.id == checkout.get('country_id')"><t t-esc="country.name"/></option>
1027                           </t>
1028                       </select>
1029                   </div>
1030
1031                   <div class="clearfix"/>
1032
1033                   <div class="form-group col-lg-6" groups="sale.group_delivery_invoice_address">
1034                       <label>
1035                           <input type="checkbox" name="shipping_different" t-att-checked="checkout.get('shipping_different')"/>
1036                           <span>Ship to a different address</span>
1037                       </label>
1038                   </div>
1039               </div>
1040               <div class="js_shipping row mb16" t-att-style="not checkout.get('shipping_different') and 'display:none' or ''" groups="sale.group_delivery_invoice_address">
1041                   <h3 class="oe_shipping col-lg-12 mt16">Shipping Information</h3>
1042
1043                   <div t-attf-class="form-group #{error.get('shipping_name') and 'has-error' or ''} col-lg-6">
1044                       <label class="control-label" for="contact_name">Name (Shipping)</label>
1045                       <input type="text" name="shipping_name" class="form-control" t-att-value="checkout.get('shipping_name', '')"/>
1046                   </div>
1047                   <div t-attf-class="form-group #{error.get('shipping_phone') and 'has-error' or ''} col-lg-6">
1048                       <label class="control-label" for="contact_name">Phone</label>
1049                       <input type="tel" name="shipping_phone" class="form-control" t-att-value="checkout.get('shipping_phone', '')"/>
1050                   </div>
1051                   <div t-attf-class="form-group #{error.get('shipping_street') and 'has-error' or ''} col-lg-6">
1052                       <label class="control-label" for="contact_name">Street</label>
1053                       <input type="text" name="shipping_street" class="form-control" t-att-value="checkout.get('shipping_street', '')"/>
1054                   </div>
1055                   <div class="clearfix"/>
1056                   <div t-attf-class="form-group #{error.get('shipping_city') and 'has-error' or ''} col-lg-6">
1057                       <label class="control-label" for="contact_name">City</label>
1058                       <input type="text" name="shipping_city" class="form-control" t-att-value="checkout.get('shipping_city', '')"/>
1059                   </div>
1060                   <div t-attf-class="form-group #{error.get('shipping_zip') and 'has-error' or ''} col-lg-6">
1061                       <label class="control-label" for="contact_name">Zip / Postal Code</label>
1062                       <input type="text" name="shipping_zip" class="form-control" t-att-value="checkout.get('shipping_zip', '')"/>
1063                   </div>
1064                   <div t-attf-class="form-group #{error.get('shipping_state_id') and 'has-error' or ''} col-lg-6">
1065                       <label class="control-label" for="contact_name" style="font-weight: normal">State / Province</label>
1066                       <select name="shipping_state_id" class="form-control">
1067                           <option value="">State / Province...</option>
1068                           <t t-foreach="states or []" t-as="state">
1069                               <option t-att-value="state.id" t-att-selected="state.id == checkout.get('shipping_state_id')"><t t-esc="state.name"/></option>
1070                           </t>
1071                       </select>
1072                   </div>
1073                   <div t-attf-class="form-group #{error.get('shipping_country_id') and 'has-error' or ''} col-lg-6">
1074                       <label class="control-label" for="contact_name">Country</label>
1075                       <select name="shipping_country_id" class="form-control">
1076                           <option value="">Country...</option>
1077                           <t t-foreach="countries or []" t-as="country">
1078                               <option t-att-value="country.id" t-att-selected="country.id == checkout.get('shipping_country_id')"><t t-esc="country.name"/></option>
1079                           </t>
1080                       </select>
1081                   </div>
1082               </div>
1083               <a class="btn btn-default btn-primary pull-right mb32 a-submit">Confirm <span class="fa fa-long-arrow-right"/></a>
1084           </div>
1085           <div class="col-lg-offset-1 col-lg-3 col-md-3 text-muted">
1086               <h3 class="page-header mt16">Your Order <small><a href="/shop/cart"><span class="fa fa-arrow-right"/> change</a></small></h3>
1087               <t t-set="website_sale_order" t-value="website.sale_get_order()"/>
1088               <div class="row">
1089                   <div class="col-sm-6 text-right">Subtotal: </div>
1090                   <div class="col-sm-6"><span t-field="website_sale_order.amount_untaxed" t-field-options='{
1091                       "widget": "monetary",
1092                       "display_currency": "website.pricelist_id.currency_id"
1093                   }'/></div>
1094                   <div class="col-sm-6 text-right">Taxes: </div>
1095                   <div class="col-sm-6"><span t-field="website_sale_order.amount_tax" t-field-options='{
1096                       "widget": "monetary",
1097                       "display_currency": "website.pricelist_id.currency_id"
1098                   }'/></div>
1099                   <div class="col-sm-6 text-right"><h4>Total To Pay: </h4></div>
1100                   <div class="col-sm-6"><h4><span t-field="website_sale_order.amount_total" t-field-options='{
1101                       "widget": "monetary",
1102                       "display_currency": "website.pricelist_id.currency_id"
1103                   }'/></h4></div>
1104               </div>
1105           </div>
1106       </div>
1107       </form>
1108     </div>
1109     </div>
1110   </t>
1111 </template>
1112
1113 <!-- /shop/payment -->
1114
1115 <template id="payment">
1116   <t t-call="website.layout">
1117       <t t-set="head">
1118           <script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
1119           <script type="text/javascript" src="/website_sale/static/src/js/website_sale_payment.js"></script>
1120           <link rel='stylesheet' href='/website_sale/static/src/css/website_sale.css'/>
1121           <t t-raw="head or ''"/>
1122       </t>
1123       <t t-set="additional_title">Shop - Select Payment Mode</t>
1124       <div id="wrap">
1125         <div class="container oe_website_sale">
1126
1127           <ul class="wizard pull-right">
1128               <li><a href="/shop/cart" class="text-success">Review Order<span class="chevron"></span></a></li>
1129               <li><a href="/shop/checkout" class="text-success">Shipping &amp; Billing<span class="chevron"></span></a></li>
1130               <li class="text-primary">Payment<span class="chevron"></span></li>
1131               <li class="text-muted">Confirmation<span class="chevron"></span></li>
1132           </ul>
1133           <h1 class="mb32">Validate Order</h1>
1134           <div class="row">
1135           <div class="col-lg-8 col-sm-9 oe_cart">
1136               <t t-set="website_sale_order" t-value="website.sale_get_order()"/>
1137               <table class='table table-striped table-condensed' id="cart_products" t-if="website_sale_order and website_sale_order.website_order_line">
1138                   <thead>
1139                       <tr>
1140                           <th colspan="2" width="80">Product</th>
1141                           <th width="100">Price</th>
1142                           <th width="120">Quantity</th>
1143                       </tr>
1144                   </thead>
1145                   <tbody>
1146                       <tr t-foreach="website_sale_order.website_order_line" t-as="line">
1147                           <td colspan="2" t-if="not line.product_id.product_tmpl_id"></td>
1148                           <td t-if="line.product_id.product_tmpl_id">
1149                               <a t-attf-href="/shop/product/#{ slug(line.product_id.product_tmpl_id) }">
1150                                   <span t-field="line.product_id.image_small"
1151                                         t-field-options='{"widget": "image", "class": "img-rounded"}'/>
1152                               </a>
1153                           </td>
1154                           <td t-if="line.product_id.product_tmpl_id">
1155                              <strong t-field="line.product_id.name"/>
1156                           </td>
1157                           <td class="text-center">
1158                              <span t-field="line.price_unit" t-field-options='{
1159                                  "widget": "monetary",
1160                                  "display_currency": "website.pricelist_id.currency_id"
1161                              }'/>
1162                           </td>
1163                           <td>
1164                              <div t-esc="line.product_uom_qty"/>
1165                           </td>
1166                       </tr>
1167                   </tbody>
1168               </table>
1169               <t t-call="website_sale.total"/>
1170               <div class="clearfix"/>
1171               <div class="oe_structure"/>
1172             </div>
1173             <div class="col-lg-3 col-lg-offset-1 col-sm-3 text-muted" id="right_column">
1174                 <h4>Bill To:</h4>
1175                 <div t-field="order.partner_invoice_id" t-field-options='{
1176                     "widget": "contact",
1177                     "fields": ["address", "name", "phone", "email"]
1178                     }'/>
1179                 <div>
1180                   <a href="/shop/checkout"><span class="fa fa-arrow-right"/> Change Address</a>
1181                 </div>
1182                 <t groups="sale.group_delivery_invoice_address">
1183                     <h4 class="mt32">Ship To:</h4>
1184                     <t t-if="website_sale_order.partner_shipping_id and website_sale_order.partner_shipping_id.id != website_sale_order.partner_invoice_id.id">
1185                       <div t-field="order.partner_shipping_id" t-field-options='{
1186                         "widget": "contact",
1187                         "fields": ["address", "name", "phone"]
1188                         }'/>
1189                     </t>
1190                     <address t-if="website_sale_order.partner_shipping_id.id == website_sale_order.partner_invoice_id.id">Ship to the same address</address>
1191                     <div class="mb32">
1192                       <a href="/shop/checkout"><span class="fa fa-arrow-right"/> Change Address</a>
1193                     </div>
1194                 </t>
1195             </div>
1196           </div>
1197
1198           <div class="js_payment mb64 row" t-if="acquirers and website_sale_order.amount_total" id="payment_method">
1199               <div class="col-lg-5 col-sm-6">
1200                   <h4>Payment Method:</h4>
1201                   <ul class="list-unstyled">
1202                     <li t-foreach="acquirers or []" t-as="acquirer">
1203                       <label t-if="acquirer.button">
1204                           <input t-att-value="acquirer.id" type="radio" name="acquirer" t-att-checked="acquirers[0] == acquirer"/>
1205                           <img class="media-object" style="width: 60px; display: inline-block;"
1206                               t-att-title="acquirer.name"
1207                               t-att-src="'/payment_%s/static/src/img/%s_icon.png' % (acquirer.provider, acquirer.provider)"/>
1208                               <span t-field="acquirer.name"/>
1209                       </label>
1210                     </li>
1211                   </ul>
1212               </div>
1213               <div class="col-lg-3 col-sm-3">
1214                   <t t-foreach="acquirers or []" t-as="acquirer">
1215                       <div t-att-data-id="acquirer.id" class="oe_sale_acquirer_button hidden pull-right">
1216                         <div t-raw="acquirer.button"/>
1217                         <div t-field="acquirer.pre_msg"/>
1218                       </div>
1219                   </t>
1220               </div>
1221           </div>
1222           <div class="js_payment mb64 row" t-if="not website_sale_order.amount_total" id="payment_method">
1223             <div class="col-lg-8 col-sm-8">
1224               <form target="_self" action="/shop/payment/validate" method="post" class="pull-right">
1225                   <a style="width:100px;" class="btn btn-primary a-submit">
1226                     <span>Pay Now <span class="fa fa-long-arrow-right"></span></span>
1227                   </a>
1228               </form>
1229             </div>
1230           </div>
1231
1232         </div>
1233         <div class="oe_structure"/>
1234       </div>
1235
1236   </t>
1237 </template>
1238
1239 <template id="confirmation">
1240   <t t-call="website.layout">
1241       <t t-set="head">
1242           <link rel='stylesheet' href='/website_sale/static/src/css/website_sale.css'/>
1243           <script type="text/javascript" src="/website_sale/static/src/js/website_sale_validate.js"></script>
1244           <t t-raw="head or ''"/>
1245       </t>
1246       <t t-set="additional_title">Shop - Confirmed</t>
1247       <div id="wrap">
1248         <div class="container oe_website_sale">
1249
1250           <ul class="wizard pull-right">
1251               <li class="text-muted">Review Order<span class="chevron"></span></li>
1252               <li class="text-muted">Shipping &amp; Billing<span class="chevron"></span></li>
1253               <li class="text-muted">Payment<span class="chevron"></span></li>
1254               <li class="text-primary">Confirmation<span class="chevron"></span></li>
1255           </ul>
1256           <h1 class="mb32">Order <em t-field="order.name"/> Confirmed</h1>
1257           <div class="row">
1258               <div class="col-md-8 oe_cart">
1259                   <h2>Thank you for your order.</h2>
1260                   <div class="oe_website_sale_tx_status" t-att-data-order-id="order.id">
1261                   </div>
1262                   <div class="clearfix"/>
1263                   <div class="oe_structure"/>
1264               </div>
1265               <div class="col-md-3 col-md-offset-1 text-muted" id="right_column">
1266                 <h4>Bill To:</h4>
1267                 <div t-field="order.partner_invoice_id" t-field-options='{
1268                     "widget": "contact",
1269                     "fields": ["address", "name", "phone", "email"]
1270                     }'/>
1271                 <t groups="sale.group_delivery_invoice_address">
1272                     <h4 class="mt32">Ship To:</h4>
1273                     <t t-if="order.partner_shipping_id and order.partner_shipping_id.id != order.partner_invoice_id.id">
1274                       <div t-field="order.partner_shipping_id" t-field-options='{
1275                         "widget": "contact",
1276                         "fields": ["address", "name", "phone"]
1277                         }'/>
1278                     </t>
1279                     <address t-if="order.partner_shipping_id.id == order.partner_invoice_id.id">Ship to the same address</address>
1280                 </t>
1281               </div>
1282           </div>
1283
1284         </div>
1285         <div class="oe_structure"/>
1286       </div>
1287
1288   </t>
1289 </template>
1290
1291 <!-- Page Shop my cart and payment total -->
1292
1293 <template id="total">
1294     <table class='pull-right mb16' id="cart_total" t-if="website_sale_order">
1295         <thead>
1296             <tr width="100" style="border-top: 1px solid #000" id="order_total">
1297                 <th><h3>Total:&amp; </h3></th>
1298                 <th class="text-right">
1299                   <h3><span t-field="website_sale_order.amount_total" t-field-options='{
1300                       "widget": "monetary",
1301                       "display_currency": "website.pricelist_id.currency_id"
1302                     }'/></h3>
1303                 </th>
1304             </tr>
1305             <tr width="120" class="text-muted" id="order_total_taxes">
1306                 <td><abbr title="Taxes may be updated after providing shipping address">Taxes:</abbr></td>
1307                 <td class="text-right">
1308                     <span t-field="website_sale_order.amount_tax" t-field-options='{
1309                         "widget": "monetary",
1310                         "display_currency": "website.pricelist_id.currency_id"
1311                     }'/>
1312                 </td>
1313             </tr>
1314         </thead>
1315     </table>
1316 </template>
1317
1318 </data>
1319 </openerp>