- Posts: 43
- Thank you received: 0
Customisation of PDF Invoice
11 years 2 months ago #209241
by DavidThor
Customisation of PDF Invoice was created 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
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.
11 years 2 months ago #209247
by nicolas
Replied by nicolas on topic Customisation of PDF Invoice
Hi,
As you can see in the invoice.php file, the data of the order is stored in the $order variable. So instead of:
you want to use:
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;
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.
11 years 2 months ago #209267
by DavidThor
Replied by DavidThor on topic Customisation of PDF Invoice
Hi,
Tried, but still doesn't work. Any other idea?
//David
Tried, but still doesn't work. Any other idea?
//David
Please Log in or Create an account to join the conversation.
11 years 2 months ago #209303
by nicolas
Replied by nicolas on topic Customisation of PDF Invoice
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 ?
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.
11 years 2 months ago - 11 years 2 months ago #209347
by DavidThor
Replied by DavidThor on topic Customisation of PDF Invoice
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
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.
11 years 2 months ago #209370
by nicolas
Replied by nicolas on topic Customisation of PDF Invoice
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
$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.
11 years 2 months ago #209388
by DavidThor
Replied by DavidThor on topic Customisation of PDF Invoice
Thanks! Perfect!
Please Log in or Create an account to join the conversation.
Time to create page: 0.198 seconds