templates.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <openerp>
  3. <data>
  4. <template id="assets_frontend" inherit_id="website.assets_frontend" name="Shop">
  5. <xpath expr="." position="inside">
  6. <script type="text/javascript" src="/website_sale_multi_add/static/src/js/website_sale_multi_add.js"></script>
  7. <!-- <link rel='stylesheet' href='/website_sale_stock_status/static/src/css/website_sale_stock_status.css'/> -->
  8. </xpath>
  9. </template>
  10. <template id="variant_form" inherit_id="website_sale.variants" name="variants">
  11. <xpath expr="//t[@t-as='variant_id']" position="replace">
  12. <t t-foreach="product.attribute_line_ids" t-as="variant_id">
  13. <li t-if="len(variant_id.value_ids) &gt; 1">
  14. <t t-if="variant_id.attribute_id.type in ['select', 'hidden']">
  15. <select class="form-control js_variant_change" t-att-name="'attribute-%s-%s' % (product.id, variant_id.attribute_id.id)">
  16. <t t-foreach="variant_id.value_ids" t-as="value_id">
  17. <option t-att-value="value_id.id">
  18. <span t-field="value_id.name"/>
  19. <span t-if="value_id.price_extra">
  20. <t t-esc="value_id.price_extra &gt; 0 and '+' or ''"/><span
  21. t-field="value_id.price_extra"
  22. style="white-space: nowrap;"
  23. t-field-options="{ &quot;widget&quot;: &quot;monetary&quot;, &quot;from_currency&quot;: &quot;product.company_id.currency_id&quot;, &quot;display_currency&quot;: &quot;user_id.partner_id.property_product_pricelist.currency_id&quot; }"/>
  24. </span>
  25. </option>
  26. </t>
  27. </select>
  28. </t>
  29. <t t-if="user_id.partner_id.website_sale_type == True">
  30. <div class="container">
  31. <div class="row">
  32. <div class="col-md-12">
  33. <div class="panel panel-primary">
  34. <div class="panel-heading">
  35. <h3 class="panel-title" t-field="variant_id.attribute_id.name"></h3>
  36. </div>
  37. <table class="table table-condenced text-center">
  38. <t t-if="variant_id.attribute_id.type == 'radio'">
  39. <ul class="list-unstyled">
  40. <t t-set="inc" t-value="0"/>
  41. <tr>
  42. <t t-foreach="variant_id.value_ids" t-as="value_id">
  43. <li class="form-group js_attribute_value">
  44. <td>
  45. <span t-field="value_id.name"/>
  46. </td>
  47. </li>
  48. <t t-set="inc" t-value="inc+1"/></t>
  49. </tr>
  50. </ul>
  51. </t>
  52. </table>
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. </t>
  58. <input id="attribute_list" type="hidden" t-att-value="attribute_value_ids"></input>
  59. <input id="variant_list" type="hidden" t-att-value="variant_id.value_ids"></input>
  60. <input id="product_curva" type="hidden" t-att-value="product.variant_item_ids"/>
  61. <input id="product_curva_qty" type="hidden" t-att-value="product.curva"/>
  62. <t t-if="user_id.partner_id.website_sale_type == False">
  63. <div class="container">
  64. <div class="row text-left">
  65. <div class="col-md-12">
  66. <div class="pricing-table">
  67. <div class="panel panel-dafault" style="border:none;">
  68. <div class="panel-body panel-body-landing">
  69. <table class="table table-condenced text-center">
  70. <t t-if="variant_id.attribute_id.type == 'radio'">
  71. <ul class="list-unstyled">
  72. <t t-set="inc" t-value="0"/>
  73. <t t-foreach="variant_id.value_ids" t-as="value_id">
  74. <li class="form-group js_attribute_value">
  75. <tr>
  76. <td>
  77. <span t-field="value_id.name"/>
  78. </td>
  79. <td>
  80. <span class="badge" t-if="value_id.price_extra">
  81. <t t-esc="value_id.price_extra &gt; 0 and '+' or ''"/>
  82. <span t-field="value_id.price_extra" t-field-options="{ &quot;widget&quot;: &quot;monetary&quot;, &quot;from_currency&quot;: &quot;product.company_id.currency_id&quot;, &quot;display_currency&quot;: &quot;user_id.partner_id.property_product_pricelist.currency_id&quot; }"/></span>
  83. </td>
  84. <td>
  85. <button t-att-id="'attribute_%s' % value_id.id" type="button" class="js_variant_change btn btn-primary" t-att-checked="'checked' if not inc else ''" t-att-name="'attribute-%s-%s' % (product.id, variant_id.attribute_id.id)" t-att-value="inc+1">Agregar al carro</button>
  86. </td>
  87. </tr>
  88. </li>
  89. <t t-set="inc" t-value="inc+1"/></t>
  90. </ul>
  91. </t>
  92. </table>
  93. </div>
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. </div>
  99. </t>
  100. <t t-if="variant_id.attribute_id.type == 'color'">
  101. <ul class="list-inline">
  102. <t t-set="inc" t-value="0"/>
  103. <li t-foreach="variant_id.value_ids" t-as="value_id">
  104. <label t-attf-style="background-color:#{value_id.color or value_id.name}" t-attf-class="css_attribute_color #{'active' if not inc else ''}">
  105. <input type="radio" class="js_variant_change" t-att-checked="'checked' if not inc else ''" t-att-name="'attribute-%s-%s' % (product.id, variant_id.attribute_id.id)" t-att-value="value_id.id" t-att-title="value_id.name"/>
  106. </label>
  107. <t t-set="inc" t-value="inc+1"/>
  108. </li>
  109. </ul>
  110. </t>
  111. </li>
  112. <t t-if="user_id.partner_id.website_sale_type == True">
  113. <div class="container text-center">
  114. <button id="curva" class="btn btn-primary" href="">Comprar Curva</button>
  115. </div>
  116. </t>
  117. </t>
  118. </xpath>
  119. </template>
  120. <template id="product_form" inherit_id="website_sale.product" name="product">
  121. <xpath expr="//a[@id='add_to_cart']" position="replace">
  122. <!-- <t t-foreach="product.attribute_line_ids" t-as="variant_id">
  123. <t t-if="len(variant_id.value_ids) &gt; 1"> -->
  124. <a id="add_to_cart" class="btn btn-primary btn-lg mt8 js_check_product a-submit" href="#" style="display:none;">Add to Cart</a>
  125. <!-- </t>
  126. </t> -->
  127. </xpath>
  128. </template>
  129. <template id="product_quantity_form" inherit_id="website_sale.product_quantity" name="product_quantity">
  130. <xpath expr="//div[@class='css_quantity input-group oe_website_spinner']" position="replace">
  131. <div class="css_quantity input-group oe_website_spinner" style="display:none;">
  132. <span class="input-group-addon">
  133. <a t-attf-href="#" class="mb8 js_add_cart_json">
  134. <i class="fa fa-minus"/>
  135. </a>
  136. </span>
  137. <input type="text" class="js_quantity form-control" data-min="1" name="add_qty" value="1"/>
  138. <span class="input-group-addon">
  139. <a t-attf-href="#" class="mb8 float_left js_add_cart_json">
  140. <i class="fa fa-plus"/>
  141. </a>
  142. </span>
  143. </div>
  144. </xpath>
  145. </template>
  146. </data>
  147. </openerp>