News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Copy 'List orders' layout and menu item

Started by cliquedm, August 31, 2016, 09:02:27 AM

Previous topic - Next topic

cliquedm

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

GJC Web Design

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
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

cliquedm

#2
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

GJC Web Design

mine was just a guess.. check that u are landing on list2 -- if not trace back
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

cliquedm

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!

GJC Web Design

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;
         }
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

cliquedm

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);
      }

GJC Web Design

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation