Custom Invoice Layout

  • Posts: 38
  • Thank you received: 1
13 years 1 month ago #32563

Hello, I need to completely modify the invoice layout to satisfy my client's needs. (I will be creating an "MYOB" style standard invoice).

1) Which folder keeps the files I can edit for the invoice layout (for the email and web versions if they are separate).

2) Are there some other invoice templates availabile? Even if not officially, I am happy to use anything one of you have done as an example. I expect to spend a lot of time on this.
Thanks,

Michael A.

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

  • Posts: 83103
  • Thank you received: 13415
  • MODERATOR
13 years 1 month ago #32594

Hi,

You can edit the file "invoice" of the view "order" (for the invoice available on the backend) and the file "show" of the view "order" (for the invoice available on the front end in commercial editions) via the menu Display->Views.
The corresponding files are administrator/components/com_hikashop/views/order/tmpl/invoice.php and components/com_hikashop/views/order/tmpl/show.php
For the Emails, you can edit them via the menu System->Emails in the Business edition. The files of emails are located in the folder media/com_hikashop/mail but we recommend, like for views, to edit them via the interface so that you don't loose your changes when you update HikaShop.

We didn't had anyone sharing such templates so far but it would be a nice thing indeed :)

The following user(s) said Thank You: doitsolutions

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

  • Posts: 38
  • Thank you received: 1
13 years 1 month ago #32646

That sounds like exactly what I need to know, thanks so much for your help.

In the mean time, if anyone else would like to share some of their invoice editing achievements please do here.
Thanks,

Michael A.

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

  • Posts: 38
  • Thank you received: 1
12 years 11 months ago #37774

Hello,

Although I have been able to edit the front end order / invoice, I have not been able to edit the "print friendly" version of it. When I click on the "print" button while viewing an order on the front end, it seems to bring up the "invoice" template. However even when I completely blank out the "invoice" (order - invoice) php file using the editor (display / views) it still shows up. If it is not the "order - show" or "order - invoice" file, where else is this copy of the old default template?
While we are at it, please let me know if there is anywhere else I should be checking for any form of an invoice template. I need to change all existing invoice / order templates completely, anywhere an order or invoice shows needs to show with my customised layout.

2) Also, just wondering if there is an option to email the invoice as an attachment (pdf for eg.)

Thanks,

Michael A.


EDIT:
I should point out that I have read in other forum posts that this print view is changed when the "order - invoice" file is changed. I have tried changing that file (for all templates just to be safe) and it does not change a thing (except for the invoice that is viewed from the backend). Any ideas?

Last edit: 12 years 11 months ago by doitsolutions.

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

  • Posts: 83103
  • Thank you received: 13415
  • MODERATOR
12 years 11 months ago #37908

Hi,

The order/invoice view file is indeed for the back end invoice only. For the front end invoice, it's the view file order/show that you want to edit. Please make sure that you're editing the one of your front end template and not another template, otherwise it won't do anything.

there is no possibility for now to attach a PDF to the emails.

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

  • Posts: 38
  • Thank you received: 1
12 years 11 months ago #37952

The front end invoice / order is working fine. Are you saying that when I click on the "Print" button the resulting "print friendly" invoice is also created by the code in the "order - show" file? I can not seem to find where in that file the section is that dictates what will show on the print friendly version of the invoice.
Thanks,

Michael A.

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

  • Posts: 83103
  • Thank you received: 13415
  • MODERATOR
12 years 11 months ago #38062

That's indeed the case. On the front end, both the printed version and the order details page are displayed by the same view.

What dictates the "mode" of display in the variable $this->invoice_type. You can see many checks on it in that view file.

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

  • Posts: 38
  • Thank you received: 1
12 years 11 months ago #38528

Hello again,

I am really trying to use your answer to solve my problem.

What dictates the "mode" of display in the variable $this->invoice_type You can see many checks on it in that view file.


I can not see where in that view / file it contains any print version sections.

Here are the "checks", None of them seem to imply that the section should show on the "print friendly" printed version or not. Am I missing something?

L13) if($this->invoice_type=='order'){
L45) if($this->invoice_type!='order'){
L58) if($this->invoice_type=='order'){
L61) echo JText::_(strtoupper($this->invoice_type));
L139) if($this->invoice_type=='order' && $files){
L169) if($this->invoice_type=='order' && !empty($product->product_id)){
L174) if($this->invoice_type=='order' && !empty($product->product_id)){
L203) if($this->invoice_type=='order' && !empty($product->files)){

If it checked something like "if($this->invoice_type=='print_order'" I would see what you mean without a doubt.
Are you sure we are talking about the same thing? (the print-friendly version of the front end order/invoice that prints out when the "print" button is pressed.

Thanks,

Michael A.

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

  • Posts: 38
  • Thank you received: 1
12 years 11 months ago #38530

OK,

I have now figured out that this means print version:
$this->invoice_type!='order'

and this means normal on screen version:
$this->invoice_type=='order'

One last problem.
The print version shows none of the images in my template (div backgrounds etc). How can I stop the system from stripping out images in the print friendly version? I want customers to print out invoices that still have our logo on them.
Thanks,

Michael A.

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

  • Posts: 83103
  • Thank you received: 13415
  • MODERATOR
12 years 11 months ago #38648

The goal of the printed version IS to not display the template around the invoice.
Otherwise, the users could just print the order details page to get the exact same thing.

To add your logo on invoices, what you can do is to add it in the "store address" option of the configuration with an img HTML tag. If you don't use the latest version, you will have to update in order to do that.

Last edit: 12 years 11 months ago by nicolas.

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

  • Posts: 38
  • Thank you received: 1
12 years 11 months ago #38665

Actually the point of the "print" button should normally be to print out a document without the website menu / header / footer etc. I'll try making the images IMG tags instead of div backgrounds. Otherwise the store address img tag trick will be the next thing I try.

I appreciate your help with this, I'm sure this post will help others also.
Cheers,

Michael A.

The following user(s) said Thank You: woonydanny

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

Time to create page: 0.070 seconds
Powered by Kunena Forum