Trying to get a handle on how to do this but coming up against a brick wall.
I need a copy of the 'list orders' menu item for virtuemart so I can edit it and leave original 'list orders' in tact.
From what I read there should be a Model, View and Controller for 'List orders' but there isn't one that I can see.
Can anyone help me please?
EDIT: Joomla 3.6.2 and Virtuemart 3.0.16
index.php?option=com_virtuemart&view=orders&layout=list
layout refers to components\com_virtuemart\views\orders\tmpl\list.php
try a list2.php and layout=list2
Thanks, I tried that.
Created another list.php and list.xml files called list2.php and list2.xml
then created and external link menu to
index.php?option=com_virtuemart&view=orders&layout=list2
but i get the following error when I go to the menu item 'Order not found! It may have been deleted.'
if I edit the external link menu to
index.php?option=com_virtuemart&view=orders&layout=list
the orders list works, so must be missing something simple!
Thanks
mine was just a guess.. check that u are landing on list2 -- if not trace back
Ok, well thanks for your help.
Was reading up on the MVC framework the follow but this doesn't appear to work that way, so i'm not sure where I should be tracking back!
In VM the M (models) are all in the admin end..
so in the above the components\com_virtuemart\views\orders\view.html.php loads the admin vm orders model and uses its functions to get the order or order list etc
e.g. $orderModel = VmModel::getModel('orders');
u get not found because of this snippet in view.html
$this->order_list_link = JRoute::_('index.php?option=com_virtuemart&view=orders&layout=list', FALSE);
$orderDetails = $orderModel ->getMyOrderDetails();
if(!$orderDetails or empty($orderDetails['details'])){
echo vmText::_('COM_VIRTUEMART_ORDER_NOTFOUND');
return;
}
Thanks for your help, really appreciated.
Just wanted to let you know I found the issue, basically it was in the router.php
there wasn't a rewriting case setup for 'list2' so it was redirecting to 'list' and causing the issue
when i added the following text to the router.php around line 508 it worked
else if ($helper->compareKey($segments[0],'list2') ) {
$vars['layout'] = 'list2';
array_shift($segments);
}
Ah .. sef ... :)