Browse Source

[UPDT] Optional Products Bug Fixed

pull/94/head
Sreejith P 7 years ago
parent
commit
ada6ce4533
  1. 109
      website_coupon/views/templates.xml

109
website_coupon/views/templates.xml

@ -1,7 +1,10 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template id="voucher_code" inherit_id="website_sale.cart" active="False" customize_show="True" name="Voucher Code">
<xpath expr="//div[hasclass('o_website_sale_rightfit')]" position="after">
<template id="voucher_code" inherit_id="website_sale.cart"
active="False" customize_show="True"
name="Voucher Code">
<xpath expr="//div[hasclass('o_website_sale_rightfit')]"
position="after">
<h4>Voucher Code</h4>
<p>
Have a voucher code? Fill this field and apply.
@ -17,10 +20,15 @@
<p class="bg-warning">The discount amount is too large</p>
</t>
</t>
<form t-if="website_sale_order and website_sale_order.website_order_line" action="/shop/gift_coupon" method="post" class="mb32">
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()" />
<form t-if="website_sale_order and website_sale_order.website_order_line"
action="/shop/gift_coupon" method="post"
class="mb32">
<input type="hidden" name="csrf_token"
t-att-value="request.csrf_token()" />
<div class="input-group">
<input name="promo_voucher" class="form-control" type="text" placeholder="code..." t-att-value="website_sale_order.pricelist_id.code or None" />
<input name="promo_voucher" class="form-control"
type="text" placeholder="code..."
t-att-value="website_sale_order.pricelist_id.code or None" />
<div class="input-group-btn">
<a class="btn btn-default a-submit">Apply</a>
</div>
@ -30,69 +38,50 @@
</template>
<template id="cart_lines_extended" inherit_id="website_sale.cart_lines">
<xpath expr="//table[@id='cart_products']" position="replace">
<table class="table table-striped table-condensed js_cart_lines" id="cart_products" t-if="website_sale_order and website_sale_order.website_order_line">
<thead>
<tr>
<th width="100">Product</th>
<th></th>
<th width="130" class="text-center">Quantity</th>
<th width="100" class="text-center">Price</th>
</tr>
</thead>
<tbody>
<t t-foreach="website_sale_order.website_order_line" t-as="line">
<tr>
<td colspan="2" t-if="not line.product_id.product_tmpl_id"></td>
<td align="center" t-if="line.product_id.product_tmpl_id">
<span t-field="line.product_id.image_small" t-options="{'widget': 'image', 'class': 'img-rounded'}" />
</td>
<td t-if="line.product_id.product_tmpl_id">
<div>
<a t-attf-href="/shop/product/#{ slug(line.product_id.product_tmpl_id) }">
<strong t-esc="line.product_id.with_context(display_default_code=False).display_name" />
</a>
</div>
<div class="text-muted">
<t t-foreach="line.name.splitlines()[1:]" t-as="name_line">
<span><t t-esc="name_line"/></span><br/>
</t>
</div>
<t t-if="line.product_id.display_name != 'Gift Coupon'">
<a href='#' class='js_delete_product no-decoration'> <small><i class='fa fa-trash-o'></i> Remove</small></a>
</t>
</td>
<td class="text-center" id="td-qty">
<xpath expr="//table[@id='cart_products']/thead/tr/th[1]" position="attributes">
<attribute name="width">100</attribute>
</xpath>
<xpath expr="//table[@id='cart_products']/thead/tr/th[3]" position="attributes">
<attribute name="width">130</attribute>
</xpath>
<xpath expr="//table[@id='cart_products']/thead/tr/th[4]" position="attributes">
<attribute name="width">100</attribute>
</xpath>
<xpath expr="//table[@id='cart_products']/tbody//td[hasclass('td-qty')]/div"
position="replace">
<div class="css_quantity input-group oe_website_spinner">
<t t-if="line.product_id.display_name == 'Gift Coupon'">
<a href='#' class='js_delete_product no-decoration'> <small><i class='fa fa-trash-o'></i> Remove</small></a>
<div class="input-group oe_website_spinner">
<input type="hidden" class="js_quantity form-control" t-att-data-line-id="line.id" t-att-data-product-id="line.product_id.id" t-att-value="int(line.product_uom_qty)" />
</div>
<a href='#' class='js_delete_product no-decoration'>
<small>
<i class='fa fa-trash-o'></i>
Remove
</small>
</a>
<input type="hidden" class="js_quantity form-control"
t-att-data-line-id="line.id"
t-att-data-product-id="line.product_id.id"
t-att-value="int(line.product_uom_qty)"
/>
</t>
<t t-if="line.product_id.display_name != 'Gift Coupon'">
<div class="input-group oe_website_spinner">
<a t-attf-href="#" class="mb8 input-group-addon js_add_cart_json" data-no-instant="">
<a t-attf-href="#"
class="mb8 input-group-addon js_add_cart_json"
data-no-instant="">
<i class="fa fa-minus"></i>
</a>
<input type="text" class="js_quantity form-control" t-att-data-line-id="line.id" t-att-data-product-id="line.product_id.id" t-att-value="int(line.product_uom_qty)" />
<a t-attf-href="#" class="mb8 input-group-addon float_left js_add_cart_json" data-no-instant="">
<input type="text" class="js_quantity form-control"
t-att-data-line-id="line.id"
t-att-data-product-id="line.product_id.id"
t-att-value="int(line.product_uom_qty)" />
<a t-attf-href="#"
class="mb8 input-group-addon float_left js_add_cart_json"
data-no-instant="">
<i class="fa fa-plus"></i>
</a>
</div>
</t>
</td>
<td class="text-center" id="td-price" name="price">
<t t-if="(compute_currency(line.product_id.lst_price) - line.price_reduce ) &gt; 0.01 and website.get_current_pricelist().discount_policy=='without_discount'">
<del t-attf-class="#{'text-danger mr8'}" style="white-space: nowrap;" t-esc="compute_currency(line.product_id.website_public_price)" t-options="{'widget': 'monetary', 'display_currency': website.get_current_pricelist().currency_id, 'from_currency': website.currency_id}" />
</t>
<span t-field="line.price_reduce_taxexcl" style="white-space: nowrap;" t-options="{'widget': 'monetary', 'from_currency': website_sale_order.pricelist_id.currency_id, 'display_currency': website.currency_id}" groups="sale.group_show_price_subtotal" />
<span t-field="line.price_reduce_taxinc" style="white-space: nowrap;" t-options="{'widget': 'monetary', 'from_currency': website_sale_order.pricelist_id.currency_id, 'display_currency': website.currency_id}" groups="sale.group_show_price_total" />
</td>
</tr>
</t>
</tbody>
</table>
</div>
</xpath>
</template>
</odoo>
Loading…
Cancel
Save