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