123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- <?xml version="1.0" encoding="utf-8"?>
- <openerp>
- <data>
- <template id="assets_frontend" inherit_id="website.assets_frontend" name="Shop">
- <xpath expr="." position="inside">
- <script type="text/javascript" src="/website_sale_multi_add/static/src/js/website_sale_multi_add.js"></script>
- <!-- <link rel='stylesheet' href='/website_sale_stock_status/static/src/css/website_sale_stock_status.css'/> -->
- </xpath>
- </template>
- <template id="variant_form" inherit_id="website_sale.variants" name="variants">
- <xpath expr="//t[@t-as='variant_id']" position="replace">
- <t t-foreach="product.attribute_line_ids" t-as="variant_id">
- <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']">
- <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">
- <option t-att-value="value_id.id">
- <span t-field="value_id.name"/>
- <span t-if="value_id.price_extra">
- <t t-esc="value_id.price_extra > 0 and '+' or ''"/><span
- t-field="value_id.price_extra"
- style="white-space: nowrap;"
- t-field-options="{ "widget": "monetary", "from_currency": "product.company_id.currency_id", "display_currency": "user_id.partner_id.property_product_pricelist.currency_id" }"/>
- </span>
- </option>
- </t>
- </select>
- </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 solo por curva, se despliega esta opcion -->
- <t t-if="user_id.partner_id.website_sale_type == True">
- <div class="container">
- <div class="row">
- <div class="col-md-12">
- <!-- Variante tipo color -->
- <t t-if="variant_id.attribute_id.type == 'color'">
- <h2 class="panel-title" t-field="variant_id.attribute_id.name"></h2>
- <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" 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>
- <t t-if="variant_id.attribute_id.type == 'radio'">
- <h2 class="panel-title" t-field="variant_id.attribute_id.name"></h2>
- <table class="table table-condenced text-center">
- <ul class="list-unstyled">
- <t t-set="inc" t-value="0"/>
- <tr>
- <t t-foreach="variant_id.value_ids" t-as="value_id">
- <li class="form-group js_attribute_value">
- <td>
- <span t-field="value_id.name"/>
- </td>
- </li>
- <t t-set="inc" t-value="inc+1"/></t>
- </tr>
- </ul>
- </table>
- </t>
- </div>
- </div>
- </div>
- </t>
- <!-- Caso el cliente compre por unidad, se despliega esta opcion -->
- <t t-if="user_id.partner_id.website_sale_type == False">
- <div class="container">
- <div class="row text-left">
- <div class="col-md-12">
- <div class="pricing-table">
- <div class="panel panel-dafault" style="border:none;">
- <div class="panel-body panel-body-landing">
- <table class="table table-condenced text-center">
- <!-- Variante tipo radio -->
- <t t-if="variant_id.attribute_id.type == 'radio'">
- <ul class="list-unstyled">
- <t t-set="inc" t-value="0"/>
- <t t-foreach="variant_id.value_ids" t-as="value_id">
- <li class="form-group js_attribute_value">
- <tr>
- <td>
- <span t-field="value_id.name"/>
- </td>
- <td>
- <span class="badge" t-if="value_id.price_extra">
- <t t-esc="value_id.price_extra > 0 and '+' or ''"/>
- <span t-field="value_id.price_extra" t-field-options="{ "widget": "monetary", "from_currency": "product.company_id.currency_id", "display_currency": "user_id.partner_id.property_product_pricelist.currency_id" }"/></span>
- </td>
- <td>
- <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>
- </td>
- </tr>
- </li>
- <t t-set="inc" t-value="inc+1"/></t>
- </ul>
- </t>
- </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>
- </t>
- </li>
- </t>
- <t t-if="user_id.partner_id.website_sale_type == True">
- <div class="container text-center">
- <button id="curva" class="btn" href="">Comprar Curva</button>
- </div>
- </t>
- </xpath>
- </template>
- <!-- Oculta el boton 'add to cart' por defecto del odoo -->
- <template id="product_form" inherit_id="website_sale.product" name="product">
- <xpath expr="//a[@id='add_to_cart']" position="replace">
- <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>
- </template>
- <!-- Oculta el spinner de cantidad -->
- <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">
- <div class="css_quantity input-group oe_website_spinner" style="display:none;">
- <span class="input-group-addon">
- <a t-attf-href="#" class="mb8 js_add_cart_json">
- <i class="fa fa-minus"/>
- </a>
- </span>
- <input type="text" class="js_quantity form-control" data-min="1" name="add_qty" value="1"/>
- <span class="input-group-addon">
- <a t-attf-href="#" class="mb8 float_left js_add_cart_json">
- <i class="fa fa-plus"/>
- </a>
- </span>
- </div>
- </xpath>
- </template>
- </data>
- </openerp>
|