How to add tariff codes next to each product in price quote PDF?

I’m trying to add tariff code (HS code) next to each item in the price quote for PDF template.

I’ve tried to add this line to the below:

“<?php echo nl2br(htmlsc($item->item_tariff)); ?>”

However i’m getting this error below:

A PHP Error was encounteredSeverity: NoticeMessage: Undefined property: stdClass::$item_tariffFilename: pdf/ANCInvoicePlane.phpLine Number: 156

         <tr>
            <td><?php _htmlsc($item->item_name); ?></td>
            <td><?php echo nl2br(htmlsc($item->item_description)); ?></td>
            <td><?php echo nl2br(htmlsc($item->item_tariff)); ?></td>
            <td class="text-right">
                <?php echo format_amount($item->item_quantity); ?>
                <?php if ($item->item_product_unit) : ?>
                    <br>
                    <small><?php _htmlsc($item->item_product_unit); ?></small>
                <?php endif; ?>
            </td>
            <td class="text-right">
                <?php echo format_currency($item->item_price); ?>
            </td>
            <?php if ($show_item_discounts) : ?>
                <td class="text-right">
                    <?php echo format_currency($item->item_discount); ?>
                </td>
            <?php endif; ?>
            <td class="text-right">
                <?php echo format_currency($item->item_total); ?>
            </td>
        </tr>

Btw I’m editing a new template. Also I checked the ip table and for tariffs: its listed like this:
‘product_tariff’ => ‘Tariff’,

So what am i doing wrong ?

Thanks

Hi @anc101 welcome to InvoicePlane, welcome to the forums.
The trick is to get that $item->item_tariff or product_tariff from the database so it’s available for the view

I don’t think it’s available by default.

What is HS code?

Thx UnderDog, HS means harmonized standart.

Actually what i want to show in price quote pdf as a value is the ones under Sumex>Tariff values under Product form.

This is a standart field.

So i thought it’d be enough to call the value by modifying the default template.

So what steps should i take exactly ? Any advice ?

Thx

Don’t want to spam but any suggestions or guides that i can follow ?

The documentation was not clear to me…

Any input greatly appreciated. Thanks.