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