You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
98 lines
6.4 KiB
98 lines
6.4 KiB
<?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[@id='right_column']" position="inside">
|
|
<h4>Voucher Code</h4>
|
|
<p>
|
|
Have a voucher code? Fill this field and apply.
|
|
</p>
|
|
<t t-if="coupon_not_available">
|
|
<t t-if="coupon_not_available=='1'">
|
|
<p class="bg-warning">This gift code is not available</p>
|
|
</t>
|
|
<t t-if="coupon_not_available=='2'">
|
|
<p class="bg-warning">This gift code is not available</p>
|
|
</t>
|
|
<t t-if="coupon_not_available=='3'">
|
|
<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()" />
|
|
<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" />
|
|
<div class="input-group-btn">
|
|
<a class="btn btn-default a-submit">Apply</a>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</xpath>
|
|
</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">
|
|
<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>
|
|
</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="">
|
|
<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="">
|
|
<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 ) > 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>
|
|
|
|
</xpath>
|
|
</template>
|
|
</odoo>
|