- Posts: 251
- Thank you received: 2
Add custom field to PDF invoice
11 years 1 week ago #215353
by Nello
Add custom field to PDF invoice was created by Nello
-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.3
Hi,
I created a custom field to get VAT number from my client. It appears correctly in the registration form and also in the order's administration, but it not appear in the PDF invoice within the invoice address and shipping address.
How can i add this field?
Thank you so much.
-- Joomla version -- : 3.4.3
Hi,
I created a custom field to get VAT number from my client. It appears correctly in the registration form and also in the order's administration, but it not appear in the PDF invoice within the invoice address and shipping address.
How can i add this field?
Thank you so much.
Please Log in or Create an account to join the conversation.
11 years 1 week ago #215355
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Add custom field to PDF invoice
Hi,
To customize the PDF invoice, you need to modify directly the plugin or create an internal file for override.
See : www.hikashop.com/forum/4-how-to/879392-t...f-plugin.html#214817
Regards,
To customize the PDF invoice, you need to modify directly the plugin or create an internal file for override.
See : www.hikashop.com/forum/4-how-to/879392-t...f-plugin.html#214817
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
The following user(s) said Thank You: Nello
Please Log in or Create an account to join the conversation.
11 years 1 week ago #215416
by Nello
Replied by Nello on topic Add custom field to PDF invoice
Hi,
i'm sorry but I don't know how to get the value of field "address_vat" from the table "address" in the invoice.php file.
i'm sorry but I don't know how to get the value of field "address_vat" from the table "address" in the invoice.php file.
Please Log in or Create an account to join the conversation.
11 years 1 week ago #215418
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Add custom field to PDF invoice
Hi,
It looks like you managed to do that:
www.hikashop.com/forum/4-how-to/9505-pdf...html?start=20#215417
Regards,
It looks like you managed to do that:
www.hikashop.com/forum/4-how-to/9505-pdf...html?start=20#215417
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
The following user(s) said Thank You: Nello
Please Log in or Create an account to join the conversation.
11 years 1 week ago - 11 years 1 week ago #215467
by Nello
Replied by Nello on topic Add custom field to PDF invoice
I solved editing the plugin invoice.php as below
So, I can have all the fiscal fields needed in my invoice, but not in the shipping note.
Thank you.
Code:
<table class="addresses">
<tr>
<?php
$addresses = array('billing_address','shipping_address');
foreach($addresses as $oneAddress){
if(empty($order->$oneAddress)) continue;
if ($oneAddress=='shipping_address' && empty($pluginsShipping)) continue; ?>
<td valign="top">
<fieldset>
<legend><?php echo JText::_('HIKASHOP_'.strtoupper($oneAddress)); ?></legend>
<?php
if(!empty($order->$oneAddress->address_company)) echo $order->$oneAddress->address_company.'<br/>';
echo $order->$oneAddress->address_title.' '.$order->$oneAddress->address_firstname.' '.$order->$oneAddress->address_lastname.'<br/>';
echo $order->$oneAddress->address_street.'<br/>';
echo $order->$oneAddress->address_post_code.' '.$order->$oneAddress->address_city.' '.$order->$oneAddress->address_state.'<br/>';
echo $order->$oneAddress->address_country.'<br/>';
if(!empty($order->$oneAddress->address_telephone)) echo JText::sprintf('TELEPHONE_IN_ADDRESS',$order->$oneAddress->address_telephone).'<br/>';
if(!empty($order->$oneAddress->address_vat)) echo JText::_('VAT_NUMBER').' : '.$order->$oneAddress->address_vat.'<br/>';
?>
</fieldset>
</td>
<?php } ?>
</tr>
</table>
Thank you.
Last edit: 11 years 1 week ago by Jerome. Reason: [code] is nice
Please Log in or Create an account to join the conversation.
Time to create page: 0.202 seconds