Topic-icon SCLogin stopped working

Active Subscriptions:

None
7 years 9 months ago #58916 by Charmaine
Hi there, I don't know what happened, but after logging in with my FB or Twitter or VK accounts I get the error 0 - Class 'ShopFunctions' not found. What could possibly be wrong? I have Joomla 3.5.1.
The topic has been locked.
Support Specialist
7 years 9 months ago #58922 by alzander
Replied by alzander on topic SCLogin stopped working
The issue looks to be a new change in VM3. While our plugin was developed for VM2, it has been tested with earlier versions of VM3 without issue.

Doing a *very* quick look at the code, I think the problem should be easily solvable if you're up for testing a small code change. If so, edit the /plugins/socialprofiles/virtuemart2/virtuemart2.php file. Around line 158, you'll see:
private function getFieldFormData($fieldValue, $_field) 
    {
Add the following line directly after that:
if(!class_exists('shopFunctionsF'))require_once(VMPATH_SITE.DS.'helpers'.DS.'shopfunctionsf.php');

Then, a few lines below, you'll see the following 2 lines:
$_field['formcode'] = shopFunctions::renderStateList($fieldValue, '', false); 
            $_field['formcode'] = ShopFunctions::renderCountryList($fieldValue, false, array(), '');

Update both of those calls to change ShopFunctions to ShopFunctionsF, like:
$_field['formcode'] = shopFunctionsF::renderStateList($fieldValue, '', false); 
            $_field['formcode'] = ShopFunctionsF::renderCountryList($fieldValue, false, array(), '');

Let us know how that goes. We'll do some testing as well with the newest release of VM3, but that could take some days. Hopefully the above helps get you going now. We'll also look to include this in the JFBConnect v7.0.3 release.

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

None
7 years 9 months ago #58933 by Charmaine
Replied by Charmaine on topic SCLogin stopped working
Hi Alex,
Thank you for your support - it helped!

The only thing remaining is that when I tried to login with my Twitter account, after the message
"Do you already have an account on this site, or would you like to create one?

Login
If you already have an account, just log in here, and we'll link your Twitter account to it."

and after user registration, there were some forms to fill up with VM labels and they looked weird:
COM_VIRTUEMART_USER_FORM_BILLTO_LBL
COM_VIRTUEMART_USER_FORM_EDIT_BILLTO_LBL

If we could fix those minor errors would be awesome!

Thank you in advance.
The topic has been locked.
Support Specialist
7 years 9 months ago #58949 by mel
Replied by mel on topic SCLogin stopped working
Looks like Virtuemart has changed where it puts its language files in the newer version. Could you try the following changes:

Edit the /plugins/socialprofiles/virtuemart2/virtuemart2.php file:

1. Around line 35, replace
$lang = JFactory::getLanguage();
$lang->load('com_virtuemart');
$lang->load('com_virtuemart_shoppers', JPATH_SITE);
with
VmConfig::loadJLang('com_virtuemart');
VmConfig::loadJLang('com_virtuemart_shoppers', TRUE);

and 2. around line 302, replace the same code block as above.
The topic has been locked.
Active Subscriptions:

None
7 years 9 months ago #59075 by Charmaine
Replied by Charmaine on topic SCLogin stopped working
Hi guys,

I've replaced the code as you recommended in the last post. I've justtried it again to login via Twitter, and at the end of registration form I see this:
COM_VIRTUEMART_USER_FORM_EDIT_BILLTO_LBL
:-(
Any idea how to fix it?

Thanks!
The topic has been locked.
Support Specialist
7 years 9 months ago #59081 by alzander
Replied by alzander on topic SCLogin stopped working
That field is being used in our /plugins/socialprofiles/virtuemart2/virtuemart2.php file. If you open the file, you'll see it at line 53. I'm not sure what the new text string is for that field in VM3, but you'll need to update the COM_VIRTUEMART_USER_FORM_EDIT_BILLTO_LBL to the correct VM3 version. We'll look into fixing that as well with our next update that should improve VM3 compatibility.

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

None
7 years 8 months ago #59110 by Charmaine
Replied by Charmaine on topic SCLogin stopped working
Thanks for your reply Alex,

I did some research but didn't figure out how to update the COM_VIRTUEMART_USER_FORM_EDIT_BILLTO_LBL to the correct VM3 version. I saw in other VM3 files that is was COM_VIRTUEMART_USER_FORM_EDIT_SHIPTO_LBL , but didn't dare to replace by this :-)
What I found in /plugins/socialprofiles/virtuemart2/virtuemart2.php file, starting from line 52:
$this->vmfield_title = JText::_('COM_VIRTUEMART_USER_FORM_EDIT_BILLTO_LBL');

        // Nasty code, mostly taken from Virtuemart
        ob_start();
        $corefields = VirtueMartModelUserfields::getCoreFields();
        $_set = false;
        $_table = false;
        $_hiddenFields = '';
        $fieldHtml = '';
        $sectionStart = '';
this " // Nasty code" comment is a bit scary :-)
Maybe I will wait for the new update of JFBConnect (if it is not too long to wait!)
The topic has been locked.
Support Specialist
7 years 8 months ago #59152 by mel
Replied by mel on topic SCLogin stopped working
Sorry for the delay in response. We are working on the last few issues of the 7.0.3 release before moving to testing more.

On my test site with a clean install of Virtuemart, I have the COM_VIRTUEMART_USER_FORM_EDIT_BILLTO_LBL key defined in /components/com_virtuemart/language/en-GB/en-GB.com_virtuemart.ini with the following:
COM_VIRTUEMART_USER_FORM_EDIT_BILLTO_LBL="Add/Edit billing address information"

I actually do not have a COM_VIRTUEMART_USER_FORM_EDIT_SHIPTO_LBL key defined in any language files for VM. Could you check the file I listed and see if the BILLTO key is there? If not, I'd suggest adding the key/value that I copied from my clean install and see if there is any effect.

-Melissa
The topic has been locked.