/** * Function of Bulk Action to Print DPD Manifest * @return Mix */ public function processBulkPrintDpdManifest() { $manifest = Module::getInstanceByName('dynamicparceldistribution'); $pathToFile = $manifest->getPdfFile('manifest', Tools::getValue('orderBox')); foreach (DpdManifestRender::getWarningMessage() as $message) { $this->displayWarning($this->l($message)); } if ($pathToFile === false) { foreach (DpdManifestRender::getErrorMessage() as $message) { $this->errors[] = $this->l($message); } } else { $manifest->download($pathToFile, 'manifest.pdf', 'application/pdf'); } }