Topic-icon JFB Module Code Conflict with Virtuemart Login

Active Subscriptions:

None
13 years 2 months ago #31923 by nettra
I'm using this code in the com_virtuemart\user\login.php file:

jimport( 'joomla.application.module.helper' );

$module = JModuleHelper::getModule( 'sclogin', 'Facebook Login' );

$attribs = 'xhtml';

echo JModuleHelper::renderModule( $module, $attribs );


But this code conflicts with users who try to log in without using the FB link. If I remove the FB module, then users are able to log in without a conflict. Users ARE able to login by using the FB without a problem, but there is a problem when users are not using it.

How can this be solved?
The topic has been locked.
Support Specialist
13 years 2 months ago #31935 by alzander
What is the conflict that is happening? Are you seeing an error message, something doesn't work, or something else? We'd need to know more about what's going wrong to help determine a solution.

Also, when you instantiate the SCLogin module like that, you're not passing any parameters to it, so all of the defaults should be used. It's best if you can instantiate a specific module position (make one up, like 'my-vm-position'), create an instance of the SCLogin module and put it in that position, and then change your code to load all modules for that position. That give you more control over the parameters and ensure that the SCLogin module is properly initialized.

Hope that helps get you started. If not, let us know more about the issue, and we'll help how we can.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
13 years 2 months ago #31938 by nettra
The conflict is that when users attempt to login using the regular login (not the FB), the page refreshes. No error messages.

Please lend instructions on how I can make this work better. You mentioned instantiating the position of the login, which I think that's what this code does:
$module = JModuleHelper::getModule( 'sclogin', 'Facebook Login' );

I'd appreciate further assistance.

Attached is a copy of the file we're trying to modify to get the module working. ##text##
The topic has been locked.
Active Subscriptions:

None
13 years 2 months ago #31940 by nettra
I've managed to get the module working. But I do have a question:

Is there a way to disable the Virtuemart User login (within the component) and only use the Facebook login? Currently I'm hiding the VM login via CSS but I would like to be able have the FB user login (I also have 'Username Link' and 'Password Link') and still want users to be able to Register for an account using the VM User form. Is the only solution to hide the VM login code ?
The topic has been locked.
Support Specialist
13 years 2 months ago #31941 by alzander
What VM User Login (in the component) are you talking about? Virtumart's actual login functionality? I'm not sure how you'd do that. I don't know Virtuemart all that well beyond how we integrate with it. That'd be a better question posed to their support.

I think your solution of hiding the login area with CSS is a good one though. The other option would be to edit their template files and remove it that way, but that would pose problems when you upgrade VM as those changes may be reverted. I think you have it right right now, especially if what you're doing works for you. If not though, I don't think we'd be the best ones to tell you how to modify VM.

Hope that helps,
Alex
The topic has been locked.