× Joomla Facebook Connect support forum

Topic-icon Virtuemart Account Maintenance

Active Subscriptions:

None
14 years 7 months ago #15189 by Adam
Hello

I really like you component, it does everything that was said it did!

But I need help with one thing..
I would like to have the account maintenance link (from virtuemart) on the jfb_login module so I don't have too have 2 login modules active on my site.
Is jfb_login supposed to do this and something is not working or?
Does it do the job if I copy-paste the code from the regular virtuemart login over to the jfb_login?

What would you recommend?

Regards
Adam
The topic has been locked.
Support Specialist
14 years 7 months ago #15190 by alzander
Adam,
The easiest way, actually, is to add the Login With Facebook button to the Virtuemart login module. The VM module has both a pre-text and a post-text parameter, and in either of those, all you should need to do is add something like:
Or login with Facebook: {JFBCLogin}
You can obviously put whatever text (or none at all) in there.

If you really want to modify the JFBCLogin module to add the Account Maintenance link, we can help, but it will take modifying the template file for the JFBCLogin module.. Not hard, but a little more work.

Glad you're overall happy with JFBConnect, and thanks for subscribing!

Hope that helps,
Alex
The topic has been locked.
Active Subscriptions:

None
14 years 7 months ago #15191 by Adam
Replied by Adam on topic Virtuemart Account Maintenance
Hi
Thanks for the quick response!

I do realize that, that would be the easy solution but the thing is I would like to keep the avatar/display picture when people sign in. Which would not work if I use the virtuemart log in am I right?
I would prefer that when you are logged in, it would go something like this:

Avatar/display picture
(Space)
Name
(space)
Account maintenance (Link)
(space)
Log out (button)

Is that doable with out to much of a hassle?
The topic has been locked.
Support Specialist
14 years 7 months ago #15192 by alzander
Should be. In the next release of JFBConnect, it will be much simpler, as we're moving to a new Login module that works with our LinkedIn extension as well. The template files will be much cleaner there.. but, not out right now :)

To add the link, you'd want to modify the /modules/mod_jfbclogin/tmpl/default.php file. The top half of the file is the login form, the bottom half is the logout portion. Around line 194, you should see the following, which is the start of the logout button:
<?php
        $showLogoutButton = $params->get('showLogoutButton');
To add the Account Maintence Link, you'd simply want to add it directly above that, so altogether, it will look like:
<a href="<?php echo JRoute::_('index.php?page=account.index&option=com_virtuemart'); ?>"Account Maintenance</a><br/> 
<?php
        $showLogoutButton = $params->get('showLogoutButton');
The JRoute call in there simply creates an SEF version of the URL, if you have that enabled. You should be able to remove that portion just fine as well and create a normal link.

When 4.1 comes out later this year, you'll need to do it again with the SCLogin module. It should be simpler, but of course if you run into issues, we're here to help!

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

None
14 years 7 months ago #15195 by Adam
Replied by Adam on topic Virtuemart Account Maintenance
Hi

Ok this works (except you forgot one > :)) but can I use the $VM_LANG string so it will call the common language file so the account maintenance is multi-lingual?
I can't seem to get that part to work..

I was trying to mix [ $text = $VM_LANG->_('PHPSHOP_ACCOUNT_TITLE'); ] into the code but when I did nothing happend.
I tried to put the $VM_LANG in global string but with no luck.
Is there a easier way of doing this? I'm not really a coder..

Thanks
Adam
The topic has been locked.
Support Specialist
14 years 7 months ago #15204 by alzander
Adam,
Try the following. If it doesn't work, it will take a little more code, but not much.. just don't want to add stuff that isn't necessary. At the very top of that default.php file, right below the defined('_JEXEC') at line #7, please put:
global $VM_LANG
Then, try to do whatever you want to do.

Really hope that helps!
Alex
The topic has been locked.
Active Subscriptions:

None
14 years 7 months ago #15242 by Adam
Replied by Adam on topic Virtuemart Account Maintenance
Hi

I did put "global $VM_LANG" with your code and a bit of changes so it looked like this:
<a href="<?php echo JRoute::_('index.php?page=account.index&option=com_virtuemart'); ?>"><?php $text = $VM_LANG->_('PHPSHOP_ACCOUNT_TITLE'); ?></a>

but then the link does not show up at all. am I doing something wrong here or?
The topic has been locked.
Support Specialist
14 years 7 months ago #15253 by alzander
Yup :D Change it to the below, and hopefully, you'll be good to go:
<a href="<?php echo JRoute::_('index.php?page=account.index&option=com_virtuemart'); ?>"><?php echo $VM_LANG->_('PHPSHOP_ACCOUNT_TITLE'); ?></a>

What you were doing was assigning the VM_LANG translation to a variable named $text. But weren't actually echo'ing (printing it to the screen) anywhere. Above, I just echo it directly, instead of saving it to a variable.

Hope that helps, and keep us posted!
Alex
The topic has been locked.
Active Subscriptions:

None
14 years 7 months ago #15258 by Adam
Replied by Adam on topic Virtuemart Account Maintenance
Now that's what I am talking about!!

This worked perfectly!

Thank you very much for the help, you have been great!

One other thing though.. I saw somewhere that you can have jfb_connect create a user and password through the sign in with facebook but I haven't been able to find out how.. I am using J1.5 and version 4.0.3 of jfbconnect. Is this feature not included in this version I have or not just for J1.5 or am I just totally missing how to do it?

Thanks again!
Adam
The topic has been locked.
Support Specialist
14 years 7 months ago #15266 by alzander
Adam,
Glad we could get you going!

You can have JFBConnect automatically create the username for the user by setting the "User Creation" setting to "Facebook User Only". This allows for a 1-click registration by bypassing the "Login or Register" page that you're seeing.

However, and this is a big however, that does not work at all when the Virtuemart plugin is enabled. The reason is that we (JFBConnect) have to create a user within Virtuemart's database table. Virtuemart will not let a user be created if all required profile information is not filled out (street address, phone number, etc). Since most of the information is not able to be retrieved from Facebook, the Login/Register page is required so that the user can fill out those fields.

Hope that makes sense... it's something we've tried to work around in the past to enable that "Facebook User Only", but haven't had any luck due to the requirements of Virtuemart.

Let us know if you have any other questions, and good luck!
Alex
The topic has been locked.