News:

Support the VirtueMart project and become a member

Main Menu

Split form user edit to be shown in two different tabs

Started by bart198x, January 31, 2015, 21:38:21 PM

Previous topic - Next topic

bart198x

Hello.
Joomla 2.5.27 and VM 2 (2.6.14)
I try to split index.php?option=com_virtuemart&view=user&layout=edit form to two forms, one with simple data like username name password email AND WHAT IS IMPORTANT three custom userfields checkbox (three of them), and the seckond form with company and any other fileds of 'account' column in _virtuemart_userfields in data base (assuming that user edit form is generated by '1's from that column. or maybe I'm wrong? so correct me ).
Why?
I try to make another tab in  index.php?option=com_virtuemart&view=user&layout=edit with basic datas with name username... and remove that data from existing tab 'Shopper Information' (not with css only, but with css will be difficoult too, no id's to hang on)
I've already created tab called COM_VIRTUEMART_USER_SIMPLE_DATA (not translated string but that's not important) but I cant split that form (user edit of course) to things looks like that (i prepared that screens in browser :) )



('select an option' is not what it should be but not the point)
the site is not style with css for meny things yet but that is not the point too.
I've found something on forum , but that was a long time ago http://forum.virtuemart.net/index.php?topic=88403.0 and actually I don't underdtand what he was trying to say, but he was saying wright things :)  .
How to split that form, to looks like that on screen (more or less - the problrm is in splitting that thing :) )

Thanks in advance... but this time I don't know if I answer myself as usual :) .
Thanks.

GJC Web Design

As he says it takes some coding skills - the fields are just looped thru and displayed

My thought would be two separate loops with filtering to get just the fields you want on the tab you want
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

bart198x

Indeed, but they are lupped outside views (to do things in overrides instead of core hacking) so I need grab that form before it displays (somehow - I don't know how, maybe in the evening I try), split it and replace the values of $tabarray in edit.php view file by new values. If I think correct. Hmm. I will have a rough night :)

GJC Web Design

but you can always call a model outside of the view i.e. directly in the template -- (e.g. look how say the vm products module is done)
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

bart198x

I made it :)
In view files by grabbing changing and replacying $this->userFields['fields'] by my own new array, all about I will write tommorow for now just photos


Some (5) newly created files some looping nothing special but looks like I wish to :)

bart198x

I've split that forms but they still behave like a single one (they are separated but they validating each other - but that's ok in my case - maybe I will work on that later)
The answer is complicated.
I created for that few files, some other are modyfied but in view only.