VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: Murad on December 22, 2020, 13:11:24 PM

Title: PDF invoice Editing issue
Post by: Murad on December 22, 2020, 13:11:24 PM
I need to Removed Following Text from PDF invoice.

From Header
{Vm: vendor name}
{Vm: vendor address}

From Footer
{vm: vendorlegalinfo}
Page {vm: pagenum} / {vm: pagecount}

I already done many changes in Invoice, mail invoice and removed these code. but in PDF when someone receive it, it is still here
and Yes I deleted old all invoices here 'administrator/components/com_virtuemart/secret_folder/invoices"  to Generate new PDF invoices , but in first time its looking fine. but after some time these text are again appeared


Title: Re: PDF invoice Editing issue
Post by: jenkinhill on December 22, 2020, 13:16:05 PM
Have you edited them on the Shop  Invoices/Emails  tab?
Title: Re: PDF invoice Editing issue
Post by: Murad on December 22, 2020, 13:28:23 PM
Yes i Removed it from header and footer boxes but it is still showing in pdf invoices
Title: Re: PDF invoice Editing issue
Post by: Jörgen on December 22, 2020, 13:43:56 PM
Insert some random text. Just to make sure you are editing the right template.

Jörgen @ Kreativ Fotografi
Title: Re: PDF invoice Editing issue
Post by: Murad on December 22, 2020, 14:00:01 PM
Yes I already edit tmpl files here /web/components/com_virtuemart/views/invoice  and its working when I delete old invoices
but customers received email with not changing of these texts. I changed other text and customized the invoice with some table borders but these shourtcode has not effect
Title: Re: PDF invoice Editing issue
Post by: Jörgen on December 22, 2020, 14:25:31 PM
You can not add just any advanced HTML in the PDF invoice. The PDF compiler does not like it. But removing the place holders should work. It is a bit unclear, in the images you show they are still there.

Jörgen
Title: Re: PDF invoice Editing issue
Post by: Murad on December 22, 2020, 14:34:00 PM
can you confirm the exact code from where I edit the these text in tmpl files
Title: Re: PDF invoice Editing issue
Post by: Jörgen on December 22, 2020, 15:22:54 PM
Have You checked in the VM configuration ? There You edit header and footer. No file to edit.

Jörgen
Title: Re: PDF invoice Editing issue
Post by: Murad on December 22, 2020, 17:04:29 PM
You mean in Shop > Invoices/Emails header and footer setting ?
when I disable the header and footer its work correct but there is one more problem that logo is also hide
Title: Re: PDF invoice Editing issue
Post by: GJC Web Design on December 22, 2020, 19:48:20 PM
in an over ride for \components\com_virtuemart\views\invoice\tmpl\invoice.php you can just remove the dynamic stuff and hard code your logo  ( use full path)

<?php //echo $this->replaceVendorFields($this->vendor->vendor_letter_header_html, $this->vendor); ?>
replace with your logo

and

  //echo $this->replaceVendorFields($this->vendor->vendor_letter_footer_html, $this->vendor);
Title: Re: PDF invoice Editing issue
Post by: Jörgen on December 22, 2020, 20:12:04 PM
You have two choses. Either DELETE the placeholder You do not want to be shown, it is a kind of WYSIWYG editor or You do as John sais, override the dynamic stuff.

Jörgen @ Kreativ Fotografi
Title: Re: PDF invoice Editing issue
Post by: GJC Web Design on December 22, 2020, 22:08:22 PM
QuoteDELETE the placeholder

maybe if u delete everything in the editor fields the "default" values are then saved?  Which is why they re-appear the next time the shop is saved?
Just a thought...
Title: Re: PDF invoice Editing issue
Post by: Murad on December 23, 2020, 10:15:15 AM
Quote from: Jörgen on December 22, 2020, 20:12:04 PM
You have two choses. Either DELETE the placeholder You do not want to be shown, it is a kind of WYSIWYG editor or You do as John sais, override the dynamic stuff.

Jörgen @ Kreativ Fotografi

Yes I already was comment this code and now I change it with logo, the logo is working fine and showing without {Vm: vendor name} in shop.
but in email it is still appear, please check attachment.

I  removed  {Vm: vendor name} in editor filed change with dummy text . the dummy text in appear in shop invoices and in pdf , but in email it is still show {Vm: vendor name}  ;D
Title: Re: PDF invoice Editing issue
Post by: Jörgen on December 23, 2020, 10:23:28 AM
This must come from Your overrides, check your template files. These are not stock VM template files.

Jörgen
Title: Re: PDF invoice Editing issue
Post by: Murad on December 23, 2020, 10:47:44 AM
Quote from: Jörgen on December 23, 2020, 10:23:28 AM
This must come from Your overrides, check your template files. These are not stock VM template files.

Jörgen

Yes I also created and moved Override file myself in template files here  "/web/templates/sparky_framework/html/com_virtuemart/invoice" and changed there are many codes and its working fine
but now for testing I also modified the code  here "/web/components/com_virtuemart/views/invoice/tmpl/"
but the same result the pdf invoice is working in shop backend but in email it is still show the text
I also delete pdf files from here every time to see latest result
/web/administrator/components/com_virtuemart/secretcode/invoices
Title: Re: PDF invoice Editing issue
Post by: Jörgen on December 23, 2020, 12:25:48 PM
You must have missed something, code does not behave as ghosts that come back to haunt you. There is one possibility left, rename the original VM template files that you have overridden, just to make sure that the correct files are used. At best it will work, or you will get a error notice at worst the code comes from another hard coded source.

Jörgen @ Kreativ Fotografi
Title: Re: PDF invoice Editing issue
Post by: Murad on December 28, 2020, 16:49:22 PM
I  rename all files in invoice template "components/com_virtuemart/views/invoice/tmpl"
but there is no error when I download the invoice pdf so I think the editing of this invoice of pdf files is in different  location.
can someone Explain me where to edit the following invoice pdf file in coding
Title: Re: PDF invoice Editing issue
Post by: GJC Web Design on December 28, 2020, 17:46:34 PM
In your template?????

templates/YOUR_TEMPLATE/html/com_virtuemart/invoices

some templates add their own paths in some other folder like /layout or /different_folder_just_to_f_u_off
Title: Re: PDF invoice Editing issue
Post by: Murad on January 04, 2021, 16:40:32 PM
Currently I am working on Orignal Vm files
all other tmpl files print and delivery note working fine with no Vendor name Text but in invoice PDF file  has still vendor name and address filed.
Title: Re: PDF invoice Editing issue
Post by: Murad on January 05, 2021, 05:49:25 AM
Finally I Solved the problem with editing of vm vendor table in database here was the both text vm vendor name and address and I removed it
for here. :)

<h1><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">{Vm: vendor name}</span></span></h1>
<p><span style="vertical-align: inherit;"><span style="vertical-align: inherit;">{Vm: vendor address}</span></span></p>