need4speed Posted June 19, 2011 Share Posted June 19, 2011 Is it possible to link directy to PDF invoice from the html order confirmation mail?Even when the customer havent created a user account?Im running 1.3.6Jens Link to comment Share on other sites More sharing options...
shokinro Posted June 19, 2011 Share Posted June 19, 2011 Yes, you can do that add a link something link this in your email templatehttp://YourSiteRoot/pdf-invoice.php?id_order=9But when user click the link, user will be redirected to log in page to login, then get downloadIn order to increase, I suggest to put some encoded token in the to validate it. Link to comment Share on other sites More sharing options...
need4speed Posted June 19, 2011 Author Share Posted June 19, 2011 its not possible to skip the login? because some customers may choose not to create an user. Link to comment Share on other sites More sharing options...
shokinro Posted June 19, 2011 Share Posted June 19, 2011 you can do it, but it need do some coding to make it secure.otherwise, any people can see other's PDF that contains a private information. Link to comment Share on other sites More sharing options...
need4speed Posted June 19, 2011 Author Share Posted June 19, 2011 Yeah I guess there need to be generate a uniq url to the PDF file.Is it something you could make? Link to comment Share on other sites More sharing options...
shokinro Posted June 19, 2011 Share Posted June 19, 2011 yes, I I think can do it, PM me if you are interested to discuss in detail. Link to comment Share on other sites More sharing options...
xiverisx Posted July 15, 2011 Share Posted July 15, 2011 Hi i need the same feature, but after user is logged in going to: pdf-invoice.php?id_order=100015 (example)I am getting error: Invoice not foundIts from pdf-invoice.php code: $cookie = new Cookie('ps'); if (!$cookie->isLogged() AND !Tools::getValue('secure_key')) Tools::redirect('authentication.php?back=pdf-invoice.php'); if (!(int)(Configuration::get('PS_INVOICE'))) die(Tools::displayError('Invoices are disabled in this shop.')); if (isset($_GET['id_order']) AND Validate::isUnsignedId($_GET['id_order'])) $order = new Order((int)($_GET['id_order'])); if (!isset($order) OR !Validate::isLoadedObject($order)) die(Tools::displayError('Invoice not found')); elseif ((isset($cookie->id_customer) AND $order->id_customer != $cookie->id_customer) OR (Tools::isSubmit('secure_key') AND $order->secure_key != Tools::getValue('secure_key'))) die(Tools::displayError('Invoice not found')); elseif (!OrderState::invoiceAvailable($order->getCurrentState()) AND !$order->invoice_number) die(Tools::displayError('No invoice available')); else PDF::invoice($order); So prestashop allows only to view invoices when page admin in the orders admin tab changes order status to payment accepted. How i can edit this and others files, that user could see and get PDF invoice without changing order status? Link to comment Share on other sites More sharing options...
Recommended Posts