[FIX] website_sale: filters and partner controller
[odoo/odoo.git] / addons / website_sale / views / website_sale.xml
index bfe58ce..b3f2c4f 100644 (file)
 <openerp>
 <data>
 
-    <record id="product_normal_form_view" model="ir.ui.view">
-        <field name="name">product.normal.form.inherit</field>
-        <field name="model">product.product</field>
-        <field name="inherit_id" ref="product.product_normal_form_view"/>
-        <field name="arch" type="xml">
-            <!-- add state field in header -->
-            <xpath expr="//sheet" position="before">
-                <div class="oe_form_box_info oe_text_center" attrs="{'invisible': [('sale_ok', '=', False)]}">
-                    <p attrs="{'invisible': [('website_published', '=', True)]}">
-                        This product is <b>not available</b> for public user in your ecommerce.
-                    </p>
-                    <p attrs="{'invisible': [('website_published', '=', False)]}">
-                        This product is <b>available</b> for public user in your ecommerce.
-                    </p>
-                    <p>Website view: <field class="oe_inline" name="website_url" widget="url"/></p>
-                </div>
-            </xpath>
-
-            <group name="sale" position="inside">
-                <group name="website" string="Website">
-                    <field name="website_published"/>
-                    <field name="suggested_product_ids" widget="many2many_tags"/>
-                    <field name="website_style_ids" widget="many2many_tags"/>
-                </group>
-            </group>
-        </field>
-    </record>
-
-    <record model="ir.ui.view" id="product_pricelist_view">
-        <field name="name">product.pricelist.website.form</field>
-        <field name="model">product.pricelist</field>
-        <field name="inherit_id" ref="product.product_pricelist_view"/>
-        <field name="arch" type="xml">
-            <field name="active" position="after">
-                <field name="code"/>
-            </field>
-        </field>
-    </record>
-
-    <record model="ir.ui.view" id="product_template_form_view">
-        <field name="name">product.template.product.website.form</field>
-        <field name="model">product.template</field>
-        <field name="inherit_id" ref="product.product_template_form_view"/>
-        <field name="arch" type="xml">
-            <!-- add state field in header -->
-            <xpath expr="//sheet" position="before">
-                <div class="oe_form_box_info oe_text_center" attrs="{'invisible': [('sale_ok', '=', False)]}">
-                    <p attrs="{'invisible': [('website_published', '=', True)]}">
-                        This product is <b>not available</b> for public user in your ecommerce.
-                    </p>
-                    <p attrs="{'invisible': [('website_published', '=', False)]}">
-                        This product is <b>available</b> for public user in your ecommerce.
-                    </p>
-                    <p>Website view: <field class="oe_inline" name="website_url" widget="url"/></p>
-                </div>
-            </xpath>
-
-            <xpath expr="//group[@string='Product Type']" position="inside">
-                    <field name="website_published"/>
-            </xpath>
-            <xpath expr="//page[@string='Information']" position="inside">
-                <group colspan="4" string="Products On Ecommerce">
-                    <field name="suggested_product_ids" widget="many2many_tags"/>
-                    <field name="website_style_ids" widget="many2many_tags"/>
-                </group>
-            </xpath>
-        </field>
-    </record>
-    
     <!-- Layout add nav and footer -->
 
-    <template id="header" inherit_id="website.layout" name="Custom Header">
+    <template id="website.secure_layout">
+        <xpath expr="//t[@id='editable_scripts_hook']" position="inside">
+              <script type="text/javascript" src="/website_sale/static/src/js/website_sale.editor.js" t-ignore="true"></script>
+              <script type="text/javascript" src="/website_sale/static/src/js/website.tour.shop.js" t-ignore="true"></script>
+        </xpath>
+    </template>
+
+    <template id="header" inherit_id="website.layout" name="Header Shop My Cart Link">
         <xpath expr="//header//ul[@id='top_menu']/li" position="before">
-            <li><a t-href="/shop/">Shop</a></li>
             <li t-att-class="(not website_sale_order or not website_sale_order.get_total_quantity()) and 'hidden' or ''">
-                <a t-href="/shop/mycart/">
-                    <i class="icon-shopping-cart"></i>
+                <a href="/shop/mycart/">
+                    <i class="fa fa-shopping-cart"></i>
                     My cart <sup t-attf-class="my_cart_quantity label label-primary"
                                   t-esc="website_sale_order and website_sale_order.get_total_quantity() or ''"/>
                 </a>
             </li>
         </xpath>
     </template>
+
     <!-- List of categories -->
 
-    <template id="categories_recursive">
-        <li t-att-class="category.id == category_id and 'active' or ''">
-            <a t-att-class="category.id not in categ[1] and 'unpublish' or ''" t-href="/shop/category/#{ category.id }/" t-field="category.name"></a>
+    <template id="categories_recursive" name="Category list">
+        <li t-att-class="str(category.id) == search.get('category') and 'active' or ''">
+            <a t-href="/shop/category/#{ category.id }/" t-field="category.name"></a>
             <ul t-if="category.child_id" class="nav nav-pills nav-stacked nav-hierarchy">
                 <t t-foreach="category.child_id" t-as="category">
-                    <t t-if="category.id in categ[1] or editable">
-                        <t t-call="website_sale.categories_recursive"/>
-                    </t>
+                    <t t-call="website_sale.categories_recursive"/>
                 </t>
             </ul>
         </li>
     </template>
 
-    <!-- Product list --> 
+    <!-- Product list -->
+
+    <template id="search" name="Search hidden fields">
+        <input type="hidden" name="category" t-att-value="search.get('category') or ''"/>
+        <input type="hidden" name="filters" t-att-value="search.get('filters') or ''"/>
+        <input type="text" name="search" class="search-query form-control" placeholder="Search..." t-att-value="search.get('search') or ''"/>
+    </template>
 
-    <template id="products_cart">
+    <template id="products_cart" name="Shopping cart">
       <div class="ribbon-wrapper">
         <div class="ribbon">Promo</div>
       </div>
       <div class="oe_product_description">
-          <a t-href="/shop/product/#{ product.id }/?#{ search and ('search=%s' % search) or ''}#{ category_id and ('&amp;category_id=%s' % category_id) or ''}">
+          <a t-href="/shop/product/#{ slug(product) }/" t-keep-query="category,search,filters">
               <b t-field="product.name"/>
           </a>
       </div>
-      <div class="product_price">
+      <div class="product_price" t-if="product.product_variant_ids">
           <b>
               <t t-if="product.product_variant_ids[0].lst_price != product.product_variant_ids[0].price">
-                <span class="text-danger" style="text-decoration: line-through;">
-                    <t t-esc="product.product_variant_ids[0].lst_price" /> €
-                </span>&amp;nbsp;
+                <del class="text-danger"
+                  t-field="product.product_variant_ids[0].lst_price" t-field-options='{
+                       "widget": "monetary",
+                       "display_currency": "website.pricelist_id.currency_id"
+                  }'/>&amp;nbsp;
               </t>
-              <t t-esc="product.product_variant_ids[0].price" /> €
+              <span t-field="product.product_variant_ids[0].price"  t-field-options='{
+                   "widget": "monetary",
+                   "display_currency": "website.pricelist_id.currency_id"
+               }'/>
           </b>
       </div>
       <div class="oe_product_image text-center">
-          <a t-href="/shop/product/#{ product.id }/?#{ search and ('search=%s' % search) or ''}#{ category_id and ('&amp;category_id=%s' % category_id) or ''}">
-              <img class="img" t-att-src="product.img('image')"/>
+          <a t-href="/shop/product/#{ product.id }/" t-keep-query="category,search,filters">
+              <span t-field="product.image" t-field-options='{"widget": "image"}'/>
           </a>
       </div>
     </template>
 
-    <template id="products" page="True">
+    <template id="products" name="Products">
         <t t-call="website.layout">
             <t t-set="head">
+                <script type="text/javascript" src="/web/static/lib/jquery.ui/js/jquery-ui-1.9.1.custom.js"></script>
+                <link rel='stylesheet' href="/web/static/lib/jquery.ui/css/smoothness/jquery-ui-1.9.1.custom.css"/>
                 <script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
                 <link rel='stylesheet' href='/website_sale/static/src/css/website_sale.css'/>
                 <t t-raw="head or ''"/>
             </t>
-            <t t-set="additional_title">Our Products</t>
+            <t t-set="additional_title">Shop</t>
             <div id="wrap">
               <div class="oe_structure"/>
               <div class="container oe_website_sale">
                 <div class="row">
-                    <div class="col-sm-4">
-                        <h1>Our Products</h1>
-                    </div><div class="col-sm-2 pagination text-center">
-                        <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>
-                    </div><div class="col-sm-6">
+                    <div class="col-sm-8 products_pager">
                         <t t-call="website.pager">
                             <t t-set="classname">pull-right</t>
+                            <t t-set="style">padding-left: 5px;</t>
                         </t>
-                        <form t-action="/shop/#{ category_id and ('category/%s/' % category_id) or ''}" method="get" class="pull-right pagination form-inline" style="padding-right: 5px;">
-                            <div class="form-group">
-                                <input type="text" name="search" class="search-query form-control" placeholder="Search..." t-att-value="search or ''"/>
-                            </div>
+                        <form action="/shop/" method="get" class="pull-right pagination form-inline" style="padding-right: 5px;">
+                            <t t-call="website_sale.search" />
                         </form>
                     </div>
                 </div>
 
                 <div class='style_default row'>
+                  <div class="hidden" id="products_grid_before"></div>
                   <div class="col-md-12" id="products_grid">
                     <table width="100%">
                       <tbody>
-                        <t t-set="table_products" t-value="get_bin_packing_products(product_ids, product_ids_for_holes, 4)"/>
-                        <tr t-foreach="table_products" t-as="tr_product">
+                        <tr>
+                          <td t-foreach="range(0,rows)" t-as="row" t-attf-width="#{100/rows}%"></td>
+                        </tr>
+                        <tr t-foreach="bins" t-as="tr_product">
                           <t t-foreach="tr_product" t-as="td_product">
                             <t t-if="td_product">
                             <t t-set="product" t-value="td_product['product']"/>
                                 t-attf-class="oe_product oe-height-#{td_product['y']*2} #{ td_product['class'] }">
 
                                 <div class="oe_product_cart" t-att-data-publish="product.website_published and 'on' or 'off'">
-                                  
+
                                   <div class="css_options" t-ignore="true" t-if="editable">
                                     <div t-attf-class="dropdown js_options" t-att-data-id="product.id">
                                       <a class="btn btn-default" t-att-id="'dopprod-%s' % product.id" role="button" data-toggle="dropdown">Options <span class="caret"></span></a>
                         </tr>
                       </tbody>
                     </table>
+                    <t t-if="not bins">
+                      <h3 class="text-center text-muted">No product found for this search</h3>
+                    </t>
                   </div>
                 </div>
-                <div class="text-center">
-                    <t t-call="website.pager" />
+                <div class="products_pager">
+                    <t t-call="website.pager">
+                        <t t-set="classname">pull-right</t>
+                    </t>
                 </div>
               </div>
               <div class="oe_structure mb32"/>
 
     <template id="add_to_basket" inherit_option_id="website_sale.products_cart" name="Add to Cart">
         <xpath expr="//div[@class='product_price']" position="inside">
-            <a t-href="./add_cart/?product_id=#{ product.id }" class="js_add_cart_json">
-                <span class="icon-shopping-cart"/>
+            <a t-href="/shop/add_cart/#{ product.product_variant_ids[0].id }/" class="js_add_cart_json">
+                <span class="fa fa-shopping-cart"/>
             </a>
         </xpath>
     </template>
     <!-- List view of products -->
 
     <template id="list_view" inherit_option_id="website_sale.products" name="List View">
-        <xpath expr="//div[@id='products_grid']/table" position="replace">
+        <xpath expr="//div[@id='products_grid']//table" position="replace">
           <div class="row">
-            <t t-set="products" t-value="get_products(product_ids)"/>
             <t t-foreach="products" t-as="product">
               <div class="col-md-12 oe_list_products oe-height-1">
                 <t t-call="website_sale.products_cart"/>
     </template>
 
 
-    <!-- product --> 
+    <!-- product -->
+    <template id="404">
+        <t t-call="website.layout">
+            <div id="wrap">
+                <div class="oe_structure oe_empty">
+                    <div class="container">
+                        <h1 class="mt32">Product not found!</h1>
+                        <p>Sorry, this product is not available anymore.</p>
+                        <p><a t-href="/shop/">Return to the product list.</a></p>
+                    </div>
+                </div>
+            </div>
+        </t>
+    </template>
 
     <template id="product" name="Product">
         <t t-call="website.layout">
                 <div class="row">
                   <div class="col-sm-5">
                       <ol class="breadcrumb">
-                          <li><a t-href="/shop">Products</a></li>
-                          <li t-if="category"><a t-att-href="'/shop/category/%s' % (category_id,)"><span t-field="category.name"/></a></li>
-                          <li class="active"><span t-field="product.name"></span></li>
+                          <li><a href="/shop">Products</a></li>
+                          <li t-if="search.get('category')"><a t-href="/shop/" t-keep-query="category,search,filters"><span t-field="category.name"/></a></li>
+                          <li class="active"><span t-field="product.name"/></li>
                       </ol>
                   </div><div class="col-sm-3">
                       <t t-call="website.publish_management">
                         </li>
                       </t>
                   </div><div class="col-sm-3 col-sm-offset-1">
-                      <form t-action="/shop/#{ category_id and ('category/%s/' % category_id) or ''}" method="get" class="pull-right">
-                          <div class="input-group">
-                              <span class="input-group-addon"><span class="glyphicon glyphicon-search"/></span>
-                              <input type="text" name="search" class="search-query form-control" placeholder="Search..." t-att-value="search or ''"/>
-                          </div>
-                      </form>
+                        <form action="/shop/" method="get" class="pull-right">
+                            <t t-call="website_sale.search" />
+                        </form>
                   </div>
                 </div>
               </section>
               <section class="container oe_website_sale mb16" id="product_detail">
                 <div class="row">
                   <div class="col-sm-7 col-md-7 col-lg-7">
-                      <img class="img" t-att-src="product.img('image')" style="max-height: 500px"/>
+                      <span t-field="product.image" style="max-height: 500px" t-field-options='{"widget": "image", "class": "img img-responsive"}'/>
                   </div><div class="col-sm-5 col-md-5 col-lg-4 col-lg-offset-1">
                       <h1 t-field="product.name">Product Name</h1>
 
-                      <form t-action="./add_cart/" class="js_add_cart_json">
-                          <input type="hidden" t-if="len(product.product_variant_ids) &lt;= 1" name="product_id" t-att-value="product.id"/>
+                      <form action="/shop/add_cart/" class="js_add_cart_json" method="POST">
+                          <input type="hidden" t-if="len(product.product_variant_ids) == 1" name="product_id" t-att-value="product.product_variant_ids[0].id"/>
                           <t t-if="len(product.product_variant_ids) &gt; 1">
-                              <label label-default="label-default" class="radio" t-foreach="product.product_variant_ids" t-as="product">
-                                  <input type="radio" name="product_id" t-att-value="product.id" t-att-checked="product == product.product_variant_ids[0] or None"/>
-                                  <t t-esc="product.variants or ''">Standard</t>
-                                  <span class="badge" t-if="product.price_extra">
-                                      <t t-esc="product.price_extra > 0 and '+' or ''"/><span t-esc="product.price_extra"/> €
+                              <label label-default="label-default" class="radio" t-foreach="product.product_variant_ids" t-as="variant_id">
+                                  <input type="radio" name="product_id" t-att-value="variant_id.id" t-att-checked="variant_id == product.product_variant_ids[0] or None"/>
+                                  <t t-esc="variant_id.variants or ''">Standard</t>
+                                  <span class="badge" t-if="variant_id.price_extra">
+                                      <t t-esc="variant_id.price_extra > 0 and '+' or ''"/><span t-field="variant_id.price_extra" t-field-options='{
+                                                   "widget": "monetary",
+                                                   "display_currency": "website.pricelist_id.currency_id"
+                                               }'/>
                                   </span>
                               </label>
                               <br/>
                           </t>
 
-                          <div class="product_price">
-                              <b>
+                          <div class="product_price mt16" t-if="product.product_variant_ids">
+                              <h4>
                                   <t t-if="product.product_variant_ids[0].lst_price != product.product_variant_ids[0].price">
-                                    <span class="text-danger" style="text-decoration: line-through;">
-                                        <t t-esc="product.product_variant_ids[0].lst_price" /> €
-                                    </span>&amp;nbsp;
+                                  <span class="text-danger" style="text-decoration: line-through;"
+                                    t-field="product.product_variant_ids[0].lst_price"
+                                    t-field-options='{
+                                       "widget": "monetary",
+                                       "display_currency": "website.pricelist_id.currency_id"
+                                   }'/><br/>
                                   </t>
-                                  <h4><b><span class="oe_price" t-esc="product.product_variant_ids[0].price" /> €</b></h4>
-                              </b>
+                                  <b class="oe_price"
+                                    t-field="product.product_variant_ids[0].price"
+                                    t-field-options='{
+                                       "widget": "monetary",
+                                       "display_currency": "website.pricelist_id.currency_id"
+                                   }'/>
+                              </h4>
                           </div>
                           <button class="btn btn-primary btn-lg mt8">Add to Cart</button>
                           <hr t-if="product.description_sale"/>
                 <t t-foreach="product.recommended_products()" t-as="product">
                     <div class='col-md-2 thumbnail' style='width: 170px; margin-right: 16px;'>
                         <div class='mt16 text-center'>
-                            <img t-att-src="product.img('image_small')"/>
+                            <span t-field="product.image_small"/>
                             <h5>
-                                <a t-href="/shop/product/#{ product.id }/"
+                                <a t-href="/shop/product/#{ slug(product) }/"
                                    style="display: block">
                                     <span t-field='product.name'
                                           style="display: block"/>
         </xpath>
     </template>
 
-    <!-- Page Shop my cart --> 
+    <template id="product_attributes" inherit_option_id="website_sale.product" name="Product Attributes">
+      <xpath expr="//p[@t-field='product.description_sale']" position="after">
+        <hr t-if="product.website_attribute_ids"/>
+        <p class="text-muted">
+          <t t-set="attr" t-value="None"/>
+          <t t-foreach="product.website_attribute_ids" t-as="attribute"><br t-if="attr and attribute.attribute_id.id != attr"/><t t-if="attribute.attribute_id.id != attr"><span t-field="attribute.attribute_id"/>: </t><t t-if="attribute.attribute_id.id == attr">, </t><t t-if="attribute.attribute_id.type == 'distinct'"><span t-field="attribute.value_id"/></t><t t-if="attribute.attribute_id.type == 'float'"><span t-field="attribute.value"/></t><t t-set="attr" t-value="attribute.attribute_id.id"/></t>
+        </p>
+      </xpath>
+    </template>
+
+    <!-- Page Shop my cart -->
 
-    <template id="mycart" name="Your Cart" page="True">
+    <template id="mycart" name="Your Cart">
         <t t-call="website.layout">
             <t t-set="head">
                 <script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
                     <li class="text-muted">Payment<span class="chevron"></span></li>
                     <li class="text-muted">Confirmation<span class="chevron"></span></li>
                 </ul>
-                <h1 class="mb32">Your Cart</h1>
-
+                <h1 class="mb32">Shopping Cart</h1>
                 <div class="row">
-                <div class="col-md-8 oe_mycart">
-                    <div t-if="not website_sale_order or not website_sale_order.order_line" class="well well-lg">
-                        Your cart is empty!
-                    </div>
-                    <table class='table table-striped table-condensed' id="mycart_products" t-if="website_sale_order and website_sale_order.order_line">
-                        <colgroup>
-                            <col width="80"/>
-                            <col/>
-                            <col width="100"/>
-                            <col width="120"/>
-                        </colgroup>
-                        <thead>
-                            <tr>
-                                <th colspan="2">Product</th>
-                                <th>Price</th>
-                                <th>Quantity</th>
-                            </tr>
-                        </thead>
-                        <tbody>
-                            <tr t-foreach="website_sale_order.order_line" t-as="line">
-                                <td colspan="2" t-if="not line.product_id.product_tmpl_id"></td>
-                                <td t-if="line.product_id.product_tmpl_id">
-                                    <img class="img-rounded" t-att-src="line.product_id.img('image_small')"/>
-                                </td>
-                                <td t-if="line.product_id.product_tmpl_id">
-                                    <div>
-                                        <a t-href="/shop/product/#{ line.product_id.product_tmpl_id.id }/">
-                                            <strong t-field="line.product_id.name"/>
-                                        </a>
-                                    </div>
-                                    <div class="text-muted" t-field="line.product_id.description_sale"/>
-                                </td>
-                                <td class="text-center">
-                                   <div class="text-danger" style="text-decoration: line-through;" t-if="line.product_id.lst_price &gt; line.price_unit">
-                                       <t t-esc="line.product_id.lst_price" /> €
-                                   </div>
-                                   <span t-field="line.price_unit"></span> €
-                                </td>
-                                <td>
-                                    <div class="input-group">
-                                        <span class="input-group-addon">
-                                            <a t-href="./remove_cart/?order_line_id=#{ line.id }" t-att-data-id="line.id" class="mb8 js_add_cart_json">
-                                                <span class="icon-minus"/>
-                                            </a>
-                                        </span>
-                                        <input type="text" class="js_quantity form-control"
-                                            t-att-data-id="line.id" t-att-value="int(line.product_uom_qty)"/>
-                                        <span class="input-group-addon">
-                                            <a t-href="./add_cart/?order_line_id=#{ line.id }" t-att-data-id="line.id" class="mb8 float_left js_add_cart_json">
-                                                <span class="icon-plus"/>
+                    <div class="col-md-8 col-sm-9 oe_mycart">
+                        <div t-if="not website_sale_order or not website_sale_order.order_line" class="well well-lg">
+                            Your cart is empty!
+                        </div>
+                        <table class='table table-striped table-condensed' id="mycart_products" t-if="website_sale_order and website_sale_order.order_line">
+                            <colgroup>
+                                <col width="80"/>
+                                <col/>
+                                <col width="100"/>
+                                <col width="120"/>
+                            </colgroup>
+                            <thead>
+                                <tr>
+                                    <th colspan="2">Product</th>
+                                    <th>Price</th>
+                                    <th>Quantity</th>
+                                </tr>
+                            </thead>
+                            <tbody>
+                                <tr t-foreach="website_sale_order.order_line" t-as="line">
+                                    <td colspan="2" t-if="not line.product_id.product_tmpl_id"></td>
+                                    <td t-if="line.product_id.product_tmpl_id">
+                                        <span t-field="line.product_id.image_small"
+                                              t-field-options='{"widget": "image", "class": "img-rounded"}'/>
+                                    </td>
+                                    <td t-if="line.product_id.product_tmpl_id">
+                                        <div>
+                                            <a t-href="/shop/product/#{ slug(line.product_id.product_tmpl_id) }/">
+                                                <strong t-field="line.product_id.name"/>
+                                                <t t-if="line.product_id.variants">(<t t-esc="line.product_id.variants"/>)</t>
                                             </a>
-                                        </span>
-                                    </div>
-                                    
-                                </td>
-                            </tr>
-                        </tbody>
-                    </table>
-                    <table class='pull-right mb16' id="mycart_total">
-                        <colgroup>
-                            <col width="100"/>
-                            <col width="120"/>
-                        </colgroup>
-                        <thead>
-                            <tr style="border-top: 1px solid #000">
-                                <th><h3>Total:</h3></th>
-                                <th class="text-right"><h3><t t-esc="website_sale_order and website_sale_order.amount_total or 0"/> €</h3></th>
-                            </tr>
-                            <tr class="text-muted">
-                                <td><abbr title="Taxes may be updated after providing shipping address">Incl. Taxes:</abbr></td>
-                                <td class="text-right"><t t-esc="website_sale_order and website_sale_order.amount_tax or 0"/> €</td>
-                            </tr>
-                        </thead>
-                    </table>
-                    <div class="clearfix"/>
-
-                    <a t-href="/shop" class="btn btn-default"><span class="icon-long-arrow-left"/> Continue Shopping</a>
-                    <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>
-                    <div class="oe_structure"/>
-                  </div>
-                  <div class="col-md-3 col-md-offset-1 text-muted" id="right_column">
-                      <h4>Policies</h4>
-                      <ul class="list-unstyled mb32">
-                        <li>&#9745; 30-days money-back guarantee</li>
-                        <li>&#9745; Invoice sent by e-Mail</li>
-                      </ul>
-
-                      <h4>Secure Payment</h4>
-                      <ul class="list-unstyled mb32">
-                        <li>&#9745; Transation 256bit encrypted</li>
-                        <li>&#9745; Processed by Ogone</li>
-                      </ul>
-
-                  </div>
+                                        </div>
+                                        <div class="text-muted" t-field="line.product_id.description_sale"/>
+                                    </td>
+                                    <td class="text-center">
+                                       <del class="text-danger" t-if="line.product_id.lst_price &gt; line.price_unit">
+                                           <span t-field="line.product_id.lst_price" t-field-options='{
+                                               "widget": "monetary",
+                                               "display_currency": "website.pricelist_id.currency_id"
+                                           }'/>
+                                       </del>
+                                       <span t-field="line.price_unit" t-field-options='{
+                                           "widget": "monetary",
+                                           "display_currency": "website.pricelist_id.currency_id"
+                                       }'/>
+                                    </td>
+                                    <td>
+                                        <div class="input-group">
+                                            <span class="input-group-addon">
+                                                <a t-href="./change_cart/#{ line.id }/?remove=True" class="mb8 js_add_cart_json">
+                                                    <i class="fa fa-minus-square"></i>
+                                                </a>
+                                            </span>
+                                            <input type="text" class="js_quantity form-control"
+                                                t-att-data-id="line.id" t-att-value="int(line.product_uom_qty)"/>
+                                            <span class="input-group-addon">
+                                                <a t-href="./change_cart/#{ line.id }/" class="mb8 float_left js_add_cart_json">
+                                                    <i class="fa fa-plus-square"></i>
+                                                </a>
+                                            </span>
+                                        </div>
+
+                                    </td>
+                                </tr>
+                            </tbody>
+                        </table>
+                        <table class='pull-right mb16' id="mycart_total" t-if="website_sale_order">
+                            <colgroup>
+                                <col width="100"/>
+                                <col width="120"/>
+                            </colgroup>
+                            <thead>
+                                <tr style="border-top: 1px solid #000">
+                                    <th><h3>Total:</h3></th>
+                                    <th class="text-right">
+                                      <h3><t t-call="website_sale.total"/></h3>
+                                    </th>
+                                </tr>
+                                <tr class="text-muted">
+                                    <td><abbr title="Taxes may be updated after providing shipping address">Incl. Taxes:</abbr></td>
+                                    <td class="text-right">
+                                        <span t-field="website_sale_order.amount_tax" t-field-options='{
+                                            "widget": "monetary",
+                                            "display_currency": "website.pricelist_id.currency_id"
+                                        }'/>
+                                    </td>
+                                </tr>
+                            </thead>
+                        </table>
+                        <div class="clearfix"/>
+                        <a href="/shop" class="btn btn-default mb32"><span class="fa fa-long-arrow-left"/> Continue Shopping</a>
+                        <a t-if="website_sale_order and website_sale_order.order_line" href="/shop/checkout/" class="btn btn-primary pull-right mb32">Process Checkout <span class="fa fa-long-arrow-right"/></a>
+                        <div class="oe_structure"/>
+                    </div>
+                    <div class="col-lg-3 col-lg-offset-1 col-sm-3 text-muted" id="right_column">
+                        <h4>Policies</h4>
+                        <ul class="list-unstyled mb32">
+                            <li>&#9745; 30-days money-back guarantee</li>
+                            <li>&#9745; Invoice sent by e-Mail</li>
+                        </ul>
+                        <h4>Secure Payment</h4>
+                        <ul class="list-unstyled mb32">
+                            <li>&#9745; 256 bit encryption</li>
+                            <li>&#9745; Processed by Ogone</li>
+                        </ul>
+                    </div>
                 </div>
 
               </div>
         </t>
     </template>
 
-    <!-- Page Shop --> 
+    <!-- Page Shop -->
 
     <template id="products_categories" inherit_option_id="website_sale.products" name="Product Categories">
-        <xpath expr="//div[@id='products_grid']" position="before">
-            <div class="col-md-3">
+        <xpath expr="//div[@id='products_grid_before']" position="inside">
+            <ul class="nav nav-pills nav-stacked mt16">
+                <li t-att-class=" '' if search.get('category') else 'active' "><a href="/shop/">All Products</a></li>
+                <t t-foreach="categories" t-as="category">
+                    <t t-call="website_sale.categories_recursive"/>
+                </t>
+            </ul>
+        </xpath>
+        <xpath expr="//div[@id='products_grid_before']" position="attributes">
+            <attribute name="class">col-md-3</attribute>
+        </xpath>
+        <xpath expr="//div[@id='products_grid']" position="attributes">
+            <attribute name="class">col-md-9</attribute>
+        </xpath>
+    </template>
+
+    <template id="products_attributes" inherit_option_id="website_sale.products" name="Product Filters and Attributes">
+        <xpath expr="//div[@id='products_grid_before']" position="inside">
+            <form t-action="/shop/filters/" method="post" t-keep-query="category,search">
                 <ul class="nav nav-pills nav-stacked mt16">
-                    <li t-att-class=" '' if category_id else 'active' "><a t-href="/shop/">All Products</a></li>
-                    <t t-set="categ" t-value="get_categories()"/>
-                    <t t-foreach="categ[0]" t-as="category">
-                        <t t-call="website_sale.categories_recursive"/>
+                    <t t-set="attribute_ids" t-value="Ecommerce.get_attribute_ids()"/>
+                    <t t-foreach="attribute_ids" t-as="attribute_id">
+                      <t t-if="attribute_id.visible">
+                        <li t-if="attribute_id.value_ids and attribute_id.type == 'distinct'">
+                            <div t-field="attribute_id.name"/>
+                            <ul class="nav nav-pills nav-stacked">
+                                <t t-foreach="attribute_id.value_ids" t-as="value_id">
+                                    <li t-att-class="Ecommerce.has_search_filter(attribute_id.id, value_id.id) and 'active' or ''">
+                                        <label style="margin: 0 20px;">
+                                            <input type="checkbox" t-att-name="'att-%s-%s' % (attribute_id.id, value_id.id)"
+                                                t-att-checked="Ecommerce.has_search_filter(attribute_id.id, value_id.id) and 'checked' or ''"/>
+                                            <span style="font-weight: normal" t-field="value_id.name"/>
+                                        </label>
+                                    </li>
+                                </t>
+                            </ul>
+                        </li>
+                        <li t-if="attribute_id.type == 'float' and attribute_id.float_min != attribute_id.float_max">
+                            <div t-field="attribute_id.name"/>
+                            <t t-set="attribute" t-value="Ecommerce.has_search_filter(attribute_id.id)"/>
+                            <div style="margin: 0 20px;" class="js_slider"
+                              t-att-data-id="attribute_id.id"
+                              t-att-data-value-min="attribute and attribute[1][0] or attribute_id.float_min"
+                              t-att-data-value-max="attribute and attribute[1][1] or attribute_id.float_max"
+                              t-att-data-min="attribute_id.float_min"
+                              t-att-data-max="attribute_id.float_max"></div>
+                        </li>
+                      </t>
                     </t>
                 </ul>
-            </div>
+                <button class="btn btn-xs btn-primary mt16">Apply filter</button>
+                <a t-href="/shop/" t-keep-query="category,search" class="btn btn-xs btn-default mt16">Cancel filter</a>
+            </form>
+        </xpath>
+        <xpath expr="//div[@id='products_grid_before']" position="attributes">
+            <attribute name="class">col-md-3</attribute>
         </xpath>
         <xpath expr="//div[@id='products_grid']" position="attributes">
             <attribute name="class">col-md-9</attribute>
         </xpath>
     </template>
 
-
-    <template id="suggested_products_list" inherit_id="website_sale.mycart" inherit_option_id="website_sale.mycart" name="Suggested Products in list view">
+    <template id="suggested_products_list" inherit_id="website_sale.mycart" inherit_option_id="website_sale.mycart" name="Suggested Products in my cart">
         <xpath expr="//table[@id='mycart_products']" position="after">
             <table t-if="suggested_products" class='table table-striped table-condensed'>
                 <colgroup>
                     <tr t-foreach="suggested_products" t-as="product">
 
                         <td>
-                            <a t-href="/shop/product/#{ product.product_tmpl_id.id }/">
-                                <img class="img-rounded" t-att-src="product.img('image_small')"/>
+                            <a t-href="/shop/product/#{ slug(product.product_tmpl_id) }/">
+                                <span t-field="product.image_small"
+                                      t-field-options='{"widget": "image", "class": "img-rounded"}'/>
                             </a>
                         </td>
                         <td>
                             <div>
-                                <a t-href="/shop/product/#{ product.product_tmpl_id.id }/">
+                                <a t-href="/shop/product/#{ slug(product.product_tmpl_id) }/">
                                     <strong t-field="product.name"/>
                                 </a>
                             </div>
                             <div class="text-muted" t-field="product.description_sale"/>
                         </td>
                         <td>
-                            <span t-field="product.lst_price"></span> €
+                            <span t-field="product.lst_price" t-field-options='{
+                                "widget": "monetary",
+                                "display_currency": "website.pricelist_id.currency_id"
+                            }'/>
                         </td>
                         <td class="text-center">
-                            <a t-href="./add_cart/?product_id=#{ product.id }"><strong>Add to Cart</strong></a>
+                            <a t-href="./add_cart/#{ product.id }/"><strong>Add to Cart</strong></a>
                         </td>
                     </tr>
                 </tbody>
             <p>
                 Have a coupon code? Fill in this field and apply.
             </p>
-            <form t-if="website_sale_order and website_sale_order.order_line" t-action="/shop/mycart/" method="post" class="mb32">
+            <form t-if="website_sale_order and website_sale_order.order_line" action="/shop/mycart/" method="post" class="mb32">
                 <div class="input-group">
                     <input name="promo" class='form-control' type="text" placeholder="code..." t-att-value="website_sale_order.pricelist_id.code or ''"/>
                     <div class="input-group-btn">
                     <li class="text-muted">Confirmation<span class="chevron"></span></li>
                 </ul>
                 <h1>Your Address</h1>
-                <form t-action="/shop/confirm_order/" method="post">
+                <form action="/shop/confirm_order/" method="post">
 
                 <div class="row">
                 <div class="col-md-8 oe_mycart">
-                    <h3 class="page-header mt16">Set Billing Information
-                        <small t-if="user_id.id == website.public_user.id"> or 
-                            <a t-if="not partner" t-attf-href="/admin#action=redirect&amp;url=#{ request.httprequest.host_url }/shop/checkout/">sign in</a>
+                    <h3 class="page-header mt16">Billing Information
+                        <small t-if="user_id.id == website.public_user.id"> or
+                            <a t-if="not partner" t-attf-href="/web#action=redirect&amp;url=#{ request.httprequest.url }">sign in</a>
                         </small>
                     </h3>
                         <div class="row">
                                 <input type="email" name="email" class="form-control" t-att-value="checkout.get('email')"/>
                             </div>
                             <div t-attf-class="form-group #{ error.get('phone') and 'has-error' or ''} col-lg-6">
-                                <label class="control-label" for="phone">Telephone</label>
+                                <label class="control-label" for="phone">Phone</label>
                                 <input type="tel" name="phone" class="form-control" t-att-value="checkout.get('phone')"/>
                             </div>
 
                                 <input type="text" name="shipping_name" class="form-control" t-att-value="checkout.get('shipping_name', '')"/>
                             </div>
                             <div t-attf-class="form-group #{error.get('shipping_phone') and 'has-error' or ''} col-lg-6">
-                                <label class="control-label" for="contact_name">Telephone</label>
+                                <label class="control-label" for="contact_name">Phone</label>
                                 <input type="tel" name="shipping_phone" class="form-control" t-att-value="checkout.get('shipping_phone', '')"/>
                             </div>
                             <div t-attf-class="form-group #{error.get('shipping_street') and 'has-error' or ''} col-lg-6">
                                 </select>
                             </div>
                         </div>
-                        <button type="submit" class="btn btn-default btn-primary pull-right mb32">Confirm <span class="icon-long-arrow-right"/></button>
+                        <button type="submit" class="btn btn-default btn-primary pull-right mb32">Confirm <span class="fa fa-long-arrow-right"/></button>
                 </div>
                 <div class="col-lg-offset-1 col-lg-3 text-muted">
-                    <h3 class="page-header mt16">Your Order <small><a href="/shop/mycart"><span class="icon-arrow-right"/> change</a></small></h3>
+                    <h3 class="page-header mt16">Your Order <small><a href="/shop/mycart"><span class="fa fa-arrow-right"/> change</a></small></h3>
                     <div class="row">
                         <div class="col-sm-6 text-right">Subtotal:</div>
-                        <div class="col-sm-6"><t t-esc="website_sale_order.amount_untaxed or 0"/> €</div>
+                        <div class="col-sm-6"><span t-esc="website_sale_order.amount_untaxed" t-field-options='{
+                            "widget": "monetary",
+                            "display_currency": "website.pricelist_id.currency_id"
+                        }'/></div>
                         <div class="col-sm-6 text-right">Taxes:</div>
-                        <div class="col-sm-6"><t t-esc="website_sale_order.amount_tax or 0"/> €</div>
+                        <div class="col-sm-6"><span t-field="website_sale_order.amount_tax" t-field-options='{
+                            "widget": "monetary",
+                            "display_currency": "website.pricelist_id.currency_id"
+                        }'/></div>
                         <div class="col-sm-6 text-right"><h4>Total To Pay:</h4></div>
-                        <div class="col-sm-6"><h4><t t-esc="website_sale_order.amount_total or 0"/> €</h4></div>
+                        <div class="col-sm-6"><h4><span t-field="website_sale_order.amount_total" t-field-options='{
+                            "widget": "monetary",
+                            "display_currency": "website.pricelist_id.currency_id"
+                        }'/></h4></div>
                     </div>
-                    <button type="submit" class="btn btn-default btn-primary pull-right mt16" t-if="user_id.id != website.public_user.id">
-                        Confirm <span class="icon-long-arrow-right"/>
-                    </button>
-
                 </div>
             </div>
             </form>
         <t t-call="website.layout">
             <t t-set="head">
                 <script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
+                <script type="text/javascript" src="/website_sale/static/src/js/website_sale_payment.js"></script>
                 <link rel='stylesheet' href='/website_sale/static/src/css/website_sale.css'/>
                 <t t-raw="head or ''"/>
             </t>
                 </ul>
                 <h1 class="mb32">Validate Order</h1>
                 <div class="row">
-                <div class="col-md-8 oe_mycart">
+                <div class="col-lg-8 col-sm-9 oe_mycart">
                     <table class='table table-striped table-condensed' id="mycart_products" t-if="website_sale_order and website_sale_order.order_line">
                         <colgroup>
                             <col width="80"/>
                             <tr t-foreach="website_sale_order.order_line" t-as="line">
                                 <td colspan="2" t-if="not line.product_id.product_tmpl_id"></td>
                                 <td t-if="line.product_id.product_tmpl_id">
-                                    <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>
+                                    <a t-href="/shop/product/#{ slug(line.product_id.product_tmpl_id) }/">
+                                        <span t-field="line.product_id.image_small"
+                                              t-field-options='{"widget": "image", "class": "img-rounded"}'/>
+                                    </a>
                                 </td>
                                 <td t-if="line.product_id.product_tmpl_id">
                                    <strong t-field="line.product_id.name"/>
                                 </td>
                                 <td class="text-center">
-                                   <span t-field="line.price_unit"></span> €
+                                   <span t-field="line.price_unit" t-field-options='{
+                                       "widget": "monetary",
+                                       "display_currency": "website.pricelist_id.currency_id"
+                                   }'/>
                                 </td>
                                 <td>
                                    <div t-esc="line.product_uom_qty"/>
                         <thead>
                             <tr style="border-top: 1px solid #000">
                                 <th><h3>Total:</h3></th>
-                                <th class="text-right"><h3><t t-esc="website_sale_order and website_sale_order.amount_total or 0"/> €</h3></th>
+                                <th class="text-right"><h3><span t-field="website_sale_order.amount_total" t-field-options='{
+                                    "widget": "monetary",
+                                    "display_currency": "website.pricelist_id.currency_id"
+                                }'/></h3></th>
                             </tr>
                             <tr class="text-muted">
-                                <td><abbr title="Taxes may be updated after providing shipping address">Incl. Taxes:</abbr></td>
-                                <td class="text-right"><t t-esc="website_sale_order and website_sale_order.amount_tax or 0"/> €</td>
+                                <td>Incl. Taxes:</td>
+                                <td class="text-right"><span t-field="website_sale_order.amount_tax" t-field-options='{
+                                    "widget": "monetary",
+                                    "display_currency": "website.pricelist_id.currency_id"
+                                }'/></td>
                             </tr>
                         </thead>
                     </table>
                     <div class="clearfix"/>
                     <div class="oe_structure"/>
                   </div>
-                  <div class="col-md-3 col-md-offset-1 text-muted" id="right_column">
+                  <div class="col-lg-3 col-lg-offset-1 col-sm-3 text-muted" id="right_column">
                       <h4>Bill To:</h4>
                       <div t-field="website_sale_order.partner_invoice_id"/>
                       <div>
-                        <a href="/shop/checkout"><span class="icon-arrow-right"/> Change Address</a>
+                        <a href="/shop/checkout"><span class="fa fa-arrow-right"/> Change Address</a>
                       </div>
 
                       <h4 class="mt32">Ship To:</h4>
                       <div t-field="website_sale_order.partner_shipping_id"/>
                       <div>
-                        <a href="/shop/checkout"><span class="icon-arrow-right"/> Change Address</a>
+                        <a href="/shop/checkout"><span class="fa fa-arrow-right"/> Change Address</a>
                       </div>
 
                   </div>
                 </div>
 
-                <div class="js_payment mb64">
-                    <p>Select your payment method:</p>
-                    <div>
-                        <t t-foreach="payments or []" t-as="payment">
-                            <label>
-                                <input t-att-value="payment.id" type="radio" name="payment_type"/> <t t-esc="payment.name"/>
+                <div class="js_payment mb64" t-if="acquirers" id="payment_method">
+                    <h3>Choose your payment method</h3>
+                    <div class="col-lg-5 col-sm-6">
+                        <t t-foreach="acquirers or []" t-as="acquirer">
+                            <label t-if="acquirer.button" class="oe_sale_acquirer_logo" style="display: block;">
+                                <input t-att-value="acquirer.id" type="radio" name="acquirer"/>
+                                <img class="media-object" style="width: 60px; display: inline-block;"
+                                    t-att-title="acquirer.name"
+                                    t-att-src="'/payment_acquirer_%s/static/src/img/%s_icon.png' % (acquirer.name, acquirer.name)"/>
                             </label>
                         </t>
                     </div>
-                    <t t-foreach="payments or []" t-as="payment">
-                        <div t-att-data-id="payment.id" t-raw="payment._content" class="hidden"/>
-                    </t>
-                    <a t-href="/shop/payment_validate/" class="btn btn-primary mt16">Validate &amp; Pay <span class="icon-long-arrow-right"/></a>
+                    <div class="col-lg-3 col-sm-3">
+                        <t t-foreach="acquirers or []" t-as="acquirer">
+                            <div t-att-data-id="acquirer.id" t-raw="acquirer.button" class="oe_sale_acquirer_button hidden"/>
+                        </t>
+                    </div>
+                </div>
+
+              </div>
+              <div class="oe_structure"/>
+            </div>
+
+        </t>
+    </template>
+
+    <template id="confirmation">
+        <t t-call="website.layout">
+            <t t-set="head">
+                <link rel='stylesheet' href='/website_sale/static/src/css/website_sale.css'/>
+                <script type="text/javascript" src="/website_sale/static/src/js/website_sale_validate.js"></script>
+                <t t-raw="head or ''"/>
+            </t>
+            <t t-set="additional_title">Shop - Confirmed</t>
+            <div id="wrap">
+              <div class="container oe_website_sale">
+
+                <ul class="wizard pull-right">
+                    <li class="text-muted">Review Order<span class="chevron"></span></li>
+                    <li class="text-muted">Shipping &amp; Billing<span class="chevron"></span></li>
+                    <li class="text-muted">Payment<span class="chevron"></span></li>
+                    <li class="text-primary">Confirmation<span class="chevron"></span></li>
+                </ul>
+                <h1 class="mb32">Order Confirmed</h1>
+                <div class="row">
+                    <div class="col-md-8 oe_mycart">
+                        <h2>Thank you for your order.</h2>
+                        <div class="oe_website_sale_tx_status" t-att-data-order-id="order.id">
+                        </div>
+                        <div class="clearfix"/>
+                        <div class="oe_structure"/>
+                    </div>
+                    <div class="col-md-3 col-md-offset-1 text-muted" id="right_column">
+                        <h4>Bill To:</h4>
+                        <div t-field="order.partner_invoice_id"/>
+
+                        <h4 class="mt32">Ship To:</h4>
+                        <div t-field="order.partner_shipping_id"/>
+
+                        <h4 class="mt32">Amount:</h4>
+                        <!--<div t-field="order.amount_total" t-field-options='{
+                            "widget": "monetary",
+                            "display_currency": "website.pricelist_id.currency_id"
+                        }'/> -->
+                    </div>
                 </div>
 
               </div>
 
         </t>
     </template>
+
+    <template id="total">
+      <span t-field="website_sale_order.amount_total" t-field-options='{
+          "widget": "monetary",
+          "display_currency": "website.pricelist_id.currency_id"
+        }'/>
+    </template>
  </data>
 </openerp>