templates.xml 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <openerp>
  3. <data>
  4. <!-- Layout and common templates -->
  5. <template id="assets_frontend_ext" inherit_id="website.assets_frontend" name="Shop Ext">
  6. <xpath expr="." position="inside">
  7. <link rel='stylesheet' href='/web_site_sale_extend/static/src/css/website_sale_ext.css'/>
  8. <link rel='stylesheet' href='/web_site_sale_extend/static/src/css/dialog_box.css'/>
  9. <script type="text/javascript" src="/web_site_sale_extend/static/src/js/website_sale_ext.js"></script>
  10. <script type="text/javascript" src="/web_site_sale_extend/static/src/js/dialog_box.js"></script>
  11. </xpath>
  12. </template>
  13. <template id="products_stock_avail" inherit_id="website_sale.products_item" active="False" customize_show="True" name="Product Stock Label">
  14. <xpath expr="//div[@class='oe_product_image']" position="inside">
  15. <div style="top:0;left:0;width:50%;position: relative; z-index: 9999;">
  16. <t t-if="product.qty_available &gt; 0">
  17. <div class="badge btn" style="background-color:green;opacity: 0.6;filter: alpha(opacity=60);">
  18. <span t-esc="int(product.qty_available)"/>&#160;
  19. <span t-esc="product.uom_id.name" groups="product.group_uom"></span>&#160;
  20. <span>In Stock</span>
  21. </div>
  22. </t>
  23. <t t-if="product.qty_available &lt;= 0" style="background-color:red;">
  24. <div class="badge btn" style="background-color:red;opacity: 0.6;filter: alpha(opacity=60);">SOLD OUT</div>
  25. </t>
  26. </div>
  27. </xpath>
  28. </template>
  29. <template id="product_stock_avail_add_page" inherit_id="website_sale.product" active="False" customize_show="True" name="Product Stock Available">
  30. <xpath expr="//a[@id='add_to_cart']" position="before">
  31. <div class="stock_label_div" style="width:50%;position: relative; z-index: 9999;">
  32. <t t-if="product.qty_available &gt; 0">
  33. <div class="badge btn stock_label" style="background-color:green;opacity: 0.6;filter: alpha(opacity=60);">
  34. <span t-esc="int(product.qty_available)"/>&#160;
  35. <span t-esc="product.uom_id.name" groups="product.group_uom"></span>&#160;
  36. <span>In Stock</span>
  37. </div>
  38. </t>
  39. <t t-if="product.qty_available &lt;= 0" style="background-color:red;">
  40. <div class="badge btn stock_label" style="background-color:red;opacity: 0.6;filter: alpha(opacity=60);">SOLD OUT</div>
  41. </t>
  42. </div>
  43. <div class="stock_label_div_variant" style="width:50%;position: relative; z-index: 9999;">
  44. <t>
  45. <div class="badge btn stock_label_variant_in hidden" style="background-color:green;opacity: 0.6;filter: alpha(opacity=60);">
  46. <span t-esc="int(product.qty_available)" id="qty_avail_variant" name="qty_avail_variant"/>&#160;
  47. <span t-esc="product.uom_id.name" groups="product.group_uom"></span>&#160;
  48. <span>In Stock</span>
  49. </div>
  50. </t>
  51. <t style="background-color:red;">
  52. <div class="badge btn stock_label_variant_out hidden" style="background-color:red;opacity: 0.6;filter: alpha(opacity=60);">SOLD OUT</div>
  53. </t>
  54. </div>&#160;
  55. <!--span t-value="product.product_variant_ids[0].id" name="prod_variant_id" id="prod_variant_id"/-->
  56. <span t-esc="website.added_to_cart_product_qty(product.id)" name="product_added_qty" id="product_added_qty" class="hidden"/>
  57. </xpath>
  58. <xpath expr="//a[@id='add_to_cart']" position="replace">
  59. <a id="add_to_cart" t-attf-class="btn btn-primary btn-lg mt8 js_check_product a-submit #{product.qty_available &lt;= 0 and 'disabled'}" href="#" >Add to Cart</a>
  60. </xpath>
  61. </template>
  62. <template id="product_quantity_add_page" inherit_id="website_sale.product_quantity">
  63. <xpath expr="//input[@name='add_qty']" position="after">
  64. <span id="stock_available" name="stock_available" class="hidden" t-esc="product.qty_available"/>
  65. </xpath>
  66. </template>
  67. <template id="product_quantity_add_cart" inherit_id="website_sale.cart">
  68. <xpath expr="//span[@class='input-group-addon']" position="before">
  69. <span id="stock_available_line" t-att-data-line-id="line.id" t-att-data-product-id="line.product_id.id" name="stock_available_line" class="hidden" t-esc="line.product_id.qty_available"/>
  70. </xpath>
  71. </template>
  72. </data>
  73. </openerp>