Forums / All Other Contributions/Addons / Invoice-to-PDF Mailer [support thread]

Invoice-to-PDF Mailer [support thread]

Started by hayden on 9 Nov 2008, 2:08 AM · Views: 23,841

Results 1 to 20 of 40
9 Nov 2008, 2:08 AM
#1
hayden avatar

hayden

New Zenner

Join Date:
May 2008
Location:
South Australia
Posts:
86
Plugin Contributions:
1

Invoice-to-PDF Mailer [support thread]

:yes:

as the name suggests, it generates a pdf from your invoice, then allows you to mail it as an attachment.

Download: http://www.uhost.com.au/downloads/invoice_pdf_mailer_v01.zip


Zencart Invoice to PDF Mailer v01

featuring:

dompdf - PHP5 HTML to PDF converter

http://www.digitaljunkies.ca/dompdf

and

PHP: Sending Email (Text/HTML/Attachments) (Guide)
http://www.webcheatsheet.com/PHP/send_email_text_html_attachment.php

and

A modified admin/mail.php file to handle the mailing until zencart completes its attachment support.


contact me via the forum or https://www.hthring.com,

regards,

Hayden Thring
Australia.
09/11/08

9 Nov 2008, 4:43 AM
#2
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Invoice-to-PDF Mailer [support thread]

Zencart attaches file just fine. In fact, I wrote a module that uses the pdf invoice center, to send email to customers everytime a new order is placed (with the pdf invoice attached)

I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

9 Nov 2008, 4:50 AM
#3
hayden avatar

hayden

New Zenner

Join Date:
May 2008
Location:
South Australia
Posts:
86
Plugin Contributions:
1

Re: Invoice-to-PDF Mailer [support thread]

yellow1912:

Zencart attaches file just fine. In fact, I wrote a module that uses the pdf invoice center, to send email to customers everytime a new order is placed (with the pdf invoice attached)

it might just, but i couldnt work it out, and there was comments in the code that it was buggy and unfinished.

so where this module of urs ??

9 Nov 2008, 4:51 AM
#4
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Invoice-to-PDF Mailer [support thread]

hayden:

it might just, but i couldnt work it out, and there was comments in the code that it was buggy and unfinished.

so where this module of urs ??
It was written for a customer and will not be released without his consent :)

I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

9 Nov 2008, 5:00 AM
#5
hayden avatar

hayden

New Zenner

Join Date:
May 2008
Location:
South Australia
Posts:
86
Plugin Contributions:
1

Re: Invoice-to-PDF Mailer [support thread]

so i take it u were able to to send attachments via the normal mail system ?? any tips ??

Hayden.

10 Nov 2008, 1:36 AM
#6
lumpylumpy avatar

lumpylumpy

New Zenner

Join Date:
Feb 2008
Posts:
27
Plugin Contributions:
0

Re: Invoice-to-PDF Mailer [support thread]

Hi, i have istalled this mod also, edited the super_orders.php to make te email button vizible but when in press it i get a new page saying:
Content Encoding Error
The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.
The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.

Also i got this error log from the error_debug_log:
[10-Nov-2008 03:24:53] PHP Fatal error: Uncaught exception 'PDFlibException' with message 'Bad floating point number for PDF' in /home/your/path_to/website/admin/dompdf/include/pdflib_adapter.cls.php:680
Stack trace:
#0 /home/your/path_to/website/admin/dompdf/include/pdflib_adapter.cls.php(680): PDFlib->fit_textline('Moto Bike Shop', 6, 768.72, 'rotate=0 wordsp...')
#1 /home/your/path_to/website/admin/dompdf/include/text_renderer.cls.php(84): PDFLib_Adapter->text(6, 6, 'Moto Bike Shop', '/home/motobike/...', 16, Array, 0)
#2 /home/your/path_to/website/admin/dompdf/include/renderer.cls.php(180): Text_Renderer->render(Object(Text_Frame_Decorator))
#3 /home/your/path_to/website/admin/dompdf/include/renderer.cls.php(96): Renderer->_render_frame('text', Object(Text_Frame_Decorator))
#4 /home/your/path_to/website/admin/dompdf/include/renderer.cls.php(132): Renderer->render(Object(Text_Frame_Decorator))
#5 /home/your/path_to/website/admin/dompdf/include/renderer.cls.php(132): Renderer->render(Object(Table_Cell_Frame_Decorator))
#6 /home/your/path_to/website/admin/dompdf/include/renderer.cls.php(132): Renderer->render(Object(Table_Row_Frame_Decorator))
#7 /home/your/path_to/website/admin/dompdf/include/renderer.cls.php(132): Renderer->render(Object(Table_Frame_Decorator))
#8 /home/your/path_to/website/admin/dompdf/include/renderer.cls.php(132): Renderer->render(Object(Table_Cell_Frame_Decorator))
#9 /home/your/path_to/website/admin/dompdf/include/renderer.cls.php(132): Renderer->render(Object(Table_Row_Frame_Decorator))
#10 /home/your/path_to/website/admin/dompdf/include/renderer.cls.php(132): Renderer->render(Object(Table_Frame_Decorator))
#11 /home/your/path_to/website/admin/dompdf/include/page_frame_reflower.cls.php(82): Renderer->render(Object(Block_Frame_Decorator))
#12 /home/your/path_to/website/admin/dompdf/include/frame_decorator.cls.php(387): Page_Frame_Reflower->reflow()
#13 /home/your/path_to/website/admin/dompdf/include/dompdf.cls.php(417): Frame_Decorator->reflow()
#14 /home/your/path_to/website/admin/makepdf.php(15): DOMPDF->render()
#15 /home/your/path_to/website/admin/pdfmail.php(18): include('/home/motobike/...')
#16 {main}
thrown in /home/your/path_to/website/admin/dompdf/include/pdflib_adapter.cls.php on line 680

Enyone experienced something like this?
I did not manage to make it work.
I have folowed the instuctions from /admin/dompdf/install.txt
and also from admin/read.install.txt

and also made directoryes writebel
/admin/invoices/
/admin/dompdf/lib/fonts
I am using 1.3.8a version of Zen Cart.

Best regards Zoli.

10 Nov 2008, 1:43 AM
#7
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Re: Invoice-to-PDF Mailer [support thread]

This is part of the observer class I used, this is all it takes to attach the (created) file to the email confirmation of the order:

function update(&$class, $eventID, $paramArray) {
    global $order;
      $file = $this->createOrderPdf($paramArray['zf_insert_id']);
    $order->attachArray = $file;
  }
```Note: this is for 1.3.8, not tested on any previous version

$file is path to file btw.

I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

10 Nov 2008, 1:47 AM
#8
hayden avatar

hayden

New Zenner

Join Date:
May 2008
Location:
South Australia
Posts:
86
Plugin Contributions:
1

Re: Invoice-to-PDF Mailer [support thread]

maybe there is something up with ur invoice.php ?? try using a default one if you've customised ur current one at all, see if u can get it warking atleast like that

14 Nov 2008, 5:54 PM
#9
battra avatar

battra

New Zenner

Join Date:
May 2007
Posts:
24
Plugin Contributions:
0

Re: Invoice-to-PDF Mailer [support thread]

I get 2 errors when using this addon:

  1. Where is FILENAME_ORDER_EDIT defined? I cannot find it anywhere.

  2. When I click 'Email PDF' button, received this error: Parse error: syntax error, unexpected T_NEW in /home/username/public_html/admin/dompdf/include/functions.inc.php on line 240

My showcase/gallery using Zen Cart - Summerdew

15 Nov 2008, 12:40 AM
#10
hayden avatar

hayden

New Zenner

Join Date:
May 2008
Location:
South Australia
Posts:
86
Plugin Contributions:
1

Re: Invoice-to-PDF Mailer [support thread]

battra:

I get 2 errors when using this addon:

  1. Where is FILENAME_ORDER_EDIT defined? I cannot find it anywhere.

  2. When I click 'Email PDF' button, received this error: Parse error: syntax error, unexpected T_NEW in /home/username/public_html/admin/dompdf/include/functions.inc.php on line 240
    ok , im sorry , i had editable orders addon installed first ...

"
NAME:

=====

Edit Orders

VERSION:

========

1.53 - 8/1/2008 - 1.5, 1.51, 1.52, and 1.53 Changes by Scott Turner
"

if u dont have this installed it should just be this:

if (sizeof($order->products) > 0) {
$contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit', 'NONSSL') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a>');
}
break;
}

########
you want it to look like this:
########

  if (sizeof($order->products) > 0) {

    $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit', 'NONSSL') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a>  <a href="pdfmail.php?oID=' . $oInfo->orders_id . '&email=' . $order->customer['email_address'] . '">' . zen_image_button('button_pdf.gif', 'Email PDF') . '</a>'');

  }

  break;

}


try that instead

15 Nov 2008, 11:55 AM
#11
battra avatar

battra

New Zenner

Join Date:
May 2007
Posts:
24
Plugin Contributions:
0

Re: Invoice-to-PDF Mailer [support thread]

Thanks! How about the parse error?

My showcase/gallery using Zen Cart - Summerdew

15 Nov 2008, 2:26 PM
#12
hayden avatar

hayden

New Zenner

Join Date:
May 2008
Location:
South Australia
Posts:
86
Plugin Contributions:
1

Re: Invoice-to-PDF Mailer [support thread]

battra:

  1. When I click 'Email PDF' button, received this error: Parse error: syntax error, unexpected T_NEW in /home/username/public_html/admin/dompdf/include/functions.inc.php on line 240

its hard to tell, as all the code in that dompdf file should be original and touched bar the config file... u could try re-uploading it , or getting it from src again, but it may be something else maybe server or invoice.php related...

i even checked out line 240 and traced it back a bit , to function called dec2roman, but no clues to why ur getting the error,
240:

 throw new DOMPDF_Exception("dec2roman() requires a numeric argument.");

theres what looks like something similiar being written about here:
http://www.mail-archive.com/[email protected]/msg188994.html

Has anybody out there actually gotten this to work ??
(i imagine so.. but cant be sure)

sorry im not much help, but its a bit over my head right now...

15 Nov 2008, 2:31 PM
#13
hayden avatar

hayden

New Zenner

Join Date:
May 2008
Location:
South Australia
Posts:
86
Plugin Contributions:
1

Re: Invoice-to-PDF Mailer [support thread]

  • converts decimal numbers to roman numerals

why this is even being called i have no idea, maybe u have some ... characters.. ??

16 Nov 2008, 6:26 AM
#14
battra avatar

battra

New Zenner

Join Date:
May 2007
Posts:
24
Plugin Contributions:
0

Re: Invoice-to-PDF Mailer [support thread]

Ok, I found that dompdf requires PHP5. Now I have PHP5 running but received another error "Page Load Error":

Content Encoding Error
The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.

This is the same error posted by lumpylumpy on page 1 of this thread. Any solution to that? Can;t find anything on Google :(

My showcase/gallery using Zen Cart - Summerdew

16 Nov 2008, 11:54 AM
#15
hayden avatar

hayden

New Zenner

Join Date:
May 2008
Location:
South Australia
Posts:
86
Plugin Contributions:
1

Re: Invoice-to-PDF Mailer [support thread]

battra:

Ok, I found that dompdf requires PHP5. Now I have PHP5 running but received another error "Page Load Error":

Content Encoding Error
The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.

This is the same error posted by lumpylumpy on page 1 of this thread. Any solution to that? Can;t find anything on Google :(

Battra

try clearing your browser cache and cookies and let me know if that changes anything,

Hayden.

17 Nov 2008, 12:44 PM
#16
battra avatar

battra

New Zenner

Join Date:
May 2007
Posts:
24
Plugin Contributions:
0

Re: Invoice-to-PDF Mailer [support thread]

Nope, still getting the same error after clearing the cache.

My showcase/gallery using Zen Cart - Summerdew

25 Nov 2008, 12:03 AM
#17
gee38l avatar

gee38l

Zen Follower

Join Date:
Jul 2008
Posts:
362
Plugin Contributions:
0

Re: Invoice-to-PDF Mailer [support thread]

I just installed this module and the button is showing up. although when i click on email pdf i get a internet explorer can not display this page.. I checked the invoices folder on the server and the pdf has been created but it has not been emailed....

Anyone have a solution?

25 Nov 2008, 10:36 AM
#18
hayden avatar

hayden

New Zenner

Join Date:
May 2008
Location:
South Australia
Posts:
86
Plugin Contributions:
1

Re: Invoice-to-PDF Mailer [support thread]

can you please give me the address from the title bar that is of the page not found ?

6 Jan 2009, 8:34 PM
#19
heathenmagic avatar

heathenmagic

Totally Zenned

Join Date:
May 2005
Location:
England
Posts:
733
Plugin Contributions:
0

Re: Invoice-to-PDF Mailer [support thread]

Hello there,

I get the following error when I click the Email PDF button:-

Warning: require_once(///domains//public_html//dompdf/include/shoppingcart.cls.php) [function.require-once]: failed to open stream: No such file or directory in /home//domains/.com/public_html/****/dompdf/dompdf_config.inc.php on line 194

Fatal error: require_once() [function.require]: Failed opening required '/home//domains/***.com/public_html//dompdf/include/shoppingcart.cls.php' (include_path='.:/usr/local/lib/php') in ///domains//public_html/**/dompdf/dompdf_config.inc.php on line 194

I couldn't see the mentioned missing file anywhere, not sure if I have another issues. I am on PHP 5 also.

Heathenmagic