7 changed files with 183 additions and 25 deletions
			
			
		@ -0,0 +1,85 @@ | 
				
			|||
<?xml version="1.0" encoding="utf-8" ?> | 
				
			|||
<odoo> | 
				
			|||
 | 
				
			|||
        <template id="website_sale.cart_lines" name="Shopping Cart Lines"> | 
				
			|||
        <div t-if="not website_sale_order or not website_sale_order.website_order_line" class="js_cart_lines alert alert-info"> | 
				
			|||
          Your cart is empty! | 
				
			|||
        </div> | 
				
			|||
        <table class="mb16 table table-striped table-sm js_cart_lines" id="cart_products" t-if="website_sale_order and website_sale_order.website_order_line"> | 
				
			|||
            <thead> | 
				
			|||
                <tr> | 
				
			|||
                    <th class="td-img">Product</th> | 
				
			|||
                    <th></th> | 
				
			|||
                    <th class="text-center td-qty">Quantity</th> | 
				
			|||
                    <th class="text-center td-price">Price</th> | 
				
			|||
                    <th class="text-center td-action"></th> | 
				
			|||
                </tr> | 
				
			|||
            </thead> | 
				
			|||
            <tbody> | 
				
			|||
                <t t-foreach="website_sale_order.website_order_line" t-as="line"> | 
				
			|||
                    <tr t-att-class="'optional_product info' if line.linked_line_id else None"> | 
				
			|||
                        <td colspan="2" t-if="not line.product_id.product_tmpl_id" class='td-img'></td> | 
				
			|||
                        <td align="center" t-if="line.product_id.product_tmpl_id" class='td-img'> | 
				
			|||
                            <span t-field="line.product_id.image_small" t-options="{'widget': 'image', 'class': 'rounded'}" /> | 
				
			|||
                        </td> | 
				
			|||
                        <td t-if="line.product_id.product_tmpl_id" class='td-product_name'> | 
				
			|||
                            <div> | 
				
			|||
                                <t t-call="website_sale.cart_line_product_link"> | 
				
			|||
                                    <strong t-field="line.name_short" /> | 
				
			|||
                                </t> | 
				
			|||
                            </div> | 
				
			|||
                            <t t-call="website_sale.cart_line_description_following_lines"> | 
				
			|||
                                <t t-set="div_class" t-value="'d-none d-md-block'"/> | 
				
			|||
                            </t> | 
				
			|||
                        </td> | 
				
			|||
                        <td class="text-center td-qty"> | 
				
			|||
                            <div t-if="not line.linked_line_id" class="css_quantity input-group mx-auto oe_website_spinner"> | 
				
			|||
                                <t t-if="line.name != 'Gift Coupon'"> | 
				
			|||
                                <div class="input-group-prepend"> | 
				
			|||
                                    <a t-attf-href="#" class="btn btn-link js_add_cart_json d-none d-md-inline-block" aria-label="Remove one" title="Remove one"> | 
				
			|||
                                        <i class="fa fa-minus"/> | 
				
			|||
                                    </a> | 
				
			|||
                                </div> | 
				
			|||
                                </t> | 
				
			|||
                                <t t-if="line.name != 'Gift Coupon'"> | 
				
			|||
                                <input type="text" 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="int(line.product_uom_qty) == line.product_uom_qty and int(line.product_uom_qty) or line.product_uom_qty" /> | 
				
			|||
                                </t> | 
				
			|||
                                <t t-if="line.name == 'Gift Coupon'"> | 
				
			|||
                                    <input type="text" 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="int(line.product_uom_qty) == line.product_uom_qty and int(line.product_uom_qty) or line.product_uom_qty" readonly="1"/> | 
				
			|||
                                </t> | 
				
			|||
                                <t t-if="line.name != 'Gift Coupon'"> | 
				
			|||
                                <div class="input-group-append"> | 
				
			|||
                                    <a t-attf-href="#" class="btn btn-link float_left js_add_cart_json d-none d-md-inline-block" aria-label="Add one" title="Add one"> | 
				
			|||
                                        <i class="fa fa-plus"/> | 
				
			|||
                                    </a> | 
				
			|||
                                </div> | 
				
			|||
                                </t> | 
				
			|||
                            </div> | 
				
			|||
                            <t t-if="line.linked_line_id"> | 
				
			|||
                              <span class="js_quantity text-muted" t-att-data-line-id="line.id" t-att-data-product-id="line.product_id.id" t-esc="int(line.product_uom_qty)"/> | 
				
			|||
                            </t> | 
				
			|||
                        </td> | 
				
			|||
                        <td class="text-center td-price" name="price"> | 
				
			|||
                            <t t-set="combination" t-value="line.product_id.product_template_attribute_value_ids + line.product_no_variant_attribute_value_ids"/> | 
				
			|||
                            <t t-set="combination_info" t-value="line.product_id.product_tmpl_id._get_combination_info(combination)"/> | 
				
			|||
 | 
				
			|||
                            <t t-set="list_price_converted" t-value="website.currency_id._convert(combination_info['list_price'], website_sale_order.currency_id, website_sale_order.company_id, date)"/> | 
				
			|||
                            <t groups="account.group_show_line_subtotals_tax_excluded" t-if="(website_sale_order.pricelist_id.discount_policy == 'without_discount' and website_sale_order.currency_id.compare_amounts(list_price_converted, line.price_reduce_taxexcl) == 1) or website_sale_order.currency_id.compare_amounts(line.price_unit, line.price_reduce) == 1" name="order_line_discount"> | 
				
			|||
                                <del t-attf-class="#{'text-danger mr8'}" style="white-space: nowrap;" t-esc="list_price_converted" t-options="{'widget': 'monetary', 'display_currency': website_sale_order.currency_id}" /> | 
				
			|||
                            </t> | 
				
			|||
                            <span t-field="line.price_reduce_taxexcl" style="white-space: nowrap;" t-options="{'widget': 'monetary', 'display_currency': website_sale_order.currency_id}" groups="account.group_show_line_subtotals_tax_excluded" /> | 
				
			|||
                            <t groups="account.group_show_line_subtotals_tax_included" t-if="(website_sale_order.pricelist_id.discount_policy == 'without_discount' and website_sale_order.currency_id.compare_amounts(list_price_converted, line.price_reduce_taxinc) == 1) or website_sale_order.currency_id.compare_amounts(line.price_unit, line.price_reduce) == 1" name="order_line_discount"> | 
				
			|||
                                <del t-attf-class="#{'text-danger mr8'}" style="white-space: nowrap;" t-esc="list_price_converted" t-options="{'widget': 'monetary', 'display_currency': website_sale_order.currency_id}" /> | 
				
			|||
                            </t> | 
				
			|||
                            <span t-field="line.price_reduce_taxinc" style="white-space: nowrap;" t-options="{'widget': 'monetary', 'display_currency': website_sale_order.currency_id}" groups="account.group_show_line_subtotals_tax_included" /> | 
				
			|||
                        </td> | 
				
			|||
                        <td class="td-action"> | 
				
			|||
                            <a href='#' aria-label="Remove from cart" title="Remove from cart" class='js_delete_product no-decoration'> <small><i class='fa fa-trash-o'></i></small></a> | 
				
			|||
                        </td> | 
				
			|||
                    </tr> | 
				
			|||
                </t> | 
				
			|||
            </tbody> | 
				
			|||
        </table> | 
				
			|||
 | 
				
			|||
    </template> | 
				
			|||
</odoo> | 
				
			|||
					Loading…
					
					
				
		Reference in new issue