Skip to main content

Add custom field to PDF invoice

More
11 years 1 week ago #215353 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.

Please Log in or Create an account to join the conversation.

More
11 years 1 week ago #215355 by Jerome
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,

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.

More
11 years 1 week ago #215416 by Nello
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.

Please Log in or Create an account to join the conversation.

More
11 years 1 week ago #215418 by Jerome
Hi,

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.

More
11 years 1 week ago - 11 years 1 week ago #215467 by Nello
I solved editing the plugin invoice.php as below
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>
So, I can have all the fiscal fields needed in my invoice, but not in the shipping note.

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
Powered by Kunena Forum