olef Posted December 2, 2008 Share Posted December 2, 2008 Contribution for email attachment Have installed the Contribution for attaching the pdf-file to Order-Confirmation, and it works fíne. But it will be nice if it takes in advance the following parameter: "Only display invoice for delivered orders?", so if it is TRUE, the PDF-file is then first attached when the Order is delivered, and when set to FALSE, the PDF-file is then attached as now, when the Order-Confirmation is sent. Does somebody have a suggestion to have the Contribution to work this way ? :blush: Quote Link to comment Share on other sites More sharing options...
olef Posted December 8, 2008 Share Posted December 8, 2008 Contribution for email attachment Have installed the Contribution for attaching the pdf-file to Order-Confirmation, and it works fíne. But it will be nice if it takes in advance the following parameter: "Only display invoice for delivered orders?", so if it is TRUE, the PDF-file is then first attached when the Order is delivered, and when set to FALSE, the PDF-file is then attached as now, when the Order-Confirmation is sent. Does somebody have a suggestion to have the Contribution to work this way ? :blush: Have solved the first Issue: Only send Ivoice-attachment if: Only display Invoice for delivered orders = true , and Attach PDF invoce to Customers Order Confirmation mail = true, In checkout_process.php, the following is changed: From: if (PDF_INVOICE_EMAIL_ATTACHMENT == 'true' ) to: if (PDF_INVOICE_EMAIL_ATTACHMENT == 'true' and DISPLAY_PDF_DELIVERED_ONLY == 'false' ) But my missing PHP-skills haven't come up with a solution how to attach the PDF-invoice to the mails send from the Admin-module, when status on the Order is "delivered". Have tried in a way like in the checkout_process. Hope someone can bring me on the right Track. Quote Link to comment Share on other sites More sharing options...
Guest Posted December 10, 2008 Share Posted December 10, 2008 Hi All, First off - great contrib! I am having a bit of a problem running it with PayPal IPN v2.3.3 Payment module. It appears that Paypal IPN bypasses the checkout_process.php and therefore skips the point where the e-mail would usually be sent out. ipn.php looks like the right place to stick in the bit of code which would usually go into checkout_process.php, specificaly in place of line tep_mail($order->customer['name'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, nl2br($email_order), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); however I have not been able to get the e-mail to work. Has anyone else been successful? Thanks! Quote Link to comment Share on other sites More sharing options...
chris23 Posted December 10, 2008 Author Share Posted December 10, 2008 Hi All, First off - great contrib! I am having a bit of a problem running it with PayPal IPN v2.3.3 Payment module. It appears that Paypal IPN bypasses the checkout_process.php and therefore skips the point where the e-mail would usually be sent out. ipn.php looks like the right place to stick in the bit of code which would usually go into checkout_process.php, specificaly in place of line tep_mail($order->customer['name'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, nl2br($email_order), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); however I have not been able to get the e-mail to work. Has anyone else been successful? Thanks! Hi, I don't use PayPal IPN but you're right in what you say. You need to duplicate the PDF code in ipn.php I *think* from a brief look (and I haven't tested this), that you'll need to change the reference $HTTP_GET_VARS['order_id'] = $insert_id; to $HTTP_GET_VARS['order_id'] = $HTTP_POST_VARS['invoice']; to ensure the order_id gets passed to pdfinvoice.php HTH Quote Please use forum for support rather than PM - PMs unrelated to my contributions will be ignored. Google Site Search is your friend My contributions: Tracking Module | PDF Customer Invoice | Subcategory textboxes Link to comment Share on other sites More sharing options...
Guest Posted December 10, 2008 Share Posted December 10, 2008 Thanks Christian, I tried it, but it didn't work. It looks like that the OSCommerce may be looking for PayPal to authenticate when it tries to access the ipn.php file after I change it (maybe to access pdfinvoice.php). And the request gets forwarded to login.php... Any ideas? Hi,I don't use PayPal IPN but you're right in what you say. You need to duplicate the PDF code in ipn.php I *think* from a brief look (and I haven't tested this), that you'll need to change the reference $HTTP_GET_VARS['order_id'] = $insert_id; to $HTTP_GET_VARS['order_id'] = $HTTP_POST_VARS['invoice']; to ensure the order_id gets passed to pdfinvoice.php HTH Quote Link to comment Share on other sites More sharing options...
olef Posted December 11, 2008 Share Posted December 11, 2008 I'm trying to use the pdfinvoice email attatchment together with Paypal Express Checkout, but I can't get it to work. Have tried to insert the following in the Paypal Express file ppeb.php: // BEGIN added for pdfinvoice email attachment: // Next line removed in original file // tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); if (PDF_INVOICE_EMAIL_ATTACHMENT == 'true') { // customers will be logged in so usual security checks of pdfinvoice.php will be met. All we do is set the order_id for pdfinvoice.php to pick up $HTTP_GET_VARS['order_id'] = $insert_id; // set stream mode $stream = true; // include pdfinvoice.php include_once(FILENAME_CUSTOMER_PDF); // add text to email informing customer a pdf invoice copy has been attached: $email_order .= PDF_INVOICE_ATTACHED ."\n\n"; // send email with pdf invoice attached. Check to make sure pdfinvoice.php returns some data, else send standard email // note $order object reinstantiated by inclusion of pdfinvoice.php hence customer['name'] if (tep_not_null($pdf_data)) { tep_mail_string_attachment($order->customer['name'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, $pdf_data, $file_name); } else { tep_mail($order->customer['name'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); } } else { // send vanilla e-mail - if email attachment option is false tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); } // END added for pdfinvoice email attachment: /// --- end ---- checkout process email function Hope somebody have an Idea Quote Link to comment Share on other sites More sharing options...
chris23 Posted December 13, 2008 Author Share Posted December 13, 2008 Thanks Christian, I tried it, but it didn't work. It looks like that the OSCommerce may be looking for PayPal to authenticate when it tries to access the ipn.php file after I change it (maybe to access pdfinvoice.php). And the request gets forwarded to login.php... Any ideas? Now I've given this more than 10 seconds thought, there was an obvious step missing from my last post. The file pdfinvoice.php has security checks in place to make sure that either: 1) The customer is logged in and can therefore only view invoices belonging to their customer id or 2) The admin add-on is place and a security bypass hash is sent to pdfinvoice.php to bypass the requirement in 1) This is where dealing with a payment module that uses a callback (eg PayPal, Chronopay etc) causes problems. Harald's (hpdl) offical standard PayPal module replaces the checkout_process.php flow and pre-saves the order using code in the payment module. The ipn.php callback then updates the order status. For this module, adding the PDF code to the payment module email block should work as the customer is logged in. If you're using a different PayPal IPN that moves the email sending to the callback function, then the customer will not be logged in. In this case, I suppose the easiest solution would be to set the passthru id in the IPN page, e.g. $HTTP_GET_VARS['passthruID'] = "your secrethashhere"; Note: all the above is based on my limited knowledge of the PayPal modules floating around the contribution area.. HTH Chris Quote Please use forum for support rather than PM - PMs unrelated to my contributions will be ignored. Google Site Search is your friend My contributions: Tracking Module | PDF Customer Invoice | Subcategory textboxes Link to comment Share on other sites More sharing options...
chris23 Posted December 13, 2008 Author Share Posted December 13, 2008 I'm trying to use the pdfinvoice email attatchment together with Paypal Express Checkout, but I can't get it to work. See post #532 Quote Please use forum for support rather than PM - PMs unrelated to my contributions will be ignored. Google Site Search is your friend My contributions: Tracking Module | PDF Customer Invoice | Subcategory textboxes Link to comment Share on other sites More sharing options...
Guest Posted December 15, 2008 Share Posted December 15, 2008 Hi, I'm trying to find a way to move the Company Name and Company Address so that they are not at the right edge of the screen. I have tried the previous fixes listed but they havent worked at all. Any ideas? BTW, this is the bit in question on my pdfinvoice.php: // Company name $this->SetX(0); $this->SetY(12); $this->SetFont(PDF_INV_CORE_FONT, 'B', 12); $this->SetTextColor($highlight_color[0], $highlight_color[1], $highlight_color[2]); $this->Ln(0); $this->Cell(150); $this->MultiCell(100, 3.5, tep_html_entity_decode(STORE_NAME), 0, 'L'); // Company Address $this->SetX(0); $this->SetY(16); $this->SetFont(PDF_INV_CORE_FONT, 'B', 10); $this->SetTextColor($highlight_color[0], $highlight_color[1], $highlight_color[2]); $this->Ln(0); $this->Cell(150); $this->MultiCell(100, 3.5, tep_html_entity_decode(STORE_NAME_ADDRESS), 0, 'L'); Quote Link to comment Share on other sites More sharing options...
Guest Posted December 15, 2008 Share Posted December 15, 2008 Just to update i found out how to do my above request. I changed the value of: $this->Cell(125); I have another question, on my pdf it shows http://www.carrickstationerysupplies.co.uk as the web address. Is there any way to have just www.carrickstationerysupplies.co.uk instead? Martyn Quote Link to comment Share on other sites More sharing options...
chris23 Posted December 16, 2008 Author Share Posted December 16, 2008 Just to update i found out how to do my above request. I changed the value of: $this->Cell(125); I have another question, on my pdf it shows http://www.carrickstationerysupplies.co.uk as the web address. Is there any way to have just www.carrickstationerysupplies.co.uk instead? Martyn EDIT pdfinvoice.php FIND: $this->MultiCell(100, 6, tep_html_entity_decode(PDF_INV_WEB) . HTTP_SERVER, 0, 'R'); REPLACE with: $this->MultiCell(100, 6, tep_html_entity_decode(PDF_INV_WEB) . str_replace("http://" , "", HTTP_SERVER), 0, 'R'); Quote Please use forum for support rather than PM - PMs unrelated to my contributions will be ignored. Google Site Search is your friend My contributions: Tracking Module | PDF Customer Invoice | Subcategory textboxes Link to comment Share on other sites More sharing options...
Guest Posted December 16, 2008 Share Posted December 16, 2008 EDIT pdfinvoice.php FIND: $this->MultiCell(100, 6, tep_html_entity_decode(PDF_INV_WEB) . HTTP_SERVER, 0, 'R'); REPLACE with: $this->MultiCell(100, 6, tep_html_entity_decode(PDF_INV_WEB) . str_replace("http://" , "", HTTP_SERVER), 0, 'R'); Thanks, that fixed it :) Quote Link to comment Share on other sites More sharing options...
asgc Posted December 24, 2008 Share Posted December 24, 2008 I'm download PDF_Customer_Invoice_v1.2 Contributions yesterday my Server OS: Linux 2.4.33.2 Database: MySQL 4.0.26 Im using cartXpress for it. After i update all the files from PDF_Customer_Invoice_v1.2, but when after i update, the filename.php went error, it says the catalog can't find filename_line error message. So i have to get my backup filename.php and add (which is inside the install.txt) // added customer pdf invoice define('FILENAME_CUSTOMER_PDF','pdfinvoice.php'); // end added customer pdf invoice manually, i'm not sure if i'm doing correctly but the website looks fine so far. So if i'm doing correct, now i have problem that how can i activate it? It says look for readme.txt for configuration instructions. But when i read the readme.txt it says " You should now have a new entry under configuration - PDF Invoices. The following explains how to use the options. " But there is no PDF invoices under configuration, unless i look for the wrong place?? can someone help, thank you i have attached my screen print Quote Link to comment Share on other sites More sharing options...
asgc Posted December 24, 2008 Share Posted December 24, 2008 One more question: when customer click the pdf file when item "delivered". without pop up the pfd invoice. it says Warning: getimagesize(PDF_INVOICE_IMAGE) [function.getimagesize]: failed to open stream: No such file or directory in /home2/asgc-456/asgc-www/catalog/pdfinvoice.php on line 152 Warning: getimagesize(PDF_INVOICE_IMAGE) [function.getimagesize]: failed to open stream: No such file or directory in /home2/asgc-456/asgc-www/catalog/fpdf/fpdf.php on line 900 FPDF error: Image file has no extension and no type was specified: PDF_INVOICE_IMAGE where do i go wrong?? Thx Quote Link to comment Share on other sites More sharing options...
GoAia Posted December 26, 2008 Share Posted December 26, 2008 Have solved the first Issue: Only send Ivoice-attachment if:Only display Invoice for delivered orders = true , and Attach PDF invoce to Customers Order Confirmation mail = true, In checkout_process.php, the following is changed: From: if (PDF_INVOICE_EMAIL_ATTACHMENT == 'true' ) to: if (PDF_INVOICE_EMAIL_ATTACHMENT == 'true' and DISPLAY_PDF_DELIVERED_ONLY == 'false' ) But my missing PHP-skills haven't come up with a solution how to attach the PDF-invoice to the mails send from the Admin-module, when status on the Order is "delivered". Have tried in a way like in the checkout_process. Hope someone can bring me on the right Track. Hi Has anyone a solution for this, to only attach the invoice to the confirmation e-mail when the status of the order is changed to "delivered"? Happy 2009! Lollo Quote Link to comment Share on other sites More sharing options...
GoAia Posted December 26, 2008 Share Posted December 26, 2008 Hi It has been covered already (I can't find it if so), but I wonder how to change the date on the pdf invoice to the date when the status is changed to "delivered"? Thanks Lollo Quote Link to comment Share on other sites More sharing options...
simplesimon4 Posted January 3, 2009 Share Posted January 3, 2009 Thanks for the great contribution. I have it installed and working. Is there any way to have the attachment also sent with the "extra order emails?" Currently they are getting the email without attachment. Thanks Quote Link to comment Share on other sites More sharing options...
kustomjs Posted January 16, 2009 Share Posted January 16, 2009 alright I am getting this error: Warning: require(fpdf/fpdf.php) [function.require]: failed to open stream: No such file or directory in admin/packingslip.php on line 26 Fatal error: require() [function.require]: Failed opening required 'fpdf/fpdf.php' (include_path='.:/usr/share/php:/usr/share/pear') admin/packingslip.php on line 26 Quote Link to comment Share on other sites More sharing options...
kustomjs Posted January 16, 2009 Share Posted January 16, 2009 well now I got that first problem fix now I got this: Warning: getimagesize(images/invoice_logo.jpg) [function.getimagesize]: failed to open stream: No such file or directory in /fpdf/fpdf.php on line 900 Warning: getimagesize(images/invoice_logo.jpg) [function.getimagesize]: failed to open stream: No such file or directory in /fpdf/fpdf.php on line 1542 FPDF error: Missing or incorrect image file: images/invoice_logo.jpg Quote Link to comment Share on other sites More sharing options...
clrob11 Posted January 26, 2009 Share Posted January 26, 2009 (edited) Hi, Can anybody help I get this message Fatal error: Call to a member function add_current_page() on a non-object in /home/xxxxx/public_html/Site/includes/application_top.php on line 647 . This happens if I click on the PDF invoice button in customer order within the admin section. Trouble is it throws my whole store out of whack so I can not even see the store front all I get is this error. I can move round the admin side ok. Would be rerally graetful for some help. Thanks Chris Edited January 26, 2009 by clrob11 Quote Better to be looked over than overlooked! Link to comment Share on other sites More sharing options...
Guest Posted January 26, 2009 Share Posted January 26, 2009 well now I got that first problem fix now I got this: Warning: getimagesize(images/invoice_logo.jpg) [function.getimagesize]: failed to open stream: No such file or directory in /fpdf/fpdf.php on line 900 Warning: getimagesize(images/invoice_logo.jpg) [function.getimagesize]: failed to open stream: No such file or directory in /fpdf/fpdf.php on line 1542 FPDF error: Missing or incorrect image file: images/invoice_logo.jpg Sounds like the images/invoice_logo.jpg is not there or not accessible. Quote Link to comment Share on other sites More sharing options...
Guest Posted January 26, 2009 Share Posted January 26, 2009 Thanks for the great contribution. I have it installed and working. Is there any way to have the attachment also sent with the "extra order emails?" Currently they are getting the email without attachment. Thanks There is an addon for that, have a look in the contributions area. Quote Link to comment Share on other sites More sharing options...
chris23 Posted January 26, 2009 Author Share Posted January 26, 2009 Can anybody help I get this message Fatal error: Call to a member function add_current_page() on a non-object in /home/xxxxx/public_html/Site/includes/application_top.php on line 647 Google or forum search on "Fatal error: Call to a member function add_current_page() on a non-object". This is not an error specific to this contribution. You'll find lots of fixes e.g. http://www.oscommerce.com/forums/index.php?showtopic=28405 Quote Please use forum for support rather than PM - PMs unrelated to my contributions will be ignored. Google Site Search is your friend My contributions: Tracking Module | PDF Customer Invoice | Subcategory textboxes Link to comment Share on other sites More sharing options...
clrob11 Posted January 27, 2009 Share Posted January 27, 2009 Google or forum search on "Fatal error: Call to a member function add_current_page() on a non-object". This is not an error specific to this contribution.You'll find lots of fixes e.g. http://www.oscommerce.com/forums/index.php?showtopic=28405 Thanks for your help I will investigate further. Quote Better to be looked over than overlooked! Link to comment Share on other sites More sharing options...
DeBarlo Posted January 27, 2009 Share Posted January 27, 2009 (edited) Just installed the contribution but am having trouble. I tried looking through the boards, but I couldn't find any information about the following error: FPDF error: Incorrect orientation: shiplabel_portrait_landscape Thanks in advance for any help! Edited January 27, 2009 by DeBarlo Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.