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>
78 <div class="oe_structure"/>
79 <div class="container oe_website_sale">
81 <div class="col-md-12" id="shop_content">
82 <t t-raw="shop_content" />
89 <template id="products_categories" inherit_option_id="website_sale.layout" name="Product Categories">
90 <xpath expr="//div[@id='shop_content']" position="before">
91 <div class="col-md-3">
92 <ul class="nav nav-pills nav-stacked">
93 <li t-att-class=" '' if category_id else 'active' " class='active'><a href="/shop/">All Products</a></li>
94 <t t-foreach="categories" t-as="category">
95 <t t-call="website_sale.categories_recursive"/>
100 <xpath expr="//div[@id='shop_content']" position="attributes">
101 <attribute name="class">col-md-9</attribute>
105 <!-- List of categories -->
107 <template id="categories_recursive">
108 <li t-att-class="category.id == category_id and 'active' or ''">
109 <a t-attf-href="/shop/category/#{ category.id }/" t-field="category.name"></a>
110 <ul t-if="category.child_id" class="nav nav-pills nav-stacked nav-hierarchy">
111 <t t-foreach="category.child_id" t-as="category">
112 <t t-call="website_sale.categories_recursive"/>
118 <!-- Product list -->
120 <template id="products" page="True">
121 <t t-call="website_sale.layout">
123 <link rel='stylesheet' href='/website_sale/static/src/css/website_sale.css'/>
124 <t t-raw="head or ''"/>
126 <t t-set="title">Product</t>
127 <t t-set="shop_content">
129 <div class="col-sm-4">
130 <t t-call="website.pager">
131 <t t-set="classname">pull-left</t>
133 </div><div class="col-sm-4 pagination text-center">
134 <a t-if="editable" t-attf-href="/shop/#{ category_id and ('category/%s/' % category_id) or ''}add_product/" class="btn btn-default pull-left">New Product</a>
135 </div><div class="col-sm-4">
136 <form t-attf-action="/shop/#{ category_id and ('category/%s/' % category_id) or ''}" method="get" class="pull-right pagination">
137 <input type="text" name="search" class="search-query col-md-2 form-control" placeholder="Search" t-att-value="search or '' or ''"/>
143 <t t-foreach="products" t-as="product">
144 <div t-attf-class="col-md-#{ product.website_sizex } oe_product text-center oe-height-#{ product.website_sizey }" t-att-data-publish="product.website_published" data-snippet-id="colmd">
146 <div class="oe_product_name">
147 <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;">
148 <h5 t-field="product.name"> </h5>
150 <!-- This should be an option -->
151 <small t-field="product.description_sale"></small>
153 <img class="img oe_product_image" t-att-src="product.img('image')"/>
155 <div class="oe_product_price">
156 <t t-if="product.product_variant_ids[0].lst_price != product.product_variant_ids[0].price">
157 <small class="text-error" style="text-decoration: line-through;">
158 <t t-esc="product.product_variant_ids[0].lst_price" /> €
161 <b><t t-esc="product.product_variant_ids[0].price" /> €</b>
163 <!-- Put this in a separate view -->
164 <a t-attf-href="./add_cart/?product_id=#{ product.id }" class="btn btn-default btn-sm btn-success">Add to basket</a>
172 <div class="text-center">
173 <t t-call="website.pager" />
181 <template id="product" name="Product">
182 <t t-call="website_sale.layout">
183 <t t-set="title">Product</t>
184 <t t-set="shop_content">
185 <form t-attf-action="/shop/#{ category_id and ('category/%s/' % category_id) or ''}" method="get" class="pull-right">
186 <input type="text" name="search" class="search-query col-md-2 form-control" placeholder="Search..." t-att-value="search or '' or ''"/>
188 <div class="clearfix"/>
189 <div id="product_detail">
190 <t t-call="website.publish"><t t-set="object" t-value="product"/></t>
191 <h1 t-field="product.name">Product Name</h1>
192 <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>
193 <form t-if="len(product.product_variant_ids) > 1" action="./add_cart/" class="pull-right">
194 <label label-default="label-default" class="radio" t-foreach="product.product_variant_ids" t-as="product">
195 <input type="radio" name="product_id" t-att-value="product.id" t-att-checked="product == product.product_variant_ids[0] or None"/>
196 <t t-esc="product.variants or ''">Standard</t>
197 <span class="badge" t-if="product.price_extra"><t t-esc="product.price_extra > 0 and '+' or ''"/><t t-esc="product.price_extra"/> €</span>
199 <button class="btn btn-sm btn-success">Add to basket</button>
201 <div class="pull-right">
202 <t t-if="product.product_variant_ids[0].lst_price != product.product_variant_ids[0].price">
203 <h5 class="text-error" style="text-decoration: line-through;" title="Price without reduction"><t t-field="product.product_variant_ids[0].lst_price" /> €</h5>
204 <h4><t t-esc="product.product_variant_ids[0].price" /> €</h4>
206 <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>
208 <img class="media-object img-responsive" t-att-src="product.img('image_medium')"/>
209 <div t-field="product.website_description"></div>
214 <template id="recommended_products" inherit_id="website_sale.product" inherit_option_id="website_sale.product" name="Recommended Products">
215 <xpath expr="//div[@id='product_detail']" position="inside">
216 <div class="mt32" t-if="product.recommended_products()">
217 <h3>Customers who have bought this product also bought:</h3>
218 <div class='row mt16' style="margin-left: 15px !important;">
219 <t t-foreach="product.recommended_products()" t-as="product">
220 <div class='col-md-2 thumbnail' style='width: 170px; margin-right: 16px;'>
221 <a t-attf-href="/shop/product/#{ product.id }/">
222 <div class='mt16 text-center'>
223 <img t-att-src="product.img('image_small')"/>
224 <h5 t-field='product.name'></h5>
234 <!-- Page Shop my cart -->
236 <template id="mycart" name="My cart" page="True">
237 <t t-call="website_sale.layout">
238 <t t-set="title">My cart</t>
239 <t t-set="shop_content">
240 <div class="col-md-12 oe_mycart">
241 <h1>My Shopping Cart</h1>
242 <table class='table' id="mycart_products">
251 <th colspan="2">Product</th>
256 <tbody t-if="not website_sale_order or not website_sale_order.order_line">
257 <tr><td colspan="4"><h3>Your cart is empty</h3></td></tr>
259 <tbody t-if="website_sale_order and website_sale_order.order_line">
260 <t t-foreach="website_sale_order.order_line" t-as="line">
262 <td colspan="2" t-if="not line.product_id.product_tmpl_id"></td>
263 <td t-if="line.product_id.product_tmpl_id">
264 <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>
266 <td t-if="line.product_id.product_tmpl_id">
267 <a t-attf-href="/shop/product/#{ line.product_id.product_tmpl_id.id }/"><span t-field="line.name"/></a><br/>
268 <small t-field="line.product_id.description_sale"/>
271 <t t-if="line.product_id.product_tmpl_id and line.product_id.lst_price != line.price_unit">
272 <small class="text-error" style="text-decoration: line-through;"><t t-esc="line.product_id.lst_price" /> €</small>
274 <span t-field="line.price_unit"></span> €
277 <div class="pull-right">
278 <input type="text" class="js_quantity input-sm col-md-5" t-att-data-id="line.id" t-att-value="line.product_uom_qty"/>
279 <a t-attf-href="./remove_cart/?order_line_id=#{ line.id }" class="btn btn-default mb8 btn-sm btn-inverse">-</a>
280 <a t-attf-href="./add_cart/?order_line_id=#{ line.id }" class="btn btn-default mb8 btn-sm btn-success">+</a>
287 <table class='table table-hover table-condensed' id="mycart_total">
295 <tr> <th colspan="3">Subtotal </th> <th><t t-esc="website_sale_order and website_sale_order.amount_untaxed or 0"/> €</th></tr>
296 <tr> <th colspan="3">Taxes </th> <th><t t-esc="website_sale_order and website_sale_order.amount_tax or 0"/> €</th></tr>
297 <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>
300 <a t-if="website_sale_order and website_sale_order.order_line" href="/shop/checkout/" class="btn btn-success">Proceed To Payment</a>
305 <template id="suggested_products_list" inherit_id="website_sale.mycart" inherit_option_id="website_sale.mycart" name="Suggested Products in list view">
306 <xpath expr="//table[@id='mycart_products']" position="after">
307 <table t-if="suggested_products" class='table table-hover table-condensed'>
315 <th>Suggested products</th>
319 <t t-foreach="suggested_products" t-as="product">
322 <a t-attf-href="/shop/product/#{ product.id }/"><span t-field="product.name"/></a><br/>
323 <small t-field="product.description_sale"/>
326 <span t-field="product.list_price"></span>€
329 <div class="pull-right">
330 <a t-attf-href="./add_cart/?product_id=#{ product.id }" class="btn btn-sm btn-success">+</a>
339 <template id="suggested_products_cell" inherit_option_id="website_sale.mycart" name="Suggested Products in card view">
340 <xpath expr="//table[@id='mycart_products']" position="after">
341 <div class="mt16 mb32" t-if="suggested_products">
342 <h4>Suggested products</h4>
343 <div class='row mt16'>
344 <t t-foreach="suggested_products" t-as="product">
345 <div class='col-md-2 thumbnail'>
346 <a t-attf-href="/shop/product/#{ product.id }/">
347 <div class='mt16 text-center'>
348 <img t-att-src="product.img('image_small')"/>
349 <h5 t-field='product.name'></h5>
358 <template id="reduction_code" inherit_option_id="website_sale.mycart" name="Reduction Code">
359 <xpath expr="//table[@id='mycart_total']" position="after">
360 <form t-if="website_sale_order and website_sale_order.order_line" class="well" action="/shop/mycart/" method="post">
361 <input name="promo" class='input' type="text" placeholder="Reduction Code..." t-att-value="website_sale_order.pricelist_id.code or ''"/>
362 <button class="btn">Apply Code</button>
368 <!-- Page confirm my cart -->
370 <template id="checkout">
371 <t t-call="website.layout">
373 <script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
374 <t t-raw="head or ''"/>
376 <t t-set="title">Shop - Checkout</t>
378 <div class="container oe_website_sale">
380 <div class="col-md-4">
381 <table class="table table-condensed">
389 <tbody t-if="website_sale_order.order_line">
390 <t t-foreach="website_sale_order.order_line" t-as="line">
392 <td><t t-esc="line.name"/></td>
393 <td><t t-esc="line.product_uom_qty"/></td>
394 <td><t t-esc="line.price_unit"/> €</td>
399 <tr><th>Untaxed Amount</th><td></td><td><t t-esc="website_sale_order.amount_untaxed"/> €</td></tr>
400 <tr><th>Taxes</th><td></td><td><t t-esc="website_sale_order.amount_tax"/> €</td></tr>
401 <tr><th>Total</th><td></td><td><t t-esc="website_sale_order.amount_total"/> €</td></tr>
405 <form class="col-md-8 form-horizontal" action="/shop/confirm_order/" method="post">
407 <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>
408 <h3 class="col-md-10">Billing Information</h3>
409 <div t-attf-class="form-group #{error.get('name') and 'has-error' or ''}">
410 <label class="col-lg-3 control-label" for="contact_name">Name and firstname</label>
411 <div class="col-lg-4">
412 <input type="text" name="name" class="form-control" t-att-value="checkout.get('name', '')"/>
415 <div t-attf-class="form-group #{ error.get('phone') and 'has-error' or ''}">
416 <label class="col-lg-3 control-label" for="contact_name">Telephone</label>
417 <div class="col-lg-4">
418 <input type="tel" name="phone" class="form-control" t-att-value="checkout.get('phone', '')"/>
421 <div t-attf-class="form-group #{error.get('fax') and 'has-error' or ''}">
422 <label class="col-lg-3 control-label" for="contact_name">Fax</label>
423 <div class="col-lg-4">
424 <input type="tel" name="fax" class="form-control" t-att-value="checkout.get('fax', '')"/>
427 <div t-attf-class="form-group #{error.get('company') and 'has-error' or ''}">
428 <label class="col-lg-3 control-label" for="contact_name">Company</label>
429 <div class="col-lg-4">
430 <input type="text" name="company" class="form-control" t-att-value="checkout.get('company', '')"/>
433 <div t-attf-class="form-group #{error.get('email') and 'has-error' or ''}">
434 <label class="col-lg-3 control-label" for="contact_name">Email address</label>
435 <div class="col-lg-4">
436 <input type="email" name="email" class="form-control" t-att-value="checkout.get('email', '')"/>
439 <div t-attf-class="form-group #{error.get('street') and 'has-error' or ''}">
440 <label class="col-lg-3 control-label" for="contact_name">Street</label>
441 <div class="col-lg-4">
442 <input type="text" name="street" class="form-control" t-att-value="checkout.get('street', '')"/>
445 <div t-attf-class="form-group #{error.get('city') and 'has-error' or ''}">
446 <label class="col-lg-3 control-label" for="contact_name">City</label>
447 <div class="col-lg-4">
448 <input type="text" name="city" class="form-control" t-att-value="checkout.get('city', '')"/>
451 <div t-attf-class="form-group #{error.get('state_id') and 'has-error' or ''}">
452 <label class="col-lg-3 control-label" for="contact_name">State / Province</label>
453 <div class="col-lg-4">
454 <select name="state_id" class="form-control">
455 <option value="">State / Province...</option>
456 <t t-foreach="states or []" t-as="state">
457 <option t-att-value="state.id" t-att-selected="state.id == checkout.get('state_id')"><t t-esc="state.name"/></option>
462 <div t-attf-class="form-group #{error.get('zip') and 'has-error' or ''}">
463 <label class="col-lg-3 control-label" for="contact_name">Zip / Postal Code</label>
464 <div class="col-lg-4">
465 <input type="text" name="zip" class="form-control" t-att-value="checkout.get('zip', '')"/>
468 <div t-attf-class="form-group #{error.get('country_id') and 'has-error' or ''}">
469 <label class="col-lg-3 control-label" for="contact_name">Country</label>
470 <div class="col-lg-4">
471 <select name="country_id" class="form-control">
472 <option value="">Country...</option>
473 <t t-foreach="countries or []" t-as="country">
474 <option t-att-value="country.id" t-att-selected="country.id == checkout.get('country_id')"><t t-esc="country.name"/></option>
479 <div class="form-group checkbox">
480 <div class="col-lg-7 col-md-offset-3">
482 <input t-if="not shipping" type="checkbox" name="shipping_different"/>
483 <input t-if="shipping" type="checkbox" name="shipping_different" checked="1"/>
484 Ship to different address
489 <div class="js_shipping row" t-att-style="not shipping and 'display:none' or ''">
490 <h3 class="col-md-12 oe_shipping">Shipping Information</h3>
491 <div t-attf-class="form-group #{error.get('shipping_name') and 'has-error' or ''}">
492 <label class="col-lg-3 control-label" for="contact_name">Name and firstname</label>
493 <div class="col-lg-4">
494 <input type="text" name="shipping_name" class="form-control" t-att-value="checkout.get('shipping_name', '')"/>
497 <div t-attf-class="form-group #{error.get('shipping_phone') and 'has-error' or ''}">
498 <label class="col-lg-3 control-label" for="contact_name">Telephone</label>
499 <div class="col-lg-4">
500 <input type="tel" name="shipping_phone" class="form-control" t-att-value="checkout.get('shipping_phone', '')"/>
503 <div t-attf-class="form-group #{error.get('shipping_fax') and 'has-error' or ''}">
504 <label class="col-lg-3 control-label" for="contact_name">Fax</label>
505 <div class="col-lg-4">
506 <input type="tel" name="shipping_fax" class="form-control" t-att-value="checkout.get('shipping_fax', '')"/>
509 <div t-attf-class="form-group #{error.get('shipping_street') and 'has-error' or ''}">
510 <label class="col-lg-3 control-label" for="contact_name">Street</label>
511 <div class="col-lg-4">
512 <input type="text" name="shipping_street" class="form-control" t-att-value="checkout.get('shipping_street', '')"/>
515 <div t-attf-class="form-group #{error.get('shipping_city') and 'has-error' or ''}">
516 <label class="col-lg-3 control-label" for="contact_name">City</label>
517 <div class="col-lg-4">
518 <input type="text" name="shipping_city" class="form-control" t-att-value="checkout.get('shipping_city', '')"/>
521 <div t-attf-class="form-group #{error.get('shipping_state_id') and 'has-error' or ''}">
522 <label class="col-lg-3 control-label" for="contact_name">State / Province</label>
523 <div class="col-lg-4">
524 <select name="shipping_state_id" class="form-control">
525 <option value="">State / Province...</option>
526 <t t-foreach="states or []" t-as="state">
527 <option t-att-value="state.id" t-att-selected="state.id == checkout.get('shipping_state_id')"><t t-esc="state.name"/></option>
532 <div t-attf-class="form-group #{error.get('shipping_zip') and 'has-error' or ''}">
533 <label class="col-lg-3 control-label" for="contact_name">Zip / Postal Code</label>
534 <div class="col-lg-4">
535 <input type="text" name="shipping_zip" class="form-control" t-att-value="checkout.get('shipping_zip', '')"/>
538 <div t-attf-class="form-group #{error.get('shipping_country_id') and 'has-error' or ''}">
539 <label class="col-lg-3 control-label" for="contact_name">Country</label>
540 <div class="col-lg-4">
541 <select name="shipping_country_id" class="form-control">
542 <option value="">Country...</option>
543 <t t-foreach="countries or []" t-as="country">
544 <option t-att-value="country.id" t-att-selected="country.id == checkout.get('shipping_country_id')"><t t-esc="country.name"/></option>
550 <button type="submit" class="btn btn-default">Last stape</button>
558 <template id="payment">
559 <t t-call="website.layout">
561 <script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
562 <t t-raw="head or ''"/>
564 <t t-set="title">Shop - Payment</t>
566 <div class="container oe_website_sale">
568 <div class="col-md-4">
569 <table class="table table-condensed" t-if="order">
577 <tbody t-if="website_sale_order.order_line">
578 <t t-foreach="website_sale_order.order_line" t-as="line">
580 <td><t t-esc="line.name"/></td>
581 <td><t t-esc="line.product_uom_qty"/></td>
582 <td><t t-esc="line.price_unit"/> €</td>
587 <tr><th>Untaxed Amount</th><td></td><td><t t-esc="website_sale_order.amount_untaxed"/> €</td></tr>
588 <tr><th>Taxes</th><td></td><td><t t-esc="website_sale_order.amount_tax"/> €</td></tr>
589 <tr><th>Total</th><td></td><td><t t-esc="website_sale_order.amount_total"/> €</td></tr>
593 <div class="col-md-8">
594 <div class="js_payment row">
595 <h3 class="col-md-12">Click on your payment method</h3>
596 <div class="col-md-2">
597 <t t-foreach="payments or []" t-as="payment">
599 <input t-att-value="payment.id" type="radio" name="payment_type"/> <t t-esc="payment.name"/>
603 <t t-foreach="payments or []" t-as="payment">
604 <div t-att-data-id="payment.id" t-raw="payment._content" class="hidden col-md-6"/>
606 <a href="/shop/payment_validate/" class="hidden btn btn-default">I validate my payment</a>