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