VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: erwinds on March 09, 2021, 16:10:30 PM

Title: edit invoice PDF
Post by: erwinds on March 09, 2021, 16:10:30 PM
hi,

How can I change/edit the layout PDF invoice?
Or is there an Extension / template for invoices?

Best regards,
Erwin
Title: Re: edit invoice PDF
Post by: pinochico on March 09, 2021, 16:43:33 PM
You can copy PHP files for view invoice to your template as override and next edit as you wish:

components/com_virtuemart/views/invoice/tmpl/invoice_history.php
components/com_virtuemart/views/invoice/tmpl/invoice_items.php
components/com_virtuemart/views/invoice/tmpl/invoice_order.php
components/com_virtuemart/views/invoice/tmpl/invoice.php

to

templates/your_template/html/com_virtuemart/invoice/invoice_history.php
templates/your_template/html/com_virtuemart/invoice/invoice_items.php
templates/your_template/html/com_virtuemart/invoice/invoice_order.php
templates/your_template/html/com_virtuemart/invoice/invoice.php

Or you can use some apps for invoice, example - Artio VM Invoice (is not our extension)
Title: Re: edit invoice PDF
Post by: GJC Web Design on March 11, 2021, 10:58:46 AM
and only use very basic html and inline css ..  TCPDF will not accept any complex rules etc
Title: Re: edit invoice PDF
Post by: pinochico on March 11, 2021, 17:51:38 PM
to gjc:

thanks :)
Title: Re: edit invoice PDF
Post by: barbara on March 31, 2021, 21:36:29 PM
I`ve looked through all the files

components/com_virtuemart/views/invoice/tmpl/invoice_history.php
components/com_virtuemart/views/invoice/tmpl/invoice_items.php
components/com_virtuemart/views/invoice/tmpl/invoice_order.php
components/com_virtuemart/views/invoice/tmpl/invoice.php

trying to edit the layout of the ship to area and I dont see it

I see eg 'COM_VIRTUEMART_ORDER_PRINT_SHIPMENT_LBL' - and this code

<?php echo vmText::_('COM_VIRTUEMART_ORDER_PRINT_SHIP_TO_LBL'?></strong><br/>
<?php if(!empty($this->orderDetails['details']['has_ST'])){
echo "<table border='0'>";
foreach ($this->shipmentfields['fields'] as $field) {
if (!empty($field['value'])) {


but that is not helpful

I am trying to get the ship-to layout to be instead of the current layout


Address Nickname              shipafolaqbi
First Name                        john
Last Name                        David
Address                            16151 Blue Belle Dr
City Center                        Valley
State / Province / Region    Pennsylvania
Zip / Postal Code                18034
Country                             United States
Phone                               6049891206

to something like

shipafolaqbi
john David
16151 Blue Belle Dr
Center Valley, pa
18034
United States
6049891206


any help would be greatly appreciated
Title: Re: edit invoice PDF
Post by: pinochico on April 01, 2021, 03:05:12 AM
Quoteany help would be greatly appreciated

basic knowledge about PHP and work with

$this->shipmentfields['fields']

in foreach

you can split some value together or move up/down.

That is all - or find on forum, I definitelly know, this problem was solved in past.
Title: Re: edit invoice PDF
Post by: GJC Web Design on April 01, 2021, 10:30:05 AM
just get rid of the

<td class="key">' . $field['title'] . '</td>'

part
Title: Re: edit invoice PDF
Post by: Jörgen on April 01, 2021, 11:32:59 AM
You have to combine gjc and Pinochicos answers. That is of typ sent när and surname on the same line.

Jörgen @ Kreativ Fotografi