Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDFs as ZIP #182

Open
Schrank opened this issue Nov 16, 2014 · 10 comments
Open

PDFs as ZIP #182

Schrank opened this issue Nov 16, 2014 · 10 comments
Assignees
Labels

Comments

@Schrank
Copy link
Member

Schrank commented Nov 16, 2014

At the moment you can get all PDFs which are checked in the invoice view (or wherever) as a long PDF. I would like to implement an alternative: get single PDFs in a zip file

@Schrank Schrank self-assigned this Nov 16, 2014
@Schrank Schrank modified the milestone: Fix in 2014 Dec 7, 2014
@Schrank
Copy link
Member Author

Schrank commented May 29, 2015

I have implement a module here. Will open source it and link it in the wiki

@sprankhub
Copy link
Member

I think we should have this feature in the core!

@Schrank
Copy link
Member Author

Schrank commented May 29, 2015

I'm quite sure we discussed it and found another result 😜 will add it :)

@sprankhub
Copy link
Member

Really? Oh boy, I am getting old. Sorry for that. Thanks!

@Schrank Schrank mentioned this issue May 29, 2015
@Schrank Schrank removed this from the Fix in 2014 milestone Oct 15, 2017
@zuiko
Copy link

zuiko commented Nov 9, 2017

Hi
it seems (but I can be wrong) that this interesting feature (PDFs as ZIP) has not been currently included (merged) in the development branch (I downloaded). Is there a reason for this ?
Thanks for your answer to this, may be, naive question...

@Schrank
Copy link
Member Author

Schrank commented Nov 9, 2017

I guess @sprankhub and me decided to have this as a second plugin, but I can't remember :-/

@sprankhub What do you think? refurbish PR and merge it?

@zuiko
Copy link

zuiko commented Nov 9, 2017

I can't see any disadvantage to have this useful option in the main code...
But the code of the main branch may have changed slightly, so there are, may be, a few precautions to take.

@zuiko
Copy link

zuiko commented Nov 9, 2017

Little suggestion in order to improve invoices PDF files names in the ZIP file (currently it's the order number which is not the best in my mind), we can use the backoffice given individual file name:
in /app/code/community/FireGento/Pdf/Model/ZippedInvoice.php
private function addInvoice(ZipArchive $zip, $invoice) { $invoicefilename = Mage::helper('firegento_pdf')->getExportFilename('invoice', $invoice); //zuiko $zip->addFromString( //$invoice->getOrder()->getIncrementId() . '.pdf', //zuiko $invoicefilename, //zuiko Mage::getModel('sales/order_pdf_invoice')->getPdf( array($invoice) )->render() ); }

@zuiko
Copy link

zuiko commented Nov 9, 2017

In /app/code/community/FireGento/Pdf/controllers/Adminhtml/Sales/OrderController.php
and /app/code/community/FireGento/Pdf/controllers/Adminhtml/Sales/InvoiceController.php
I suggest to change:
$file = tempnam("tmp", "zip");
into:
$file = tempnam(Mage::getBaseDir('tmp'), "zip");
Because on some configurations the PHP standard tmp directory can be not allowed to write. The result is an empty zip file to download.
The Magento tmp directory is always allowed to write to Magento..

@sprankhub
Copy link
Member

I do not need this feature, but I am fine with merging it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants