Appending fields and codes in virtuemart registration and login form by plugin

Started by mhs_pro, February 16, 2019, 14:03:29 PM

Previous topic - Next topic

mhs_pro

Hello
I want to Append some fields with specific behavior in registration and login form, that must be saved in my table in DB .for example mobile number field that is unique and been validate by sms and user can login with it .I want to do this job just by plugin and have full control .
this job can done by "onUserPrepareForm" function but when virtuemart installed and handles joomla registration and login this function doesn't work.
also I tried "plgVmOnUserfieldDisplay" function but doesn't work.

GJC Web Design

in the user model store() there is

// Preformat and control user datas by plugin
JPluginHelper::importPlugin('vmextended');
JPluginHelper::importPlugin('vmuserfield');
$dispatcher = JDispatcher::getInstance();

$valid = true ;
$dispatcher->trigger('plgVmOnBeforeUserfieldDataSave',array(&$valid,$this->_id,&$data,$user ));
// $valid must be false if plugin detect an error
if( !$valid ) {
return false;
}

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

Milbo

vmUserfield, vmshopper plugin, which means actually almost "nothing".

Just use one of both types, be aware that you can use ANY trigger, as long the plugin type gots loaded. Please check also the new version, cause there is another method of loading plugins.

If it does not work, use vmextended. It can implement any trigger function!
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

mhs_pro

Hello
thanks a lot for your reply, but my problem was not solved yet.
I can add a field to the Joomla registration form,But when this form is loaded on the Virtuemart registration page, the fields I added will not be displayed.I want add filed to Virtuemart Shopper Field in Joomla core section.
Joomla registration form show field
http://testapp1.neshangostar.com/user-profile?view=login


Virtuemart registration page
http://testapp1.neshangostar.com/product-list/user


And It seems vmextended not developed for example this code in my plugin doesn't execute :

class plgvmextendeduser extends vmExtendedPlugin {
public function __construct (&$subject, $config=array()) {
parent::__construct($subject, $config);
}
public function onVmSiteController($controller){
var_dump($controller);
exit;
}
}


I don't want change virtuemart core. I want to append this field only by a plugin.

Studio 42

Joomla user registration form have nothing to do with Vm registration.
So you should check with a Joomla user plugin if you want disply it in the joomla core user form
See https://docs.joomla.org/Plugin/Events/User

mhs_pro

Quote from: Studio 42 on March 05, 2019, 18:31:59 PM
Joomla user registration form have nothing to do with Vm registration.
So you should check with a Joomla user plugin if you want disply it in the joomla core user form
See https://docs.joomla.org/Plugin/Events/User

I want to add a field here with plugin


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


mhs_pro


GJC Web Design

to "repay" the help u receive, help other forum users and contribute to the project it would be good to write how u solved it....

can be as long an explanation as u want .. all adds to the general knowledge
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