No space between address lines
-
Hi
My invoice address does not print correctly because no space is being added between address lines 1 and address lines 2. We use you plug in to print direct on labels so this does not look good or present a clear address for the delivery.
ie. in my order I have:
Address line 1 = Flat 3
Address line 2 = 23 The High StreetThis prints as:
Flat323The High StreetPlease help
-
Hello!
I think you also created a ticket for this question in our support portal? If so please reply the ticket (i just answered). If not please let me know and we can continue here =).
Regards!
facing the same issue. can you please help with this. all the text fields are bunched up without any spacing between lines
thanks for your help
Hello!
Do you have the latest version of the plugin?
yes i have the latest version. another problem im facing is that when i click on generate invoice – 2 invoices with 2 invoice numbers are getting created.
upon clicking generate – order number 35 gets created and i can see a pdf. then when i go to mail the invoice, it shoes the invoice number as 36.
any help is much appreciated
Could you send me an screenshot of the pdf that is generated please?
Hello,
I am having the same issues as the original post. When I add a field that is just for “shipping address” its fine address line 1 and 2 are on separate lines. However when I use the “shipping (all)” for the field information the address lines 1 and 2 are on the same line. this does not happen with the “Billing (all)” just when using “Shipping (all)” for the field information.
Any help would be great. I do have the most resent version also.
Thanks,
Nick.Hello!
Yesterday i deployed an update, could you update and try again please?
Hello, thanks for the fast reply,
the update still gives the same issue. I deleted the Invoice and tried a few times changing from “shipping (all)” to “shipping (address)” and same thing, line 1 and 2 on the same line for the “Shipping (all)” and separate lines when just displaying the “Shipping (Address)”.
Just to verify WP plugins saying its Version 1.2.6 after the update.
Nick.
Oh sorry by mistake i was checking the code of the billing field instead of the shipping. The shipping field was having the same issue than the billing one. I will include the fix in the next release but if you want to fix it right away please open the file
wp-content\plugins\woo-pdf-invoice-builder\htmlgenerator\fields\subfields\ShippingSubFields\PDFShippingAll.php
And replace its content with this:
<?php namespace rnwcinv\htmlgenerator\fields\subfields\ShippingSubFields; use rnwcinv\htmlgenerator\fields\subfields\PDFSubFieldBase; class PDFShippingAll extends PDFSubFieldBase { public function FormatValue($value) { $content=''; if($this->GetBooleanValue('showCustomerName')) $this->ProcessField('CustomerName',$content); if($this->GetBooleanValue('showCompanyName')) $this->ProcessField('Company',$content); if($this->GetBooleanValue('showEmail')) $this->ProcessField('Email',$content); if($this->GetBooleanValue('showPhone')) $this->ProcessField('Phone',$content); if($this->GetBooleanValue('showAddress')) { $this->ProcessField('Address1', $content); $this->ProcessField('Address2', $content); } $this->CreateCityStateZipRow($content); if($this->GetBooleanValue('showCountry')) $this->ProcessField('Country',$content); return $content; } private function ProcessField($type, &$table) { if($this->orderValueRetriever->useTestData) $value=$this->GetTestValue($type); else $value=$this->GetValue($type); $table.=$this->CreateRow($type,$value); } private function CreateRow($type,$rowValue) { $textAlign=''; if($this->GetStringValue('labelPosition')=='left') $textAlign='text-align:right;'; $rowValue=str_replace('<br/>','',$rowValue); if($type=='Address1'||$type=='Address2') { $type.=' field_Address'; } return '<p class="field_'.$type.'" style="margin:0;padding:0;'.$textAlign.'">'.htmlspecialchars($rowValue).'</p>'; } private function GetValue($type) { switch ($type) { case 'CustomerName': return $this->orderValueRetriever->get('shipping_first_name').' '. $this->orderValueRetriever->get('shipping_last_name'); case 'Email': return $this->orderValueRetriever->get('shipping_email'); case 'Phone': return $this->orderValueRetriever->get('shipping_phone'); case 'Company': return $this->orderValueRetriever->get('shipping_company'); case 'Address': $address=$this->orderValueRetriever->get('shipping_address_1'); $address2=$this->orderValueRetriever->get('shipping_address_2'); if(strlen(trim($address2))>0) $address.="\n ".$address2; return $address; case 'Address1': return $this->orderValueRetriever->get('shipping_address_1'); case 'Address2': return $this->orderValueRetriever->get('shipping_address_2'); case 'Country': return $this->orderValueRetriever->get('shipping_country'); case 'City': return $this->orderValueRetriever->get('shipping_city'); case 'State': return $this->orderValueRetriever->get('shipping_state'); case 'Zip': return $this->orderValueRetriever->get('shipping_postcode'); } return ''; } private function GetTestValue($type) { switch ($type) { case 'CustomerName': return 'Customer Name'; case 'Email': return 'Customer@email.com'; case 'Phone': return '(555)555-555'; case 'Company': return 'Awesome Company'; case 'Address': return 'Address goes here #323'; case 'Country': return 'Country'; case 'City': return 'City'; case 'State': return 'State'; case 'Zip': return 'Zip'; } return ''; } private function CreateCityStateZipRow(&$table) { if($this->orderValueRetriever->useTestData) { $city=$this->GetTestValue('City'); $state=$this->GetTestValue('State'); $zip=$this->GetTestValue('Zip'); }else { $city=$this->GetValue('City'); $state=$this->GetValue('State'); $zip=$this->GetValue('Zip'); } $value=''; if($this->GetBooleanValue('showCity')) $value=$city; if($this->GetBooleanValue('showState')) { if (strlen($value) > 0&&strlen($state)>0) $value.=", "; $value .= $state; } if($this->GetBooleanValue('showZip')) { if (strlen($value) > 0&&strlen($zip)>0) $value.=", "; $value .= $zip; } $table.=$this->CreateRow('CityStateZip',$value); } public function GetTestFieldValue() { // TODO: Implement GetTestFieldValue() method. } public function GetWCFieldName() { // TODO: Implement GetWCFieldName() method. } }Regards!
Hello,
again thanks for a fast reply. That worked a treat, perfect. thank you very much.
regards,
Nick.
The topic ‘No space between address lines’ is closed to new replies.