<?xml version="1.0" encoding="UTF-8" ?>
<!--Copyright 2021 Criptomart <https://criptomart.net> -->
<templates id="template" xml:space="preserve">
    <t t-extend="Product">
        <t t-jquery=".product-name" t-operation="after">
<!--            <t t-if="widget.pos.config.show_format &amp;&amp; product.type == 'product'"> -->
                <span t-attf-class="format" >
                    <t t-esc="product.formato" />
                </span>
            </t>
<!--        </t> -->
    </t>

    <t t-extend="Orderline">
<!--        <t t-jquery=".product-name" t-operation="after">
                <span t-attf-class="format" >
                    <t t-esc="product.formato" />
                </span>
        </t> -->
        <t t-jquery=".product-name" t-operation="after">
<!--        <t t-if="widget.pos.config.show_format &amp;&amp; line.get_product().type == 'product'" > -->
                <div t-attf-class="format" >
                    <t t-esc="line.get_product().formato" />
                </div>
<!--        </t> -->
        </t>
    </t>

    <t t-name="ProductNoImage">
        <article class='product' t-att-data-product-id="product.id" tabindex="0" t-attf-aria-labelledby="article_product_#{product.id}">
            <t t-set="name_length" t-value="product.display_name.length" />
            <t t-if='widget.pos.config.iface_fixed_font_size'>
                <t t-set="font_size" t-value="widget.pos.config.iface_fixed_font_size" />
            </t>
            <t t-else="">
                <t t-set="font_size" t-value="
                    name_length >=120 and 11
                    or name_length >=90 and 12
                    or name_length >=60 and 13
                    or name_length>=50 and 14
                    or name_length>=40 and 16
                    or 20"/>
            </t>
            <div class="product-img-without-image">
                <t t-if="!product.to_weight">
                    <span class="price-tag">
                        <t t-esc="widget.format_currency(product.get_price(pricelist, 1),'Product Price')"/>
                    </span>
                </t>
                <t t-if="product.to_weight">
                    <span class="price-tag">
                        <t t-esc="widget.format_currency(product.get_price(pricelist, 1),'Product Price')+'/'+widget.pos.units_by_id[product.uom_id[0]].name"/>
                    </span>
                </t>
                <t t-if="product.formato">
                    <span class="format">
                        <t t-esc="product.formato"/>
                    </span>
                </t>
            </div>
            <div class="product-name-without-image" t-attf-id="article_product_#{product.id}" t-attf-style="font-size: #{font_size}px !important; line-height: #{font_size}px !important;">
                <t t-esc="product.display_name"/>
            </div>
        </article>
    </t>

</templates>


