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', '=', False)]}">
14 This product is <b>not available</b> for public user in your ecommerce.
16 <p attrs="{'invisible': [('website_published', '=', True)]}">
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="footer_custom" 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 id="my_cart_quantity" t-attf-class="badge #{(not order or not order.get_total_quantity()) and 'hidden' or ''}" t-esc="order and order.get_total_quantity() or ''"/>
59 <template id="layout" name="Products Layout">
60 <t t-call="website.layout">
62 <script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
63 <t t-raw="head or ''"/>
65 <t t-set="title">Shop - <t t-raw="title">Categories</t></t>
66 <div class="container oe_website_sale">
67 <a t-if="editable" href="/shop/add_product/" class="btn btn-default pull-right">Create New Product</a>
69 <div class="col-md-12" id="shop_content">
70 <t t-raw="shop_content" />
76 <template id="products_categories" inherit_id="website_sale.layout" inherit_option_id="website_sale.layout" name="Left Product Categories">
77 <xpath expr="//div[@id='shop_content']" position="before">
78 <div class="col-md-4">
79 <ul class="nav nav-pills nav-stacked">
80 <li t-att-class=" '' if category_id else 'active' " class='active'><a href="/shop/">All Products</a></li>
81 <t t-foreach="categories" t-as="category">
82 <t t-call="website_sale.categories_recursive"/>
87 <xpath expr="//div[@id='shop_content']" position="attributes">
88 <attribute name="class">col-md-8</attribute>
92 <!-- List of categories -->
94 <template id="categories_recursive">
95 <li t-att-class="category.id == category_id and 'active' or ''">
96 <a t-attf-href="/shop/category/#{ category.id }/" t-field="category.name"></a>
97 <ul t-if="category.child_id" class="nav nav-pills nav-stacked nav-hierarchy">
98 <t t-foreach="category.child_id" t-as="category">
99 <t t-call="website_sale.categories_recursive"/>
105 <!-- Product list -->
107 <template id="products" page="True">
108 <t t-call="website_sale.layout">
110 <link rel='stylesheet' href='/website_sale/static/src/css/website_sale.css'/>
111 <t t-raw="head or ''"/>
113 <t t-set="title">Product</t>
114 <t t-set="shop_content">
115 <t t-call="website.pager">
116 <t t-set="classname">pull-left</t>
118 <form t-attf-action="/shop/#{ category_id and ('category/%s/' % category_id) or ''}" method="get" class="pull-right pagination">
119 <input type="text" name="search" class="search-query col-md-2 form-control" placeholder="Search" t-att-value="search or '' or ''"/>
121 <div class="clearfix"/>
122 <div class='row grid grid-align-top'>
123 <t t-foreach="products" t-as="product">
124 <div class="css_product col-md-2 mb16 thumbnail text-center" data-publish="">
125 <t t-call="website.publish"><t t-set="object" t-value="product"/></t>
126 <div class="ellipsis css_content">
127 <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;">
128 <h5 t-field="product.name"> </h5>
129 <img class="img-rounded" t-att-src="product.img('image_small')"/>
131 <small t-field="product.description_sale"></small>
132 <span class="end">&#133;</span><span class="fill"></span>
135 <t t-if="product.product_variant_ids[0].lst_price != product.product_variant_ids[0].price">
136 <small class="text-error" style="text-decoration: line-through;"><t t-esc="product.product_variant_ids[0].lst_price" /> €</small>
138 <b><t t-esc="product.product_variant_ids[0].price" /> €</b>
140 <div class="mb8 mt8">
141 <a t-attf-href="./add_cart/?product_id=#{ product.id }" class="btn btn-default btn-sm btn-success">Add to basket</a>
146 <div class="text-center">
147 <t t-call="website.pager" />
155 <template id="product" name="Product">
156 <t t-call="website_sale.layout">
157 <t t-set="title">Product</t>
158 <t t-set="shop_content">
159 <form t-attf-action="/shop/#{ category_id and ('category/%s/' % category_id) or ''}" method="get" class="pull-right">
160 <input type="text" name="search" class="search-query col-md-2 form-control" placeholder="Search..." t-att-value="search or '' or ''"/>
162 <div class="clearfix"/>
163 <div id="product_detail">
164 <t t-call="website.publish"><t t-set="object" t-value="product"/></t>
165 <h1 t-field="product.name">Product Name</h1>
166 <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>
167 <form t-if="len(product.product_variant_ids) > 1" action="./add_cart/" class="pull-right">
168 <label label-default="label-default" class="radio" t-foreach="product.product_variant_ids" t-as="product">
169 <input type="radio" name="product_id" t-att-value="product.id" t-att-checked="product == product.product_variant_ids[0] or None"/>
170 <t t-esc="product.variants or ''">Standard</t>
171 <span class="badge" t-if="product.price_extra"><t t-esc="product.price_extra > 0 and '+' or ''"/><t t-esc="product.price_extra"/> €</span>
173 <button class="btn btn-sm btn-success">Add to basket</button>
175 <img class="media-object img-responsive" t-att-src="product.img('image_medium')"/>
176 <div t-if="editable" t-att-class="'well css_non_editable_mode_hidden'">
177 <h2>Category<br/><small>Select the public category</small></h2>
178 <select name="public_categ_id" class="form-control" t-att-data-id="product.id">
179 <option value="0">Choose a Category</option>
180 <t t-foreach="category_list" t-as="cat">
181 <option t-att-value="cat[0]" t-att-selected="cat[0] == product.public_categ_id.id and 'selected'"><t t-esc="cat[1]"/></option>
184 <h2>Short Description for Quotations<br/><small>Displayed in your shop categories and for quotations</small></h2>
185 <div class="form-control" t-field="product.description_sale">Enter a short description for this product</div>
187 <div t-field="product.website_description">Enter a short Website description for this product</div>
189 <t t-if="product.product_variant_ids[0].lst_price != product.product_variant_ids[0].price">
190 <h5 class="text-error" style="text-decoration: line-through;" title="Price without reduction"><t t-field="product.product_variant_ids[0].lst_price" /> €</h5>
191 <h4><t t-esc="product.product_variant_ids[0].price" /> €</h4>
193 <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>
199 <template id="recommended_products" inherit_id="website_sale.product" inherit_option_id="website_sale.product" name="Recommended Products">
200 <xpath expr="//div[@id='product_detail']" position="inside">
201 <div class="well mt32" t-if="product.recommended_products()">
202 <h4>Customers who have bought this item also bought</h4>
203 <div class='row mt16' style="margin-left: 15px !important;">
204 <t t-foreach="product.recommended_products()" t-as="product">
205 <div class='col-md-2 thumbnail' style='width: 170px; margin-right: 16px;'>
206 <a t-attf-href="/shop/product/#{ product.id }/">
207 <div class='mt16 text-center'>
208 <img t-att-src="product.img('image_small')"/>
209 <h5 t-field='product.name'></h5>
219 <!-- Page Shop my cart -->
221 <template id="mycart" name="My cart" page="True">
222 <t t-call="website_sale.layout">
223 <t t-set="title">My cart</t>
224 <t t-set="shop_content">
225 <div class="col-md-12 oe_mycart">
226 <h1>My Shopping Cart</h1>
227 <table class='table' id="mycart_products">
236 <th colspan="2">Product</th>
241 <tbody t-if="not order or not order.order_line">
242 <tr><td colspan="4"><h3>Your cart is empty</h3></td></tr>
244 <tbody t-if="order and order.order_line">
245 <t t-foreach="order.order_line" t-as="line">
247 <td colspan="2" t-if="not line.product_id.product_tmpl_id"></td>
248 <td t-if="line.product_id.product_tmpl_id">
249 <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>
251 <td t-if="line.product_id.product_tmpl_id">
252 <a t-attf-href="/shop/product/#{ line.product_id.product_tmpl_id.id }/"><span t-field="line.name"/></a><br/>
253 <small t-field="line.product_id.description_sale"/>
256 <t t-if="line.product_id.product_tmpl_id and line.product_id.lst_price != line.price_unit">
257 <small class="text-error" style="text-decoration: line-through;"><t t-esc="line.product_id.lst_price" /> €</small>
259 <span t-field="line.price_unit"></span> €
262 <div class="pull-right">
263 <input type="text" class="js_quantity input-sm col-md-5" t-att-data-id="line.id" t-att-value="line.product_uom_qty"/>
264 <a t-attf-href="./remove_cart/?order_line_id=#{ line.id }" class="btn btn-default mb8 btn-sm btn-inverse">-</a>
265 <a t-attf-href="./add_cart/?order_line_id=#{ line.id }" class="btn btn-default mb8 btn-sm btn-success">+</a>
272 <table class='table table-hover table-condensed' id="mycart_total">
280 <tr> <th colspan="3">Subtotal </th> <th><t t-esc="order and order.amount_untaxed or 0"/> €</th></tr>
281 <tr> <th colspan="3">Taxes </th> <th><t t-esc="order and order.amount_tax or 0"/> €</th></tr>
282 <tr> <th colspan="3"><h4>Total</h4></th> <th><h4><t t-esc="order and order.amount_total or 0"/> €</h4></th></tr>
285 <a t-if="order and order.order_line" href="/shop/checkout/" class="btn btn-success">Proceed To Payment</a>
290 <template id="suggested_products_list" inherit_id="website_sale.mycart" inherit_option_id="website_sale.mycart" name="Suggested Products in list view">
291 <xpath expr="//table[@id='mycart_products']" position="after">
292 <table t-if="suggested_products" class='table table-hover table-condensed'>
300 <th>Suggested products</th>
304 <t t-foreach="suggested_products" t-as="product">
307 <a t-attf-href="/shop/product/#{ product.id }/"><span t-field="product.name"/></a><br/>
308 <small t-field="product.description_sale"/>
311 <span t-field="product.list_price"></span>€
314 <div class="pull-right">
315 <a t-attf-href="./add_cart/?product_id=#{ product.id }" class="btn btn-sm btn-success">+</a>
324 <template id="suggested_products_cell" inherit_option_id="website_sale.mycart" name="Suggested Products in card view">
325 <xpath expr="//table[@id='mycart_products']" position="after">
326 <div class="mt16 mb32" t-if="suggested_products">
327 <h4>Suggested products</h4>
328 <div class='row mt16'>
329 <t t-foreach="suggested_products" t-as="product">
330 <div class='col-md-2 thumbnail'>
331 <a t-attf-href="/shop/product/#{ product.id }/">
332 <div class='mt16 text-center'>
333 <img t-att-src="product.img('image_small')"/>
334 <h5 t-field='product.name'></h5>
343 <template id="reduction_code" inherit_option_id="website_sale.mycart" name="Reduction Code">
344 <xpath expr="//table[@id='mycart_total']" position="after">
345 <form t-if="order and order.order_line" class="well" action="/shop/mycart/" method="post">
346 <input name="promo" class='input' type="text" placeholder="Reduction Code..." t-att-value="order.pricelist_id.code or ''"/>
347 <button class="btn">Apply Code</button>
353 <!-- Page confirm my cart -->
355 <template id="checkout">
356 <t t-call="website.layout">
358 <script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
359 <t t-raw="head or ''"/>
361 <t t-set="title">Shop - Checkout</t>
362 <div class="container oe_website_sale">
364 <div class="col-md-4">
365 <table class="table table-condensed">
373 <tbody t-if="order.order_line">
374 <t t-foreach="order.order_line" t-as="line">
376 <td><t t-esc="line.name"/></td>
377 <td><t t-esc="line.product_uom_qty"/></td>
378 <td><t t-esc="line.price_unit"/> €</td>
383 <tr><th>Untaxed Amount</th><td></td><td><t t-esc="order.amount_untaxed"/> €</td></tr>
384 <tr><th>Taxes</th><td></td><td><t t-esc="order.amount_tax"/> €</td></tr>
385 <tr><th>Total</th><td></td><td><t t-esc="order.amount_total"/> €</td></tr>
389 <form class="col-md-8 form-horizontal" action="/shop/confirm_order/" method="post">
391 <a t-if="not partner" t-attf-href="/admin#action=redirect&url=#{ host_url }/shop/checkout/" class="btn btn-primary">Log me, I have an account</a>
392 <h3 class="col-md-10">Billing Information</h3>
393 <div t-attf-class="form-group #{error.get('name', '')}">
394 <label class="col-lg-3 control-label" for="contact_name">Name and firstname</label>
395 <div class="col-lg-4">
396 <input type="text" name="name" class="form-control" t-att-value="checkout.get('name', '')"/>
399 <div t-attf-class="form-group #{error.get('phone', '')}">
400 <label class="col-lg-3 control-label" for="contact_name">Telephone</label>
401 <div class="col-lg-4">
402 <input type="tel" name="phone" class="form-control" t-att-value="checkout.get('phone', '')"/>
405 <div t-attf-class="form-group #{error.get('fax', '')}">
406 <label class="col-lg-3 control-label" for="contact_name">Fax</label>
407 <div class="col-lg-4">
408 <input type="tel" name="fax" class="form-control" t-att-value="checkout.get('fax', '')"/>
411 <div t-attf-class="form-group #{error.get('company', '')}">
412 <label class="col-lg-3 control-label" for="contact_name">Company</label>
413 <div class="col-lg-4">
414 <input type="text" name="company" class="form-control" t-att-value="checkout.get('company', '')"/>
417 <div t-attf-class="form-group #{error.get('email', '')}">
418 <label class="col-lg-3 control-label" for="contact_name">Email address</label>
419 <div class="col-lg-4">
420 <input type="email" name="email" class="form-control" t-att-value="checkout.get('email', '')"/>
423 <div t-attf-class="form-group #{error.get('street', '')}">
424 <label class="col-lg-3 control-label" for="contact_name">Street</label>
425 <div class="col-lg-4">
426 <input type="text" name="street" class="form-control" t-att-value="checkout.get('street', '')"/>
429 <div t-attf-class="form-group #{error.get('city', '')}">
430 <label class="col-lg-3 control-label" for="contact_name">City</label>
431 <div class="col-lg-4">
432 <input type="text" name="city" class="form-control" t-att-value="checkout.get('city', '')"/>
435 <div t-attf-class="form-group #{error.get('state_id', '')}">
436 <label class="col-lg-3 control-label" for="contact_name">State / Province</label>
437 <div class="col-lg-4">
438 <select name="state_id" class="form-control">
439 <option value="">State / Province...</option>
440 <t t-foreach="states or []" t-as="state">
441 <option t-att-value="state.id" t-att-selected="state.id == checkout.get('state_id')"><t t-esc="state.name"/></option>
446 <div t-attf-class="form-group #{error.get('zip', '')}">
447 <label class="col-lg-3 control-label" for="contact_name">Zip / Postal Code</label>
448 <div class="col-lg-4">
449 <input type="text" name="zip" class="form-control" t-att-value="checkout.get('zip', '')"/>
452 <div t-attf-class="form-group #{error.get('country_id', '')}">
453 <label class="col-lg-3 control-label" for="contact_name">Country</label>
454 <div class="col-lg-4">
455 <select name="country_id" class="form-control">
456 <option value="">Country...</option>
457 <t t-foreach="countries or []" t-as="country">
458 <option t-att-value="country.id" t-att-selected="country.id == checkout.get('country_id')"><t t-esc="country.name"/></option>
463 <div class="form-group checkbox">
464 <div class="col-lg-7 col-md-offset-3">
466 <input t-if="not shipping" type="checkbox" name="shipping_different"/>
467 <input t-if="shipping" type="checkbox" name="shipping_different" checked="1"/>
468 Ship to different address
473 <div class="js_shipping row" t-att-style="not shipping and 'display:none' or ''">
474 <h3 class="col-md-12 oe_shipping">Shipping Information</h3>
475 <div t-attf-class="form-group #{error.get('shipping_name', '')}">
476 <label class="col-lg-3 control-label" for="contact_name">Name and firstname</label>
477 <div class="col-lg-4">
478 <input type="text" name="shipping_name" class="form-control" t-att-value="checkout.get('shipping_name', '')"/>
481 <div t-attf-class="form-group #{error.get('shipping_phone', '')}">
482 <label class="col-lg-3 control-label" for="contact_name">Telephone</label>
483 <div class="col-lg-4">
484 <input type="tel" name="shipping_phone" class="form-control" t-att-value="checkout.get('shipping_phone', '')"/>
487 <div t-attf-class="form-group #{error.get('shipping_fax', '')}">
488 <label class="col-lg-3 control-label" for="contact_name">Fax</label>
489 <div class="col-lg-4">
490 <input type="tel" name="shipping_fax" class="form-control" t-att-value="checkout.get('shipping_fax', '')"/>
493 <div t-attf-class="form-group #{error.get('shipping_street', '')}">
494 <label class="col-lg-3 control-label" for="contact_name">Street</label>
495 <div class="col-lg-4">
496 <input type="text" name="shipping_street" class="form-control" t-att-value="checkout.get('shipping_street', '')"/>
499 <div t-attf-class="form-group #{error.get('shipping_city', '')}">
500 <label class="col-lg-3 control-label" for="contact_name">City</label>
501 <div class="col-lg-4">
502 <input type="text" name="shipping_city" class="form-control" t-att-value="checkout.get('shipping_city', '')"/>
505 <div t-attf-class="form-group #{error.get('shipping_state_id', '')}">
506 <label class="col-lg-3 control-label" for="contact_name">State / Province</label>
507 <div class="col-lg-4">
508 <select name="shipping_state_id" class="form-control">
509 <option value="">State / Province...</option>
510 <t t-foreach="states or []" t-as="state">
511 <option t-att-value="state.id" t-att-selected="state.id == checkout.get('shipping_state_id')"><t t-esc="state.name"/></option>
516 <div t-attf-class="form-group #{error.get('shipping_zip', '')}">
517 <label class="col-lg-3 control-label" for="contact_name">Zip / Postal Code</label>
518 <div class="col-lg-4">
519 <input type="text" name="shipping_zip" class="form-control" t-att-value="checkout.get('shipping_zip', '')"/>
522 <div t-attf-class="form-group #{error.get('shipping_country_id', '')}">
523 <label class="col-lg-3 control-label" for="contact_name">Country</label>
524 <div class="col-lg-4">
525 <select name="shipping_country_id" class="form-control">
526 <option value="">Country...</option>
527 <t t-foreach="countries or []" t-as="country">
528 <option t-att-value="country.id" t-att-selected="country.id == checkout.get('shipping_country_id')"><t t-esc="country.name"/></option>
534 <button type="submit" class="btn btn-default">Last stape</button>
541 <template id="payment">
542 <t t-call="website.layout">
544 <script type="text/javascript" src="/website_sale/static/src/js/website_sale.js"></script>
545 <t t-raw="head or ''"/>
547 <t t-set="title">Shop - Payment</t>
548 <div class="container oe_website_sale">
550 <div class="col-md-4">
551 <table class="table table-condensed" t-if="order">
559 <tbody t-if="order.order_line">
560 <t t-foreach="order.order_line" t-as="line">
562 <td><t t-esc="line.name"/></td>
563 <td><t t-esc="line.product_uom_qty"/></td>
564 <td><t t-esc="line.price_unit"/> €</td>
569 <tr><th>Untaxed Amount</th><td></td><td><t t-esc="order.amount_untaxed"/> €</td></tr>
570 <tr><th>Taxes</th><td></td><td><t t-esc="order.amount_tax"/> €</td></tr>
571 <tr><th>Total</th><td></td><td><t t-esc="order.amount_total"/> €</td></tr>
575 <div class="col-md-8">
576 <div class="js_payment row">
577 <h3 class="col-md-12">Click on your payment method</h3>
578 <div class="col-md-2">
579 <t t-foreach="payments or []" t-as="payment">
581 <input t-att-value="payment.id" type="radio" name="payment_type"/> <t t-esc="payment.name"/>
585 <t t-foreach="payments or []" t-as="payment">
586 <div t-att-data-id="payment.id" t-raw="payment._content" class="hidden col-md-6"/>
588 <a href="/shop/payment_validate/" class="hidden btn btn-default">I validate my payment</a>