Invoice PDF Layout

  • Posts: 159
  • Thank you received: 2
8 years 2 months ago #250887

-- HikaShop version -- : 2.6.4
-- Joomla version -- : 3.6.2

Hi,
I'm using the invice plugin and have a few questions:

1. How can I show a logo? I searched the forum and there where some posts referring to it, but none of them showed the steps to where to put the code.

2. How to show the order number with the right label? I copied in plugins/hikashop/attachinvoice/attachinvoice/invoice.php this string:

<div class="date"><?php echo $number.$order->order_invoice_number; ?></div>

and changed it to this by guessing 'order_number' would be correct.

<div class="date"><?php echo $number.$order->order_number; ?></div>

It shows the order number, but labeled it with 'Invoice Number', because I don't know the right string here. Could you please help me with that?

3. The invoice shows all data in English. How can I switch this to German? It's a multi lingual site, but I need a German invoice for the financial department.

Thanks
Roger

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
8 years 2 months ago #250888

Hi,

1. In the file plugins/hikashop/attachinvoice/attachinvoice/invoice.php add the HTML tag of your logo image:

<img src="http://mywebsite.com/my/image/file.jpg" />

2. Then use instead:
<div class="date">Order number: <?php echo $order->order_number; ?></div>

3. The language will be in the language of the customer. If you don't want that, you can remove the line:
$orderClass->loadLocale($order);
in the file plugins/hikashop/attachinvoice/attachinvoice.php and that will display the PDF in the current language when you click on the "invoice" button in the backend or frontend.

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

  • Posts: 159
  • Thank you received: 2
8 years 1 month ago #251004

Hi Nicolas,
Thanks for your help.

1. The logo works perfect.

2. The code did the job:

<div class="date">Order number: <?php echo $order->order_number; ?></div>

The only thing is the language for 'Order number'. If I put it in like this, it will always be in English. How can I make this switchable?

3. It's ok, if the client gets the invoice in his language. Only in the backend I need to export all invoices in German. The backend is switched to German language, but the invoices are all in English. What can I do here?

Thanks
Roger

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
8 years 1 month ago #251038

Hi,

2. You can do like that:
<div class="date"><?php echo JText::_('ORDER_NUMBER').': '.$order->order_number; ?></div>

3. Did you try the modification I talked about in my previous message ? That should actually do what you want.

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

  • Posts: 159
  • Thank you received: 2
8 years 1 month ago #251053

Hi Nicolas,
thanks that works. I need to have two more infos on the invoice:

1. The client ID should be shown in the section where the order number is:

<div class="date"><?php echo $number.$order->order_invoice_number; ?></div>
<div class="date"><?php echo JText::_('ORDER_NUMBER').': '.$order->order_number; ?></div>
<div class="date"><?php echo JText::_('DATE').': '.hikashop_getDate($order->order_invoice_created,'%d %B %Y');?></div>

Could you help me with the string, please?

2. In the table where the products are listed, I need to show the article number and a position number (when there are 10 products on the invoice the first column should be labelled 'Pos.' with number from 1 to 10).

I guess this is the Table to edit, but I don't no the tags for the article numbers and how to get the position numbers in place.

<table class="products">
<tr class="products_title">
<th style="width:300px">
<?php echo JText::_('PRODUCT'); ?>
</th>
<?php if(!$this->shipping_invoice){ ?>
<th style="width:100px" class="price">
<?php echo JText::_('UNIT_PRICE'); ?>
</th>
<?php } ?>
<th style="width:80px" class="price">
<?php echo JText::_('PRODUCT_QUANTITY'); ?>
</th>
<?php if(!$this->shipping_invoice){ ?>
<th style="width:100px" class="price">
<?php echo JText::_('PRICE'); ?>
</th>
<?php } ?>
</tr>

Thanks
Roger

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
8 years 1 month ago #251071

Hi,

1. Something like that:

<?php echo $order->customer->user_id; ?>

2. You need to add a counter in the foreach loop on the products and the necessary HTML tag for a new column. Nothing complex if you know a bit about programming. Please understand that we can't personnalize everything for you. That's not what user support is about. If you need someone to customize that for you, I would recommend you contact our partners:
www.hikashop.com/home/our-partners.html

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

  • Posts: 159
  • Thank you received: 2
8 years 1 month ago #251407

Hi Nicolas,

1. Thanks for the string. I show the client ID, invoice number, order number and date in the Language of the customer with the following code:

<div class="date"><?php echo JText::_('CUSTOMER').': '.$order->customer->user_id; ?></div>
<div class="date"><?php echo JText::_('INVOICE_NUMBER').': '.$order->order_invoice_number; ?></div>
<div class="date"><?php echo JText::_('ORDER_NUMBER').': '.$order->order_number; ?></div>
<div class="date"><?php echo JText::_('DATE').': '.hikashop_getDate($order->order_invoice_created,'%d %B %Y');?></div>

Just in case somebody has the same issue.

2. The position number is not so important. I need the article number. Could you at least tell me how the article number is called in your code? I'm trying to figure it out myself, but had no luck...Please!

Thanks
Roger

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
8 years 1 month ago #251426

Hi,

1. Thanks !

2. Sure. It's in $product->order_product_number;

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

  • Posts: 114
  • Thank you received: 4
7 years 5 months ago #271604

Will changes in the file plugins/hikashop/attachinvoice/attachinvoice/invoice.php be overriden on each Hikashop update or is that a propper custom override?

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
7 years 5 months ago #271626

Hi,

It's not an override, so if you install the PDF invoice plugin on your website again, it will overwrite your modifications.
However, the PDF invoice plugin is not included in HikaShop, and thus, if you update HikaShop, it won't overwrite your modifications.

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

Time to create page: 0.068 seconds
Powered by Kunena Forum