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