Order not found! It may have been deleted. message when click on print order

Started by fexnok, July 08, 2012, 16:49:04 PM

Previous topic - Next topic

fexnok

Here's the procedure to replicate the error:

  • User receives confirmation email
  • User clicks on view your order online
  • Browser opens and displays the invoice
  • User clicks on print button
  • New window opens and displays: Order not found! It may have been deleted.

This only happens when user is a guest user or when user is not logged in. If the user is registered and logged in the invoice displays correctly.

The problem lies on the parameters sent to the new window. According to \components\com_virtuemart\views\orders\view.html.php line 83 to 93, the URL must contain not the order_id only but order_number and order_password as well, and the template com_virtuemart\orders\details.php line 52 only sends order_id.

In order to fix it, create your own html\ com_virtuemart\orders\details.phptemplate and add the two missing parameters or just replace

$details_url = juri::root().'index.php?option=com_virtuemart&view=orders&layout=details&tmpl=component&virtuemart_order_id=' . $this->orderdetails['details']['BT']->virtuemart_order_id;

with

$details_url = juri::root().'index.php?option=com_virtuemart&view=orders&layout=details&tmpl=component&virtuemart_order_id=' . $this->orderdetails['details']['BT']->virtuemart_order_id .'&order_pass=' . JRequest::getString('order_pass',false) .'&order_number='.JRequest::getString('order_number',false);

I'm using Joomla 2.5.4 and it applies to Virtuemart 2.0.6 and 2.0.8a

Thanks

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/