News:

Support the VirtueMart project and become a member

Main Menu

Auto-increment number counter in PDF?

Started by mailblade, April 10, 2019, 10:08:02 AM

Previous topic - Next topic

mailblade

I would like to add an auto-increment number counter which will appear in the invoice PDF.

If I have 20 rows of items in the invoice, there should be a counter next to the first column starting with "1" all the way up to the amount of items I have in the order.

I know how to add this in a normal table, but I'm a bit confused using the VM layout.

Thanks

AH

The invoice items are displayed using this template.

Create a template override for \components\com_virtuemart\views\invoice\tmpl\invoice_items.php

Write a simple counter increment and show the value in the display line.

Find the line display:

foreach($this->orderDetails['items'] as $item) {

You may want to adjust or add a new header to the table display.

Regards
A

Joomla 4.4.5
php 8.1

mailblade

Thank you AH!

That was the line I was looking for!  :D Problem solved :)

AH

Regards
A

Joomla 4.4.5
php 8.1