Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email

Magento Forum

PDF Attachment doesn’t work when payment is made through PayPal
Jr. Member
Total Posts:  13
Joined:  2008-10-10

I have customised Sales/Model/Order.php to send a supplier an email with an attached shipment packing slip PDF whenever a customer submits an order.  This works fine when the payment method selected is Check/Money Order but when PayPal Standard is selected and the user is redirected to the pay pal site before the order processing code is executed it does not work.

The line of code where it fails is this:

$pdf Mage::getModel('sales/order_pdf_shipment')->getPdf($shipments);

No error message is generated, it just stops executing at this line.  I have added some more debug statements in getPdf() and determined that it is failing on the following line in Shipment.php:


It appears to be something to do with the $page variable.

Does anyone have any idea why this code would not work when paypal is involved?  Or any ideas on how to better understand what is the cause of the error.  I have run out of time to get to the bottom of this an am, unfortunately, going to have to do without PDF packing slips.

Any help much appreciated. Thanks.

Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top