Hi @ComGrafPL
There's nothing wrong with that.
You're a programmer and you can't handle such a simple task 🙂
All you have to do is create ./override/classes/pdf/HTMLTemplateInvoice.php and add your own function to show/hide parts of the address.
For example PrestaShop 8.x:
public function customInvoiceAddress( $address, $showCompany = true, $showLastname = false, $showFirstname = false, $showAddress1 = true, $showAddress2 = true, $showPostcode = true, $showCity = true, $showOther = false, $showPhone = false, $showPhoneMobile = false, $showDniNumber = false, $showVatNumber = false, $showCountry = true ) { if ($showLastname == false) { unset($address->lastname); } if ($showFirstname == false) { unset($address->firstname); } if ($showCompany == false) { unset($address->company); } if ($showVatNumber == false) { unset($address->vat_number); } if ($showDniNumber == false) { unset($address->dni); } if ($showAddress1 == false) { unset($address->address1); } if ($showAddress2 == false) { unset($address->address2); } if ($showPostcode == false) { unset($address->postcode); } if ($showCity == false) { unset($address->city); } if ($showOther == false) { unset($address->other); } if ($showPhone == false) { unset($address->phone); } if ($showPhoneMobile == false) { unset($address->phone_mobile); } if ($address) { return $address; } }
Â
and you copy the getContent() function from the original and change $formatted_invoice_address:
$formatted_invoice_address = AddressFormat::generateAddress( $this->customInvoiceAddress($invoice_address, true, false, false, true, false, true, true, false, false, false, false, true, true), $invoiceAddressPatternRules, '<br />', ' ' );
Â
Similarly, you can change the delivery address, or change the first function.
Â
Full override file PrestaShop 8.x (after override Clear cache):