Use MageBridge with Advanced Module Manager - Yireo

JomSocial profile-synchronization

This guide deals with the synchronization of JomSocial profile-fields with Magento profile-fields. This feature is only part of the JomSocial integration of MageBridge 1.2. We highly recommend you read the tutorial Integrating JomSocial and MageBridge first.

Warning on missing JomSocial events

While Magento does not support custom profile-fields, JomSocial does. You can choose to synchronize Magento-fields with JomSocial-fields.

However, the current versions of JomSocial (1.2 and 1.5) do not support to Joomla! events to synchronize JomSocial-fields to Magento. Within MageBridge everything is built to accomplish this. There is just no JomSocial-code generating the actual event.

Do you really want this?

We also would like to warn you that synchronizing profiles is not something you neccessarily want. If all address-details are just maintained on some MageBridge-page, why show these details again in the JomSocial-profile? It might not make sense to your customers, and might confuse them.

Joomla! already supports syncing of Joomla! users with Magento, and because JomSocial makes use of these Joomla! user-record, the functionality is already there - without the connector discussed in this article. It's best to avoid duplicates between JomSocial profile-fields and Magento customer-fields. If you really want to create duplicates, our recommendations is to use the Magento address-fields only as read-only inside JomSocial.

Default field-conversion

We have added the functionality anyway, and also made it as flexible as possible. By default, MageBridge tries to synchronize all fields by assuming the same fieldname is used in both Magento as JomSocial. For instance, if Magento uses the field "street", MageBridge will sync this field with the JomSocial field "FIELD_STREET". If you sync the Magento-field "city", it will become the JomSocial field "FIELD_CITY".

This setup requires you to modify the JomSocial custom profile-fields, partly because the default field-codes in JomSocial are wrong and partly because you might want to add new fields to the profile.

Fields that need alteration after a default installation are FIELD_LANDPHONE (which should become FIELD_PHONE) and FIELD_ADDRESS (which should become FIELD_STREET). Optional, you can also rename FIELD_ABOUTME to FIELD_SHORTPROFILE.

Which fields to use?

The fields listed below currently exist in the Magento database, and could be used with the MageBridge profile-synchronization.

However, we want you to seriously consider that a customer might find it very confusing to see two different forms that allow entering the same details, even if the website automatically replicates these changes. We've built something we actually do not recommend using.

It could be an idea to use the list below to exclude address-information from the JomSocial-profile, or set the fields to "invisible" otherwise.

Magento field JomSocial field Description
email FIELD_EMAIL Email-address
prefix FIELD_PREFIX Name prefix
firstname FIELD_FIRSTNAME First name
middlename FIELD_MIDDLENAME Middle name
lastname FIELD_LASTNAME Family name or surname
suffix FIELD_SUFFIX Name suffix
nickname FIELD_NICKNAME Nichname
taxvat FIELD_TAXVAT Tax-number
shortprofile FIELD_SHORTPROFILE A short description of the customer
address_prefix FIELD_ADDRESS_PREFIX Name prefix
address_firstname FIELD_ADDRESS_FIRSTNAME First name
address_middlename FIELD_ADDRESS_MIDDLENAME Middle name
address_lastname FIELD_ADDRESS_LASTNAME Family name or surname
address_company FIELD_ADDRESS_COMPANY Company-name
address_street FIELD_ADDRESS_STREET Full street-address
address_postcode FIELD_ADDRESS_POSTCODE Postal code or ZIP-code
address_city FIELD_ADDRESS_CITY City
address_region FIELD_ADDRESS_REGION State or province
address_country FIELD_ADDRESS_COUNTRY Country name
address_country_id FIELD_ADDRESS_COUNTRY_ID Two-character country-code
address_telephone FIELD_ADDRESS_PHONE Phone number
address_fax FIELD_ADDRESS_FAQ Fax number

Note that the field "country" (the full name of the country) can be set from Magento to JomSocial, but from JomSocial to Magento. For the last, you would need to set the "country_id", but JomSocial has no support for that.

Custom field-conversion

There is an advanced option that allows you to influence the conversion yourself. This might be for instance usefull if your Magento installation contains an extra profile-field that you also want to synchronize to Joomla!. For this, browse within the Joomla! Administrator to the MageBridge Connectors and edit the JomSocial Profile connector. Edit the parameter "Field conversion" to become "custom" instead of "default".

Next, go to the folder components/com_magebridge/connectors/profile and copy the file "jomsocial_default.php" to a new file called "jomsocial_custom.php". The parameter "Field conversion" refers to the suffix of this file. Now you can add your own conversion-scheme by editing the "jomsocial_custom.php" file. The file should just define an array called $conversion with as index the JomSocial field-code and as value the Magento field-name.

Created on Friday, 23 October 2009
Modified on Tuesday, 21 December 2010

About Yireo

Yireo tries to help webdevelopers build successful Joomla! and Magento sites.

More about Yireo