1 <?xml version="1.0" encoding="utf-8"?>
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.
16 <p attrs="{'invisible': [('website_published', '=', False)]}">
17 This product is <b>available</b> for public user in your ecommerce.
19 <p>Website view: <field class="oe_inline" name="website_url" widget="url"/></p>
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"/>
32 <record model="ir.ui.view" id="product_pricelist_view">
33 <field name="name">product.pricelist.website.form</field>
34 <field name="model">product.pricelist</field>
35 <field name="inherit_id" ref="product.product_pricelist_view"/>
36 <field name="arch" type="xml">
37 <field name="active" position="after">
43 <!-- Layout add nav and footer -->
45 <template id="header_footer" inherit_id="website.layout" name="Custom Footer">
46 <xpath expr="//body/header//ul[@id='top_menu']/li" position="before">
47 <li><a href="/shop/">Shop</a></li>
49 <a href="/shop/mycart/">
50 <i class="icon-shopping-cart"></i>
51 My cart <span t-attf-class="my_cart_quantity badge #{(not website_sale_order or not website_sale_order.get_total_quantity()) and 'hidden' or ''}"
52 t-esc="website_sale_order and website_sale_order.get_total_quantity() or ''"/>
56 <xpath expr="//body/footer//ul[@name='products']" position="inside">
57 <li><a href="/shop/">Shop</a></li>
59 <a href="/shop/mycart/">
60 <i class="icon-shopping-cart"></i>
61 My cart <span t-attf-class="my_cart_quantity badge #{(not website_sale_order or not website_sale_order.get_total_quantity()) and 'hidden' or ''}"
62 t-esc="website_sale_order and website_sale_order.get_total_quantity() or ''"/>
70 <template id="layout" name="Products Layout">
71 <t t-call="website.layout">
73 <script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
74 <t t-raw="head or ''"/>
76 <t t-set="title">Shop - <t t-raw="title">Categories</t></t>
77 <div class="container oe_website_sale">
79 <div class="col-md-12" id="shop_content">
80 <t t-raw="shop_content" />
86 <template id="products_categories" inherit_id="website_sale.layout" inherit_option_id="website_sale.layout" name="Left Product Categories">
87 <xpath expr="//div[@id='shop_content']" position="before">
88 <div class="col-md-4">
89 <ul class="nav nav-pills nav-stacked">
90 <li t-att-class=" '' if category_id else 'active' " class='active'><a href="/shop/">All Products</a></li>
91 <t t-foreach="categories" t-as="category">
92 <t t-call="website_sale.categories_recursive"/>
97 <xpath expr="//div[@id='shop_content']" position="attributes">
98 <attribute name="class">col-md-8</attribute>
102 <!-- List of categories -->
104 <template id="categories_recursive">
105 <li t-att-class="category.id == category_id and 'active' or ''">
106 <a t-attf-href="/shop/category/#{ category.id }/" t-field="category.name"></a>
107 <ul t-if="category.child_id" class="nav nav-pills nav-stacked nav-hierarchy">
108 <t t-foreach="category.child_id" t-as="category">
109 <t t-call="website_sale.categories_recursive"/>
115 <!-- Product list -->
117 <template id="products" page="True">
118 <t t-call="website_sale.layout">
120 <link rel='stylesheet' href='/website_sale/static/src/css/website_sale.css'/>
121 <t t-raw="head or ''"/>
123 <t t-set="title">Product</t>
124 <t t-set="shop_content">
125 <a t-if="editable" t-attf-href="/shop/#{ category_id and ('category/%s/' % category_id) or ''}add_product/" class="btn btn-default pull-right">Create New Product</a>
126 <div t-if="editable" class="clearfix"/>
127 <t t-call="website.pager">
128 <t t-set="classname">pull-left</t>
130 <form t-attf-action="/shop/#{ category_id and ('category/%s/' % category_id) or ''}" method="get" class="pull-right pagination">
131 <input type="text" name="search" class="search-query col-md-2 form-control" placeholder="Search" t-att-value="search or '' or ''"/>
133 <div class="clearfix"/>
134 <div class='row grid grid-align-top'>
135 <t t-foreach="products" t-as="product">
136 <div class="css_product col-md-2 mb16 thumbnail text-center" data-publish="">
137 <t t-call="website.publish"><t t-set="object" t-value="product"/></t>
138 <div class="ellipsis css_content">
139 <a t-attf-href="/shop/product/#{ product.id }/?#{ search and ('search=%s' % search) or ''}#{ category_id and ('&category_id=%s' % category_id) or ''}" style="text-decoration: none; display: block;">
140 <h5 t-field="product.name"/>
141 <img class="img-rounded" t-att-src="product.img('image_small')"/>
143 <p t-field="product.description_sale"/>
144 <span class="end">&#133;</span><span class="fill" contenteditable="false"></span>
147 <small t-if="product.product_variant_ids[0].lst_price != product.product_variant_ids[0].price"
148 class="text-error" style="text-decoration: line-through;">
149 <span t-field="product.product_variant_ids[0].lst_price"/>
152 <b t-field="product.product_variant_ids[0].price" /> €
154 <div class="mb8 mt8">
155 <a t-attf-href="./add_cart/?product_id=#{ product.id }" class="btn btn-default btn-sm btn-success">Add to basket</a>
160 <div class="text-center">
161 <t t-call="website.pager" />
169 <template id="product" name="Product">
170 <t t-call="website_sale.layout">
171 <t t-set="title">Product</t>
172 <t t-set="shop_content">
173 <form t-attf-action="/shop/#{ category_id and ('category/%s/' % category_id) or ''}" method="get" class="pull-right">
174 <input type="text" name="search" class="search-query col-md-2 form-control" placeholder="Search..." t-att-value="search or '' or ''"/>
176 <div class="clearfix"/>
177 <div id="product_detail">
178 <t t-call="website.publish"><t t-set="object" t-value="product"/></t>
179 <h1 t-field="product.name">Product Name</h1>
180 <a t-if="len(product.product_variant_ids) <= 1" t-attf-href="./add_cart/?product_id=#{ product.id }" class="btn btn-default btn-sm btn-success pull-right">Add to basket</a>
181 <form t-if="len(product.product_variant_ids) > 1" action="./add_cart/" class="pull-right">
182 <label label-default="label-default" class="radio" t-foreach="product.product_variant_ids" t-as="product">
183 <input type="radio" name="product_id" t-att-value="product.id" t-att-checked="product == product.product_variant_ids[0] or None"/>
184 <t t-esc="product.variants or ''">Standard</t>
185 <span class="badge" t-if="product.price_extra"><t t-esc="product.price_extra > 0 and '+' or ''"/><t t-esc="product.price_extra"/> €</span>
187 <button class="btn btn-sm btn-success">Add to basket</button>
189 <div class="pull-right">
190 <t t-if="product.product_variant_ids[0].lst_price != product.product_variant_ids[0].price">
191 <h5 class="text-error" style="text-decoration: line-through;" title="Price without reduction"><t t-field="product.product_variant_ids[0].lst_price" /> €</h5>
192 <h4><t t-esc="product.product_variant_ids[0].price" /> €</h4>
194 <h4 t-if="product.product_variant_ids[0].lst_price == product.product_variant_ids[0].price"><t t-field="product.product_variant_ids[0].lst_price" /> €</h4>
196 <img class="media-object img-responsive" t-att-src="product.img('image_medium')"/>
197 <div t-field="product.website_description">
198 <div class="container mt32"></div>
199 <div class="container" data-snippet-id="container">
200 Replace this text with your Website product description
202 <div class="container mt32"></div>
208 <template id="recommended_products" inherit_id="website_sale.product" inherit_option_id="website_sale.product" name="Recommended Products">
209 <xpath expr="//div[@id='product_detail']" position="inside">
210 <div class="well mt32" t-if="product.recommended_products()">
211 <h4>Customers who have bought this item also bought</h4>
212 <div class='row mt16' style="margin-left: 15px !important;">
213 <t t-foreach="product.recommended_products()" t-as="product">
214 <div class='col-md-2 thumbnail' style='width: 170px; margin-right: 16px;'>
215 <a t-attf-href="/shop/product/#{ product.id }/">
216 <div class='mt16 text-center'>
217 <img t-att-src="product.img('image_small')"/>
218 <h5 t-field='product.name'></h5>
228 <!-- Page Shop my cart -->
230 <template id="mycart" name="My cart" page="True">
231 <t t-call="website_sale.layout">
232 <t t-set="title">My cart</t>
233 <t t-set="shop_content">
234 <div class="col-md-12 oe_mycart">
235 <h1>My Shopping Cart</h1>
236 <table class='table' id="mycart_products">
245 <th colspan="2">Product</th>
250 <tbody t-if="not website_sale_order or not website_sale_order.order_line">
251 <tr><td colspan="4"><h3>Your cart is empty</h3></td></tr>
253 <tbody t-if="website_sale_order and website_sale_order.order_line">
254 <t t-foreach="website_sale_order.order_line" t-as="line">
256 <td colspan="2" t-if="not line.product_id.product_tmpl_id"></td>
257 <td t-if="line.product_id.product_tmpl_id">
258 <a t-attf-href="/shop/product/#{ line.product_id.product_tmpl_id.id }/"><img class="img-rounded" t-att-src="line.product_id.img('image_small')"/></a>
260 <td t-if="line.product_id.product_tmpl_id">
261 <a t-attf-href="/shop/product/#{ line.product_id.product_tmpl_id.id }/"><span t-field="line.name"/></a><br/>
262 <small t-field="line.product_id.description_sale"/>
265 <t t-if="line.product_id.product_tmpl_id and line.product_id.lst_price != line.price_unit">
266 <small class="text-error" style="text-decoration: line-through;"><t t-esc="line.product_id.lst_price" /> €</small>
268 <span t-field="line.price_unit"></span> €
271 <div class="pull-right">
272 <input type="text" class="js_quantity input-sm col-md-5" t-att-data-id="line.id" t-att-value="line.product_uom_qty"/>
273 <a t-attf-href="./remove_cart/?order_line_id=#{ line.id }" class="btn btn-default mb8 btn-sm btn-inverse">-</a>
274 <a t-attf-href="./add_cart/?order_line_id=#{ line.id }" class="btn btn-default mb8 btn-sm btn-success">+</a>
281 <table class='table table-hover table-condensed' id="mycart_total">
289 <tr> <th colspan="3">Subtotal </th> <th><t t-esc="website_sale_order and website_sale_order.amount_untaxed or 0"/> €</th></tr>
290 <tr> <th colspan="3">Taxes </th> <th><t t-esc="website_sale_order and website_sale_order.amount_tax or 0"/> €</th></tr>
291 <tr> <th colspan="3"><h4>Total</h4></th> <th><h4><t t-esc="website_sale_order and website_sale_order.amount_total or 0"/> €</h4></th></tr>
294 <a t-if="website_sale_order and website_sale_order.order_line" href="/shop/checkout/" class="btn btn-success">Proceed To Payment</a>
299 <template id="suggested_products_list" inherit_id="website_sale.mycart" inherit_option_id="website_sale.mycart" name="Suggested Products in list view">
300 <xpath expr="//table[@id='mycart_products']" position="after">
301 <table t-if="suggested_products" class='table table-hover table-condensed'>
309 <th>Suggested products</th>
313 <t t-foreach="suggested_products" t-as="product">
316 <a t-attf-href="/shop/product/#{ product.id }/"><span t-field="product.name"/></a><br/>
317 <small t-field="product.description_sale"/>
320 <span t-field="product.list_price"></span>€
323 <div class="pull-right">
324 <a t-attf-href="./add_cart/?product_id=#{ product.id }" class="btn btn-sm btn-success">+</a>
333 <template id="suggested_products_cell" inherit_option_id="website_sale.mycart" name="Suggested Products in card view">
334 <xpath expr="//table[@id='mycart_products']" position="after">
335 <div class="mt16 mb32" t-if="suggested_products">
336 <h4>Suggested products</h4>
337 <div class='row mt16'>
338 <t t-foreach="suggested_products" t-as="product">
339 <div class='col-md-2 thumbnail'>
340 <a t-attf-href="/shop/product/#{ product.id }/">
341 <div class='mt16 text-center'>
342 <img t-att-src="product.img('image_small')"/>
343 <h5 t-field='product.name'></h5>
352 <template id="reduction_code" inherit_option_id="website_sale.mycart" name="Reduction Code">
353 <xpath expr="//table[@id='mycart_total']" position="after">
354 <form t-if="website_sale_order and website_sale_order.order_line" class="well" action="/shop/mycart/" method="post">
355 <input name="promo" class='input' type="text" placeholder="Reduction Code..." t-att-value="website_sale_order.pricelist_id.code or ''"/>
356 <button class="btn">Apply Code</button>
362 <!-- Page confirm my cart -->
364 <template id="checkout">
365 <t t-call="website.layout">
367 <script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
368 <t t-raw="head or ''"/>
370 <t t-set="title">Shop - Checkout</t>
371 <div class="container oe_website_sale">
373 <div class="col-md-4">
374 <table class="table table-condensed">
382 <tbody t-if="website_sale_order.order_line">
383 <t t-foreach="website_sale_order.order_line" t-as="line">
385 <td><t t-esc="line.name"/></td>
386 <td><t t-esc="line.product_uom_qty"/></td>
387 <td><t t-esc="line.price_unit"/> €</td>
392 <tr><th>Untaxed Amount</th><td></td><td><t t-esc="website_sale_order.amount_untaxed"/> €</td></tr>
393 <tr><th>Taxes</th><td></td><td><t t-esc="website_sale_order.amount_tax"/> €</td></tr>
394 <tr><th>Total</th><td></td><td><t t-esc="website_sale_order.amount_total"/> €</td></tr>
398 <form class="col-md-8 form-horizontal" action="/shop/confirm_order/" method="post">
400 <a t-if="not partner" t-attf-href="/admin#action=redirect&url=#{ request.httprequest.host_url }/shop/checkout/" class="btn btn-primary">Log me, I have an account</a>
401 <h3 class="col-md-10">Billing Information</h3>
402 <div t-attf-class="form-group #{error.get('name') and 'has-error' or ''}">
403 <label class="col-lg-3 control-label" for="contact_name">Name and firstname</label>
404 <div class="col-lg-4">
405 <input type="text" name="name" class="form-control" t-att-value="checkout.get('name', '')"/>
408 <div t-attf-class="form-group #{ error.get('phone') and 'has-error' or ''}">
409 <label class="col-lg-3 control-label" for="contact_name">Telephone</label>
410 <div class="col-lg-4">
411 <input type="tel" name="phone" class="form-control" t-att-value="checkout.get('phone', '')"/>
414 <div t-attf-class="form-group #{error.get('fax') and 'has-error' or ''}">
415 <label class="col-lg-3 control-label" for="contact_name">Fax</label>
416 <div class="col-lg-4">
417 <input type="tel" name="fax" class="form-control" t-att-value="checkout.get('fax', '')"/>
420 <div t-attf-class="form-group #{error.get('company') and 'has-error' or ''}">
421 <label class="col-lg-3 control-label" for="contact_name">Company</label>
422 <div class="col-lg-4">
423 <input type="text" name="company" class="form-control" t-att-value="checkout.get('company', '')"/>
426 <div t-attf-class="form-group #{error.get('email') and 'has-error' or ''}">
427 <label class="col-lg-3 control-label" for="contact_name">Email address</label>
428 <div class="col-lg-4">
429 <input type="email" name="email" class="form-control" t-att-value="checkout.get('email', '')"/>
432 <div t-attf-class="form-group #{error.get('street') and 'has-error' or ''}">
433 <label class="col-lg-3 control-label" for="contact_name">Street</label>
434 <div class="col-lg-4">
435 <input type="text" name="street" class="form-control" t-att-value="checkout.get('street', '')"/>
438 <div t-attf-class="form-group #{error.get('city') and 'has-error' or ''}">
439 <label class="col-lg-3 control-label" for="contact_name">City</label>
440 <div class="col-lg-4">
441 <input type="text" name="city" class="form-control" t-att-value="checkout.get('city', '')"/>
444 <div t-attf-class="form-group #{error.get('state_id') and 'has-error' or ''}">
445 <label class="col-lg-3 control-label" for="contact_name">State / Province</label>
446 <div class="col-lg-4">
447 <select name="state_id" class="form-control">
448 <option value="">State / Province...</option>
449 <t t-foreach="states or []" t-as="state">
450 <option t-att-value="state.id" t-att-selected="state.id == checkout.get('state_id')"><t t-esc="state.name"/></option>
455 <div t-attf-class="form-group #{error.get('zip') and 'has-error' or ''}">
456 <label class="col-lg-3 control-label" for="contact_name">Zip / Postal Code</label>
457 <div class="col-lg-4">
458 <input type="text" name="zip" class="form-control" t-att-value="checkout.get('zip', '')"/>
461 <div t-attf-class="form-group #{error.get('country_id') and 'has-error' or ''}">
462 <label class="col-lg-3 control-label" for="contact_name">Country</label>
463 <div class="col-lg-4">
464 <select name="country_id" class="form-control">
465 <option value="">Country...</option>
466 <t t-foreach="countries or []" t-as="country">
467 <option t-att-value="country.id" t-att-selected="country.id == checkout.get('country_id')"><t t-esc="country.name"/></option>
472 <div class="form-group checkbox">
473 <div class="col-lg-7 col-md-offset-3">
475 <input t-if="not shipping" type="checkbox" name="shipping_different"/>
476 <input t-if="shipping" type="checkbox" name="shipping_different" checked="1"/>
477 Ship to different address
482 <div class="js_shipping row" t-att-style="not shipping and 'display:none' or ''">
483 <h3 class="col-md-12 oe_shipping">Shipping Information</h3>
484 <div t-attf-class="form-group #{error.get('shipping_name') and 'has-error' or ''}">
485 <label class="col-lg-3 control-label" for="contact_name">Name and firstname</label>
486 <div class="col-lg-4">
487 <input type="text" name="shipping_name" class="form-control" t-att-value="checkout.get('shipping_name', '')"/>
490 <div t-attf-class="form-group #{error.get('shipping_phone') and 'has-error' or ''}">
491 <label class="col-lg-3 control-label" for="contact_name">Telephone</label>
492 <div class="col-lg-4">
493 <input type="tel" name="shipping_phone" class="form-control" t-att-value="checkout.get('shipping_phone', '')"/>
496 <div t-attf-class="form-group #{error.get('shipping_fax') and 'has-error' or ''}">
497 <label class="col-lg-3 control-label" for="contact_name">Fax</label>
498 <div class="col-lg-4">
499 <input type="tel" name="shipping_fax" class="form-control" t-att-value="checkout.get('shipping_fax', '')"/>
502 <div t-attf-class="form-group #{error.get('shipping_street') and 'has-error' or ''}">
503 <label class="col-lg-3 control-label" for="contact_name">Street</label>
504 <div class="col-lg-4">
505 <input type="text" name="shipping_street" class="form-control" t-att-value="checkout.get('shipping_street', '')"/>
508 <div t-attf-class="form-group #{error.get('shipping_city') and 'has-error' or ''}">
509 <label class="col-lg-3 control-label" for="contact_name">City</label>
510 <div class="col-lg-4">
511 <input type="text" name="shipping_city" class="form-control" t-att-value="checkout.get('shipping_city', '')"/>
514 <div t-attf-class="form-group #{error.get('shipping_state_id') and 'has-error' or ''}">
515 <label class="col-lg-3 control-label" for="contact_name">State / Province</label>
516 <div class="col-lg-4">
517 <select name="shipping_state_id" class="form-control">
518 <option value="">State / Province...</option>
519 <t t-foreach="states or []" t-as="state">
520 <option t-att-value="state.id" t-att-selected="state.id == checkout.get('shipping_state_id')"><t t-esc="state.name"/></option>
525 <div t-attf-class="form-group #{error.get('shipping_zip') and 'has-error' or ''}">
526 <label class="col-lg-3 control-label" for="contact_name">Zip / Postal Code</label>
527 <div class="col-lg-4">
528 <input type="text" name="shipping_zip" class="form-control" t-att-value="checkout.get('shipping_zip', '')"/>
531 <div t-attf-class="form-group #{error.get('shipping_country_id') and 'has-error' or ''}">
532 <label class="col-lg-3 control-label" for="contact_name">Country</label>
533 <div class="col-lg-4">
534 <select name="shipping_country_id" class="form-control">
535 <option value="">Country...</option>
536 <t t-foreach="countries or []" t-as="country">
537 <option t-att-value="country.id" t-att-selected="country.id == checkout.get('shipping_country_id')"><t t-esc="country.name"/></option>
543 <button type="submit" class="btn btn-default">Last stape</button>
550 <template id="payment">
551 <t t-call="website.layout">
553 <script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
554 <t t-raw="head or ''"/>
556 <t t-set="title">Shop - Payment</t>
557 <div class="container oe_website_sale">
559 <div class="col-md-4">
560 <table class="table table-condensed" t-if="order">
568 <tbody t-if="website_sale_order.order_line">
569 <t t-foreach="website_sale_order.order_line" t-as="line">
571 <td><t t-esc="line.name"/></td>
572 <td><t t-esc="line.product_uom_qty"/></td>
573 <td><t t-esc="line.price_unit"/> €</td>
578 <tr><th>Untaxed Amount</th><td></td><td><t t-esc="website_sale_order.amount_untaxed"/> €</td></tr>
579 <tr><th>Taxes</th><td></td><td><t t-esc="website_sale_order.amount_tax"/> €</td></tr>
580 <tr><th>Total</th><td></td><td><t t-esc="website_sale_order.amount_total"/> €</td></tr>
584 <div class="col-md-8">
585 <div class="js_payment row">
586 <h3 class="col-md-12">Click on your payment method</h3>
587 <div class="col-md-2">
588 <t t-foreach="payments or []" t-as="payment">
590 <input t-att-value="payment.id" type="radio" name="payment_type"/> <t t-esc="payment.name"/>
594 <t t-foreach="payments or []" t-as="payment">
595 <div t-att-data-id="payment.id" t-raw="payment._content" class="hidden col-md-6"/>
597 <a href="/shop/payment_validate/" class="hidden btn btn-default">I validate my payment</a>