Virtuemart add complete com_user edit to tabs in com_virtuemar user edit

Started by bart1983, January 18, 2015, 11:57:51 AM

Previous topic - Next topic

bart1983

In Joomla 2.5.27 with virtuemart 2.6.14 in my case. I would like to know how to import all index.php?option=com_users&view=profile&layout=edit to virtuemart index.php?option=com_virtuemart&view=user&layout=edit.

There are three tabs in virtuemart user edit. In one there are user edit data, in the second are all orders, and I would add the third tab with com_user edit data (and disable appropriate fields in virtuemart user edit form - that i know how to do, how to disable them in virtuemart form).

Why?? basic question. I've created plugin adding custome fields to com_user ( 5 single checkbox with params and validation) and want to display them in user simple data form on virtuemart user edit as one of those tabs (tab which i created). but for that i need to load in that tab com_user component with edit view.

What I've already done is to create that tab and view for it. The code for that is: components/com_virtuemart/views/user/tmpl/edit.php about line 100
Just leave overrides subject (I know, that would be done - later :) ).
$tabarray['user_data'] = 'COM_VIRTUEMART_USER_SIMPLE_DATA';
after that I create view file in components/com_virtuemart/views/user/tmpl edit_user_data.php with view declarations for virtuemart (coping from another view file):

<?php
/**
 *
 * Enter address data for the cart, when anonymous users checkout
 *
 * @package    VirtueMart
 * @subpackage User
 * @author Oscar van Eijk, Max Milbers
 * @link http://www.virtuemart.net
 * @copyright Copyright (c) 2004 - 2010 VirtueMart Team. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
 * VirtueMart is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 * @version $Id: edit_address.php 6406 2012-09-08 09:46:55Z Milbo $
 */
// Check to ensure this file is included in Joomla!
defined ('_JEXEC') or die('Restricted access');

// Implement Joomla's form validation
JHTML::('behavior.formvalidation');
JHTML::stylesheet ('vmpanels.css'JURI::root () . 'components/com_virtuemart/assets/css/');


?>

and it of course displays nothing, because there is nothing in it :)

And now I can't load for that view all com_user edit form (but in normal joomla way which loads my plugin too).

So the question is how to load that component with view and layout and all functionality (index.php?option=com_users&view=profile&layout=edit) to my newly created tab?

Eventualy how to make my plugin to display that 5 checkbox in virtuemart user edit form (with all plugin functionality). the plugin is available http://esteart.home.pl/registrationtermscheck.zip and it is still in developing stage - but works.

Thanks in advaance, and of course still searching :)

If any one know please write.
for now I gave up and install componentsanywhere-v1.4.3
and add syntax to view file :) .
Works.