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.
152 lines
9.5 KiB
152 lines
9.5 KiB
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<odoo>
|
|
<!-- Changing the cart template. Inheriting website_sale.cart_lines.-->
|
|
<template id="og_store_cart_line" name="OG Cart Line"
|
|
inherit_id="website_sale.cart_lines">
|
|
<xpath expr="//div[@id='cart_products']" position="replace">
|
|
<t t-set="show_qty"
|
|
t-value="is_view_active('website_sale.product_quantity')"/>
|
|
<div t-if="website_sale_order and website_sale_order.website_order_line"
|
|
class="table-responsive"
|
|
id="cart_products">
|
|
<table class="table table-cart js_cart_lines">
|
|
<thead class="border-bottom">
|
|
<tr>
|
|
<th class="border-0">Product</th>
|
|
<th class="border-0"></th>
|
|
<th t-if="is_view_active('website_sale.product_quantity')"
|
|
class="border-0 text-center">
|
|
Quantity
|
|
</th>
|
|
<th class="border-0 text-end">Subtotal</th>
|
|
<th class="border-0"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<t t-foreach="website_sale_order.website_order_line"
|
|
t-as="line">
|
|
<tr t-attf-class="#{line.linked_line_id and 'optional_product info'} align-middle o_cart_product"
|
|
t-attf-data-product-id="#{line.product_id and line.product_id.id}">
|
|
<!-- Product Image -->
|
|
<td class="text-center" style="width: 100px;">
|
|
<t t-if="line.product_id.image_128">
|
|
<img t-if="line._is_not_sellable_line()"
|
|
t-att-src="image_data_uri(line.product_id.image_128)"
|
|
class="img-fluid rounded"
|
|
t-att-alt="line.name_short"/>
|
|
<div t-else=""
|
|
t-field="line.product_id.image_128"
|
|
t-options="{'widget': 'image', 'class': 'img-fluid rounded'}"/>
|
|
</t>
|
|
</td>
|
|
|
|
<!-- Product Details -->
|
|
<td>
|
|
<div class="d-flex flex-column">
|
|
<t t-call="website_sale.cart_line_product_link">
|
|
<h6 t-field="line.name_short"
|
|
class="mb-0"/>
|
|
</t>
|
|
<small t-field="line.product_id.description_sale"
|
|
class="text-muted"/>
|
|
|
|
<!-- Display discount if applicable -->
|
|
<t t-if="line.discount">
|
|
<small class="text-muted">
|
|
Discount:<span
|
|
t-field="line.discount"/>%
|
|
</small>
|
|
</t>
|
|
</div>
|
|
</td>
|
|
<!-- Quantity -->
|
|
<td class="text-center td-qty">
|
|
<div t-attf-class="css_quantity input-group mb-2"
|
|
name="website_sale_cart_line_quantity">
|
|
<t t-if="not line._is_not_sellable_line()">
|
|
<t t-if="show_qty">
|
|
<a href="#"
|
|
class="js_add_cart_json btn btn-link d-inline-block border-end-0"
|
|
aria-label="Remove one"
|
|
title="Remove one">
|
|
<i class="position-relative z-1 fa fa-minus"/>
|
|
</a>
|
|
<input type="text"
|
|
class="js_quantity quantity form-control border-start-0 border-end-0"
|
|
t-att-data-line-id="line.id"
|
|
t-att-data-product-id="line.product_id.id"
|
|
t-att-value="line._get_displayed_quantity()"/>
|
|
<t t-if="line._get_shop_warning(clear=False)">
|
|
<a href="#"
|
|
class="btn btn-link">
|
|
<i class='fa fa-warning text-warning'
|
|
t-att-title="line._get_shop_warning()"
|
|
role="img"
|
|
aria-label="Warning"/>
|
|
</a>
|
|
</t>
|
|
<a t-else=""
|
|
href="#"
|
|
class="js_add_cart_json d-inline-block float_left btn btn-link border-start-0"
|
|
aria-label="Add one"
|
|
title="Add one">
|
|
<i class="fa fa-plus position-relative z-1"/>
|
|
</a>
|
|
</t>
|
|
<t t-else="">
|
|
<input type="hidden"
|
|
class="js_quantity form-control quantity"
|
|
t-att-data-line-id="line.id"
|
|
t-att-data-product-id="line.product_id.id"
|
|
t-att-value="line._get_displayed_quantity()"/>
|
|
</t>
|
|
</t>
|
|
<t t-else="">
|
|
<span class="w-100 text-muted"
|
|
t-esc="int(line.product_uom_qty)"/>
|
|
<input type="hidden"
|
|
class="js_quantity quantity form-control"
|
|
t-att-data-line-id="line.id"
|
|
t-att-data-product-id="line.product_id.id"
|
|
t-att-value="line._get_displayed_quantity()"/>
|
|
</t>
|
|
</div>
|
|
</td>
|
|
<!-- Subtotal -->
|
|
<td class="text-end">
|
|
<span t-field="line.price_subtotal"
|
|
t-options="{'widget': 'monetary', 'display_currency': website_sale_order.currency_id}"/>
|
|
</td>
|
|
<td class="text-end">
|
|
<a href="#"
|
|
style="color: #77797A;font-size: 16px;"
|
|
class="small o_add_wishlist js_delete_product px-2 border-start"
|
|
t-att-data-product-template-id="line.product_id.product_tmpl_id.id"
|
|
t-att-data-product-product-id="line.product_id.id"
|
|
data-action="o_wishlist">
|
|
<span>❤</span>
|
|
</a>
|
|
|
|
</td>
|
|
<td class="text-end">
|
|
<div name="o_wsale_cart_line_button_container">
|
|
<a href='#'
|
|
class="js_delete_product d-none d-md-inline-block small"
|
|
aria-label="Remove from cart"
|
|
title="Remove from cart">X
|
|
</a>
|
|
<button class="js_delete_product btn btn-light d-inline-block d-md-none"
|
|
title="remove">
|
|
<i class="fa fa-trash-o"/>
|
|
</button>
|
|
</div>
|
|
|
|
</td>
|
|
</tr>
|
|
</t>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</xpath>
|
|
</template>
|
|
</odoo>
|
|
|