CodeCanyon

Single Sign-On For Magento And WordPress

  • Bought between 1 and 9 items
  • Has been a member for 0-1 years

Hi James,

I’ve been wanting to get this plugin as I use your Magento WordPress Integration plugin currently. Let me explain what I’m trying to do and tell me how I can get it to work with this extension.

We have a magento store (given) for our franchise. We have a wordpress site (portal) for our users to browse content etc. The portal is an internal management site for the franchise user. Currently our magento store creates a user within our wordpress portal (i believe by using your magent integration plugin)

The third variable and the missing piece is to allow the franchise end user single sign on access to their (front facing consumer wordpress site) backend.

So their are 3 sites.

1. Magento Store -All Login Data used here 2. Portal Wordpress site – used for internal franchise system (internal docs, how to’s etc) 3. Customer facing franchise site (each franchise user has their own site) – they can write articles, promote things, for the general public.

I’m trying to get the user to sync all three sites.

Also, the site 3 customer site is in a multi site wordpress set-up.

Anythoughts? Does your plugin actually inject the password into the password field in wordpress? so they can get into the back end via wp-login page?

Let me know what you think!

jamesckemp

Hello,

That sort of setup should work with my plugin, assuming the 2 WordPress sites share the same users. The only difficulty would be the username.

The password is the same for both platforms (Magento/WordPress), but the WordPress username is randomly generated so that Magento can link to it. I could alter it for you to use the email address, the only reason I didn’t do that in the plugin release is that you can change your username (email) in Magento, but you can’t change your username (easily) in WordPress.

However, If you;re using MWI as well, you could create a “Login” block, that would log the user into Magento, in turn logging them into WP at the same time. This would involve redirecting any WP login page to a custom login block from Magento.

Default-user

Thanks for the quick reply James,

Do you have time do do a skype chat sometime this week to go over it? I’m not the developer and would like to have one of them on the call.

  • Bought between 10 and 49 items
  • Has been a member for 2-3 years

I have purchase yous script but doesnt work. My website is bordadosdeayeryhoy.es (wordpress is in the root) My magento install is in bordadosdeayeryhoy.es/shop

I have follow all the steps and insert this code $admin = “admin”; $wpload = ”../wp-load.php”; $uri = $_SERVER[‘REQUEST_URI’];

if(!strpos($uri, $admin) && !strpos($uri, ‘downloader’)) { require_once($wpload); }

Can you help me?

jamesckemp

Hi Sergio, why doesn’t it work?

Default-user

when i register a user in magento, in wordpress dont happen anything

jamesckemp

Have you check the wordpress user list to see if any have been created. If they have and it just isn’t logging them in the it’s a cookie issue.

Default-user

In the wordpress there isnt new users. Just the admin

jamesckemp

Where did you add the code?

Default-user

In the functions.php that says the documentation.

jamesckemp

Can you show me the path to that file. I need as much information as possible, otherwise I can’t help.

jamesckemp

Hi, the code you pasted in your first message should be in the index.php on your Magento installation root, not the functions.php file

Default-user

Yes the code its in index at the begin. The path its for the functions. I have sent you an email.

Default-user

Any solution?

  • Bought between 1 and 9 items
  • Has been a member for 4-5 years

Hello, i purchased whit plugin, installed as the installation guide requires, but this is the error i get when i try to open the magento home page: “Fatal error: Mage_Core_Model_Session_Abstract::getMessages() [mage-core-model-session-abstract.getmessages]: The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition “Mage_Core_Model_Message_Collection” of the object you are trying to operate on was loaded before unserialize() gets called or provide a __autoload() function to load the class definition in /home/ordinear/public_html/corsi/app/code/core/Mage/Core/Model/Session/Abstract.php on line 215”

Whant can it be? Thanks!

jamesckemp

Hello, do you have any plugins in WordPress that may be running a session?

Default-user

Hi… i’m trying to make it work with a wordpress network, no plugins installed. Can it be the problem?

jamesckemp

Possibly. Could you try adding define(‘WP_INSTALLING’, true); to the start of your index.php in Magento? (Make sure the apostrophes are rendered properly)

Default-user

It’s working! Thank you very much!

jamesckemp

Thanks, please leave a rating if you find it useful!

  • Bought between 1 and 9 items
  • Has been a member for 0-1 years

Hi, i have problem with changing information at customer account. For example if I change my e-mail, magento will do that and wp not. But i can sign in with new e-mail without problems. How can i solve that?

jamesckemp

The email should update in both. One thing to note is that WordPress doesn’t use the email as a username. This is because in Magento you can change your username, but in WP you can’t. As such, WP uses a unique ID to identify the user, so the login will still work, no matter what info you change. Hope this helps.

  • Bought between 1 and 9 items
  • Has been a member for 0-1 years
TonyC83 Purchased

Hi James, looks like a great plugin but receiving an error.

When I load any Magento page, I get the error: Notice: Constant DS already defined in … /Mage.php on line 27

I’ve been following http://jckemp.com/documentation/magento-wordpress-single-signon/#!/installation and hit a snag when editing example.com/store/index.php:

<?php $admin = “admin”; $wpload = ”../wp-load.php”; $uri = $_SERVER[‘REQUEST_URI’];

if(!strpos($uri, $admin) && !strpos($uri, ‘downloader’)) { require_once($wpload); } /**

I have tried: 1) Magento is installed under /store so $admin = “admin”; is correct 2) WordPress is installed in the dir above so $wpload = ”../wp-load.php” is correct 3) functions.php is correct as your other plugin Magento WordPress Integration, works perfectly

Please can you advise?

Thank you, Paul

jamesckemp

Hi Paul,

Try adding this at the start of your Magento index.php file: define(‘WP_INSTALLING’, true);

(Make sure you renter the apostrophes as the comments may much them up)

Default-user
TonyC83 Purchased

Thanks James – perfect!

  • Bought between 1 and 9 items
  • Has been a member for 2-3 years

This is simply not working for me. I am using Magento ver. 1.7.0.2 and wordpress Version 3.5.1 and when I create a new user in Magento it does not create one in Wordpress. I use your other plugin that gets magento blocks and that works perfectly even has session information so i know how many items are in my cart and all that.

Do i need to have them on the same database or anything like that?

jamesckemp

Hi, could you do a quick test for me? After the code added to your Magento index.php, enter:

bloginfo('url'); die;

then visit the front end of your Magento site. It should show your wordpress url?

Default-user

It does show my url. I’m able to get my wordpress information in magento. I had pulled post data before just to test it.

jamesckemp

Have you checked under wp users that none are being created? Have you also explicitly set the cookie settings for both Magento and Wordpress?

Default-user

Yes none have been created. I made sure your module was enabled. I set cookies in magento as mentioned above with / and my domain efactenergy.com. That got the sessions to work for your other plugin when i did that. I just added define(‘COOKIE_DOMAIN’, ‘efactenergy.com’); and tested it and it still does not add the user in Wordpress. I checked both the backend of wordpress and the database via phpMyAdmin. If you want access to check it out I can send you an email.

Default-user

Nevermind I found the issue. Seems as though when I merged the extension files onto my server the config.xml didn’t get uploaded for some reason. It works now. Thanks!

jamesckemp

Good news! Please leave a rating when you get a chance

  • Bought between 1 and 9 items
  • Has been a member for 0-1 years

Can you confirm this works with 1.7.2 and latest magento? Also did I understand you correctly that wordpress plugins will not work with this extension? Does that mean all plugins? and last question how about wordpress MU compatibility?

jamesckemp

Hello, yes – this works with 1.7.2. You can have WordPress plugins installed, but any that may run a session may conflict with this plugin. You can however avoid this by adding a line of code to your Magento index.php file. I have not tested with WPMU

  • Bought between 1 and 9 items
  • Has been a member for 0-1 years
gfxguru Purchased

Decoding failed: Syntax error – saving a product. Magento 1.7.2 / latest wordpress. sent you a msg.

jamesckemp

Hello, does it give you any further details, file names, line numbers etc?

  • Bought between 1 and 9 items
  • Has been a member for 0-1 years
kkcnext Purchased

Hi, I installed the plugin in Magento and I am using the http://wordpress.org/extend/plugins/magento-wordpress-integration/. I am trying to get the session of Magento as given in the documentation but the $session->isLoggedIn fails.

also $header = get_block(‘header’, false); echo $header->getWelcome();

is not returning any result.

To add, after installing the plugin the login and logout in magento exits with blank page. I have used define(‘WP_INSTALLING’, true); in the magento index.php, still blank page is appearing while login and logout

jamesckemp

Hey, sounds like it’s most likely a cookie issue. In magento set the following:

Cookie Domain: ”.yourdomain.com” Cookie Path: ”/”

Then manually clear the cache and sessions folders under ”/yourmagentoroot/var”

Then try again!

Default-user
kkcnext Purchased

I tried the above, changing the Cookie Domain and Cookie Path, but magento login fails. I saw your video preview, http://jckemp.com/documentation/magento-wordpress-single-signon/#!/video_preview.

my folder structure is /var/www/wordpress for wordpress and /var/www/wordpress/magento for magento

what is the configuration I should do.

jamesckemp

What are the URLs of each?

Default-user
kkcnext Purchased

We are still testing this and the site is not live yet, I have sent the URLs to you mail (from your Profile page). Kindly help on this.

jamesckemp

Thanks – replied!

  • Bought between 1 and 9 items
  • Has been a member for 0-1 years
kkcnext Purchased

I am not getting $session = Mage::getSingleton(“customer/session”); $session->isLoggedIn() // always fails

whereas the following all works fine: Mage::getModel(‘core/cookie’)->get(‘usercookie’); echo Mage::getBaseUrl();

  • Bought between 1 and 9 items
  • Has been a member for 0-1 years

Hi James. Will your plugin work with Buddypress?

jamesckemp

I believe people have used it for that, but there may have been a few issues with the username that is created in buddypress

Default-user

Thanks for the fast reply. Do you know if such issues were easily fixed? It would really be great if you could share a few more details.

by
by
by
by
by