Re: Automatic attaching invoices

  • Posts: 7
  • Thank you received: 0
12 years 3 months ago #61642

Hi,

is there a possibility to send out the invoice as a PDF upon order creation without any manual adjustment of the order? I already tried changing the default order status to paid, but it just send out the email without the attachment.

Cheers,

JJ

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
12 years 3 months ago #61660

Hi,

You can do that with the PDF Invoice plugin:
www.hikashop.com/en/component/hikashop/product/cid-18.html

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

  • Posts: 7
  • Thank you received: 0
12 years 3 months ago #61661

yes... I bought this plugin. And I'm receiving the email. But only after manual adjustment. Can I send it automatically upon order creation?

Cheers,

JJ

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
12 years 3 months ago #61807

Hi,

The PDF invoice is attached to the order confirmation notification (when the order is paid).
It is not attached to the order creation notification (when the order is created).

Normally, the order should change automatically from created to confirmed when the payment gateway sends the payment notification to HikaShop.
Isn't that the case on your website ?

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

  • Posts: 7
  • Thank you received: 0
12 years 3 months ago #61825

Yes, that right. But we are using Bank transfer as payment method and would like to send an invoice upon order creation. Is there any way to do this?

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
12 years 3 months ago #61949

Hi,

Can you try to replace the line:
if(empty($data->mail_name) || empty($data->data->order_status) || $data->mail_name != 'order_status_notification' || $data->data->order_status != 'confirmed') return;
by the line:
if(empty($data->mail_name) || empty($data->data->order_status) || !in_array($data->mail_name,array('order_status_notification','order_creation_notification')) || $data->data->order_status != 'confirmed') return;

in the file plugins/hikashop/attachinvoice/attachinvoice.php ?
That should allow that.

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

  • Posts: 7
  • Thank you received: 0
12 years 3 months ago #62174

Thanks for your help.

I did that.... unfortunatly it doesn't work. No email is attached to the order creation email. If I change the status to confirmed/paid I get the email wtih attachment. So there is no real change.

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
12 years 3 months ago #62180

Yes, that change will only attach the invoice to the email if the status of the order is confirmed when the order is created.

If you want it to always include the invoice then use that line instead:
if(empty($data->mail_name) || empty($data->data->order_status) || !in_array($data->mail_name,array('order_status_notification','order_creation_notification'))) return;

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

  • Posts: 7
  • Thank you received: 0
12 years 3 months ago #62196

Works fine!!!

Thank you very much for your support :)

Cheers!

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

  • Posts: 7
  • Thank you received: 0
12 years 3 months ago #62308

Hi nicolas,

another question: Are the generated PDFs stored somewhere? or can I add a CC or BCC adress somewhere?

Cheers!

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
12 years 3 months ago #62428

They are not stored.

There is no option to add a CC or BCC.
However, you can get the email yourself with such modification:
www.hikashop.com/en/forum/4-how-to/23622...multiple-people.html

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

  • Posts: 246
  • Thank you received: 9
  • Hikashop Business Hikashop Essential
11 years 5 months ago #108052

I just bought and installed the PDF (attachinvoice) but when I change order to confirmed I get this error message:

TCPDF ERROR: Unable to create output file: /home/xxxxxx/domains/xxxxxxx.com/public_html/plugins/hikashop/attachinvoice/attachinvoice/invoices/Factuur-148_1370588576.pdf

What should I do now?


Solved: I set the folder to 777 instead of 755.

However now I get an ugly invoice. Not as the adjusted invoice file I made. How can I change this invoice to make it look more like the corporate image of client??


I'll keep on trying!
Last edit: 11 years 5 months ago by gasoline.

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

  • Posts: 13201
  • Thank you received: 2322
11 years 5 months ago #108094

Hi,

To edit the template of the invoice, you have to edit the file "attachinvoice/invoice.php" in the plugin hikashop > attachinvoice.

You can also create a view override: "media/com_hikashop/plugins/invoice.php".

Regards,

Last edit: 11 years 5 months ago by Jerome.

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

  • Posts: 246
  • Thank you received: 9
  • Hikashop Business Hikashop Essential
11 years 5 months ago #108183

I have another question. The invoice (in Dutch Factuur) is attached to email. Works like a charme. However, he names the PDF Factuur.pdf. But I want it like this, Factuur0023.pdf. So including invoice number. is that possible?


I'll keep on trying!

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

  • Posts: 26159
  • Thank you received: 4028
  • MODERATOR
11 years 5 months ago #108240

Hi,

It requires a modification in the plugin "attachinvoice".
By replacing the line:

$mailer->AddAttachment($invoiceFolder.DS.$invoiceFile,JText::_('INVOICE').'.pdf');
By
$mailer->AddAttachment($invoiceFolder.DS.$invoiceFile,JText::_('INVOICE').str_pad($orderId, 4, "0", STR_PAD_LEFT).'.pdf');

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: gasoline

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

  • Posts: 246
  • Thank you received: 9
  • Hikashop Business Hikashop Essential
11 years 5 months ago #108270

Thanks!

But I tested it, and now the the pdf gets the ordernr, instead of invoice nr.


I'll keep on trying!
Last edit: 11 years 5 months ago by gasoline.

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

  • Posts: 26159
  • Thank you received: 4028
  • MODERATOR
11 years 5 months ago #108276

Hi

$mailer->AddAttachment($invoiceFolder.DS.$invoiceFile,JText::_('INVOICE').str_pad($order->invoice_id, 4, "0", STR_PAD_LEFT).'.pdf');

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 5
  • Thank you received: 0
11 years 5 months ago #109280

Hi Nicolas,

Just got the attach PDF plugin and am working on the invoice style/layout. I tried adding a logo by including html in the shop address field as you suggested, but it seems that the PDF plugin has an issue with that because I get this error when I try to view the invoice:

6 - An error has occurred.

ERROR n°6 : Impossible to load the image http://fuelnetworkservices.co.za/images/FNS-logo.jpg

I've tried changing the image format to png, but that didn't help.

So I created an override file and hard-coded the image HTML, but I get the same error.

I've also tried relative (./images/FNS-logo.jpg and /images/FNS-logo.jpg) and absolute URLs in the source which didn't help either.

Please let me know how I can include the logo image in my Invoice.

Thanks.

Last edit: 11 years 5 months ago by Magiweb.

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

  • Posts: 5
  • Thank you received: 0
11 years 5 months ago #109299

Just so any1 who has a similar problem knows...

It was a server configuration issue: I had to enable allow_url_fopen on my hosting's php.ini file to get it working. Turns out HTML2PDF needs this to be able to open images.

Last edit: 11 years 5 months ago by Magiweb.

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

  • Posts: 26159
  • Thank you received: 4028
  • MODERATOR
11 years 5 months ago #109416

Hi,

When you specify a file path, you have to set the server file path. If you are using a "http" path, it will not be seen as a file path, but as an external file which has to be download by the server.
It includes a lot of complexity for a file which is already in the server.
You have to use the server relative path or the server absolute path.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

Time to create page: 0.128 seconds
Powered by Kunena Forum