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.
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;
}
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!
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 (http://testapp1.neshangostar.com/user-profile?view=login)
(http://testapp1.neshangostar.com/images/joomla.jpg) (http://testapp1.neshangostar.com/images/joomla.jpg)
Virtuemart registration page
http://testapp1.neshangostar.com/product-list/user (http://testapp1.neshangostar.com/product-list/user)
(http://testapp1.neshangostar.com/images/vir.jpg) (http://testapp1.neshangostar.com/images/vir.jpg)
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.
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
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
(http://testapp1.neshangostar.com/images/joomla1.jpg) (http://testapp1.neshangostar.com/images/joomla1.jpg)
you have to use or create a Joomla vmuserfield plugin
See for eg.
http://forum.virtuemart.net/index.php?topic=141335.0
here a list of triggers(not updated)
https://forum.virtuemart.net/index.php?topic=101629.0
And some info https://docs.virtuemart.net/tutorials/development/175-code-adjustments-for-virtuemart-3.html
???
http://forum.virtuemart.net/index.php?topic=142056.msg501421#msg501421
Quote from: GJC Web Design on March 07, 2019, 09:00:22 AM
???
http://forum.virtuemart.net/index.php?topic=142056.msg501421#msg501421
thanks for reply but I must first add a field then use "plgVmOnBeforeUserfieldDataSave" function
Thank you for all the answers, my problem has been resolved
;D ;D ;D ;D
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