Magento – How to get the module to print all sales order PDF files

magento-1.7pdf

I am creating own module for print order-pdf for the admin section of Magento. This is working fine. I'm able to print individual order pdf as well as multiple order pdf but problem is that When I print complete order pdf with "Print All" then order pdf not printing. Any Suggestion. The Function in below:-

    $this->getMassactionBlock()->addItem('pdfdocs_order', array(
         'label'=> Mage::helper('sales')->__('Print All'),
         'url'  => $this->getUrl('*/sales_order/pdfdocs'),
    ));

Best Answer

From you question I can gather the following information.

  1. When you print a single order it works,
  2. When you print say 4 orders it also works,
  3. If you just click the button with selecting orders it does not print anything,

If this is correct and you problem is that number 3 does not work then I have bad news for you as this is actually a "feature". If you look at the action that is called Mage_Adminhtml_Sales_OrderController::pdfdocsAction you will see that the first thing that is done is a check for order ids to print and if there are none in the request than nothing is printed.

I think what you will need to do is use the Magento grid select all option before selecting the button to print all and this should work, if it does not take too long.

Related Topic