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