I want to provide users with possibility to download their PDF invoices from VirtueMart frontend
Tell me how to do it?
Hello this is a good question?
anyone would know on how to do it please?
Hello, comeone, can anybody answer?
Many folks asked about this feature, with no success, is it hard to have links to invoices, links to PDF from the frontend? ;)
Mysterious facts...
well, your the 3rd in 3 years.. and it isn't so simple because the pdfs are stored above (or should be) the public html folder so it isn't a case of a simple generated link.
I have no idea if Max is considering this...
Ok, let me answer myself ;) VM 3 J 3,5
If you have the order already confirmed, it is possible to use FE links to the (recently created) invoice.
So, in orders/details.php file - for example in template's html override folder - add sth like this:
<div class="button" style="float:left"><a style="color:#333" target="_blank" href="index.php/en/?option=com_virtuemart&view=invoice&layout=invoice&format=pdf&tmpl=component&virtuemart_order_id=<?php echo($this->orderdetails['details']['BT']->virtuemart_order_id);?>&order_number=<?php echo($this->orderdetails['details']['BT']->order_number);?>&order_pass=aaa">Invoice in PDF</a></div>
Order pass is a dummy value here, it is not needed here, I suppose. It works only having invoice already created.
It works too:
<div class="button" style="float:left"><a style="color:#333" target="_blank" href="index.php/en/?option=com_virtuemart&view=invoice&layout=invoice&format=html&tmpl=component&virtuemart_order_id=<?php echo($this->orderdetails['details']['BT']->virtuemart_order_id);?>&order_number=<?php echo($this->orderdetails['details']['BT']->order_number);?>&order_pass=aaa">Invoice in HTML</a></div>
@GJC, not 3rd but 5 or 6th ;)
Regards Z.