|
@@ -12,6 +12,7 @@
|
|
<xpath expr="//t[@t-as='variant_id']" position="replace">
|
|
<xpath expr="//t[@t-as='variant_id']" position="replace">
|
|
<t t-foreach="product.attribute_line_ids" t-as="variant_id">
|
|
<t t-foreach="product.attribute_line_ids" t-as="variant_id">
|
|
<li t-if="len(variant_id.value_ids) > 1">
|
|
<li t-if="len(variant_id.value_ids) > 1">
|
|
|
|
+ <!-- Caso la variante sea distinto a tipo radio o tipo color -->
|
|
<t t-if="variant_id.attribute_id.type in ['select', 'hidden']">
|
|
<t t-if="variant_id.attribute_id.type in ['select', 'hidden']">
|
|
<select class="form-control js_variant_change" t-att-name="'attribute-%s-%s' % (product.id, variant_id.attribute_id.id)">
|
|
<select class="form-control js_variant_change" t-att-name="'attribute-%s-%s' % (product.id, variant_id.attribute_id.id)">
|
|
<t t-foreach="variant_id.value_ids" t-as="value_id">
|
|
<t t-foreach="variant_id.value_ids" t-as="value_id">
|
|
@@ -27,7 +28,7 @@
|
|
</t>
|
|
</t>
|
|
</select>
|
|
</select>
|
|
</t>
|
|
</t>
|
|
-
|
|
|
|
|
|
+ <!-- Caso el cliente compre solo por curva, se despliega esta opcion -->
|
|
<t t-if="user_id.partner_id.website_sale_type == True">
|
|
<t t-if="user_id.partner_id.website_sale_type == True">
|
|
<div class="container">
|
|
<div class="container">
|
|
<div class="row">
|
|
<div class="row">
|
|
@@ -59,10 +60,8 @@
|
|
</t>
|
|
</t>
|
|
|
|
|
|
|
|
|
|
- <input id="attribute_list" type="hidden" t-att-value="attribute_value_ids"></input>
|
|
|
|
- <input id="variant_list" type="hidden" t-att-value="variant_id.value_ids"></input>
|
|
|
|
- <input id="product_curva" type="hidden" t-att-value="product.variant_item_ids"/>
|
|
|
|
- <input id="product_curva_qty" type="hidden" t-att-value="product.curva"/>
|
|
|
|
|
|
+ <!-- Caso el cliente compre por unidad, se despliega esta opcion -->
|
|
|
|
+
|
|
<t t-if="user_id.partner_id.website_sale_type == False">
|
|
<t t-if="user_id.partner_id.website_sale_type == False">
|
|
<div class="container">
|
|
<div class="container">
|
|
<div class="row text-left">
|
|
<div class="row text-left">
|
|
@@ -71,7 +70,12 @@
|
|
<div class="panel panel-dafault" style="border:none;">
|
|
<div class="panel panel-dafault" style="border:none;">
|
|
<div class="panel-body panel-body-landing">
|
|
<div class="panel-body panel-body-landing">
|
|
<table class="table table-condenced text-center">
|
|
<table class="table table-condenced text-center">
|
|
|
|
+ <!-- Variante tipo radio -->
|
|
<t t-if="variant_id.attribute_id.type == 'radio'">
|
|
<t t-if="variant_id.attribute_id.type == 'radio'">
|
|
|
|
+ <input id="attribute_list" type="hidden" t-att-value="attribute_value_ids"></input>
|
|
|
|
+ <input id="variant_list" type="hidden" t-att-value="variant_id.value_ids"></input>
|
|
|
|
+ <input id="product_curva" type="hidden" t-att-value="product.variant_item_ids"/>
|
|
|
|
+ <input id="product_curva_qty" type="hidden" t-att-value="product.curva"/>
|
|
<ul class="list-unstyled">
|
|
<ul class="list-unstyled">
|
|
<t t-set="inc" t-value="0"/>
|
|
<t t-set="inc" t-value="0"/>
|
|
<t t-foreach="variant_id.value_ids" t-as="value_id">
|
|
<t t-foreach="variant_id.value_ids" t-as="value_id">
|
|
@@ -94,6 +98,20 @@
|
|
</ul>
|
|
</ul>
|
|
</t>
|
|
</t>
|
|
</table>
|
|
</table>
|
|
|
|
+ <!-- Variante tipo color -->
|
|
|
|
+ <t t-if="variant_id.attribute_id.type == 'color'">
|
|
|
|
+ <input id="variant_list_color" type="hidden" t-att-value="variant_id.value_ids"></input>
|
|
|
|
+ <ul class="list-inline">
|
|
|
|
+ <t t-set="inc" t-value="0"/>
|
|
|
|
+ <li t-foreach="variant_id.value_ids" t-as="value_id">
|
|
|
|
+ <label t-attf-style="background-color:#{value_id.color or value_id.name}" t-attf-class="css_attribute_color #{'active' if not inc else ''}">
|
|
|
|
+ <!-- <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"/> -->
|
|
|
|
+ <input type="radio" 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" id="product_color"/>
|
|
|
|
+ </label>
|
|
|
|
+ <t t-set="inc" t-value="inc+1"/>
|
|
|
|
+ </li>
|
|
|
|
+ </ul>
|
|
|
|
+ </t>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -101,17 +119,6 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</t>
|
|
</t>
|
|
- <t t-if="variant_id.attribute_id.type == 'color'">
|
|
|
|
- <ul class="list-inline">
|
|
|
|
- <t t-set="inc" t-value="0"/>
|
|
|
|
- <li t-foreach="variant_id.value_ids" t-as="value_id">
|
|
|
|
- <label t-attf-style="background-color:#{value_id.color or value_id.name}" t-attf-class="css_attribute_color #{'active' if not inc else ''}">
|
|
|
|
- <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"/>
|
|
|
|
- </label>
|
|
|
|
- <t t-set="inc" t-value="inc+1"/>
|
|
|
|
- </li>
|
|
|
|
- </ul>
|
|
|
|
- </t>
|
|
|
|
</li>
|
|
</li>
|
|
<t t-if="user_id.partner_id.website_sale_type == True">
|
|
<t t-if="user_id.partner_id.website_sale_type == True">
|
|
<div class="container text-center">
|
|
<div class="container text-center">
|
|
@@ -122,19 +129,16 @@
|
|
</xpath>
|
|
</xpath>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
+ <!-- Oculta el boton 'add to cart' por defecto del odoo -->
|
|
<template id="product_form" inherit_id="website_sale.product" name="product">
|
|
<template id="product_form" inherit_id="website_sale.product" name="product">
|
|
<xpath expr="//a[@id='add_to_cart']" position="replace">
|
|
<xpath expr="//a[@id='add_to_cart']" position="replace">
|
|
- <!-- <t t-foreach="product.attribute_line_ids" t-as="variant_id">
|
|
|
|
- <t t-if="len(variant_id.value_ids) > 1"> -->
|
|
|
|
- <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>
|
|
|
|
- <!-- </t>
|
|
|
|
- </t> -->
|
|
|
|
|
|
+ <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>
|
|
</xpath>
|
|
</xpath>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
+ <!-- Oculta el spinner de cantidad -->
|
|
<template id="product_quantity_form" inherit_id="website_sale.product_quantity" name="product_quantity">
|
|
<template id="product_quantity_form" inherit_id="website_sale.product_quantity" name="product_quantity">
|
|
<xpath expr="//div[@class='css_quantity input-group oe_website_spinner']" position="replace">
|
|
<xpath expr="//div[@class='css_quantity input-group oe_website_spinner']" position="replace">
|
|
-
|
|
|
|
<div class="css_quantity input-group oe_website_spinner" style="display:none;">
|
|
<div class="css_quantity input-group oe_website_spinner" style="display:none;">
|
|
<span class="input-group-addon">
|
|
<span class="input-group-addon">
|
|
<a t-attf-href="#" class="mb8 js_add_cart_json">
|
|
<a t-attf-href="#" class="mb8 js_add_cart_json">
|
|
@@ -148,7 +152,6 @@
|
|
</a>
|
|
</a>
|
|
</span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
-
|
|
|
|
</xpath>
|
|
</xpath>
|
|
</template>
|
|
</template>
|
|
</data>
|
|
</data>
|