Skip to main content

Customisation of PDF Invoice

More
11 years 2 months ago #209241 by DavidThor
-- HikaShop version -- : 2.5.0

Hi,

I'm trying to add bank account information to the attached PDF Invoice, but the 'echo $payment->payment_params->information;' is not adding the information to the invoice. I have the same line in the Order Creation Notification Email and that works just fine. I've also tried to replace the last echo line with the second code block below, but that doesn't work either.

Any idea where I'm going wrong?

Thanks,
David

Code:
<?php if(!isset($order->order_invoice_number)) $order->order_invoice_number = $order->order_number; echo JText::_('DATE').': '.hikashop_getDate($order->order_created,'%d %B %Y ').'<br />'; echo JText::_('INVOICE').': '.$order->order_invoice_number.'<br />'; echo JText::_('ORDER_NUMBER').': '.$order->order_number.'<br />'; if (!empty($pluginsShipping)) echo JText::_('HIKASHOP_SHIPPING_METHOD').': '.$pluginsShipping->getName($order->order_shipping_method, $order->order_shipping_id).'<br />' ; if(!empty($pluginsPayment)) echo JText::_('HIKASHOP_PAYMENT_METHOD').': '.$pluginsPayment->getName($order->order_payment_method, $order->order_payment_id).'<br /><br />'; echo $payment->payment_params->information; ?>

Code:
$paymentClass = hikashop_get('class.payment'); $payment = $paymentClass->get($data->order_payment_id); $payment->payment_params = unserialize($payment->payment_params); echo $payment->payment_params->information;

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

More
11 years 2 months ago #209247 by nicolas
Hi,

As you can see in the invoice.php file, the data of the order is stored in the $order variable. So instead of:
Code:
$paymentClass = hikashop_get('class.payment'); $payment = $paymentClass->get($data->order_payment_id); $payment->payment_params = unserialize($payment->payment_params); echo $payment->payment_params->information;
you want to use:
Code:
$paymentClass = hikashop_get('class.payment'); $payment = $paymentClass->get($order->order_payment_id); $payment->payment_params = unserialize($payment->payment_params); echo $payment->payment_params->information;

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

More
11 years 2 months ago #209267 by DavidThor
Hi,

Tried, but still doesn't work. Any other idea?

//David

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

More
11 years 2 months ago #209303 by nicolas
Hi,

I don't see why that would work.
It must come from the way you added it to the invoice.
could you provide the code with a few lines before and after so that we can see where you put it in your invoice.php file ?

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

More
11 years 2 months ago - 11 years 2 months ago #209347 by DavidThor
Thanks!

Full code below. Essentially the same as the original. I'm not sure if it makes any difference, but I'm using Hika Market as well.

//David

Code:
Code removed by a moderator
Last edit: 11 years 2 months ago by Jerome.

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

More
11 years 2 months ago #209370 by nicolas
Try with that code instead:
$paymentClass = hikashop_get('class.payment');
$payment = $paymentClass->get($order->order_payment_id);
echo $payment->payment_params->information;

I've tested it on my end and it works fine:
take.ms/9QGD9
The following user(s) said Thank You: DavidThor

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

More
11 years 2 months ago #209388 by DavidThor
Thanks! Perfect!

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

Time to create page: 0.198 seconds
Powered by Kunena Forum