Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Magento Users Logging In WordPres Site
 
pradeep_kumar67
Sr. Member
 
Avatar
Total Posts:  160
Joined:  2010-06-24
Bangalore
 

I Have less idea on WordPress

one of my project need to all magento users can logging in WordPress site

we have one plugin called connect2MAGE which has to install in WordPress Site which is attached in this post only please check it attachment

go to your theme, you will see functions.php open it , end of that file add below function or code

function checkCustomAuthentication($username){
global $user;
$MAGEDB = new wpdb(get_option('connect2MAGE_DBUser'), get_option('connect2MAGE_DBPassword'), get_option('connect2MAGE_database'), get_option('connect2MAGE_Host'));
$sql "SELECT ce.email, cev.value as password, cev1.value as firstname
  FROM customer_entity AS ce 
  LEFT JOIN customer_entity_varchar AS cev ON cev.attribute_id = 12 AND ce.entity_id = cev.entity_id
  LEFT JOIN customer_entity_varchar AS cev1 ON cev1.attribute_id = 5 AND ce.entity_id = cev1.entity_id
  where ce.email='"
.$username."'";
$result $MAGEDB->get_results($sql);
if(
$result[0]->email !=''){
$pwd_split 
explode(':',$result[0]->password);
$salt =$pwd_split[1];
$password md5($salt.$_POST['pwd']).':'.$salt;
if(
$result[0]->password == $password){
    $userdata 
= array();
    
$userdata['user_pass'$_POST['pwd'];
    
$userdata['user_email'$result[0]->email;
    
$userdata['user_login'$result[0]->firstname;
    
wp_insert_user$userdata ); 
    
wp_login($result[0]->email$_POST['pwd']true);
    
wp_setcookie($result[0]->email$_POST['pwd']true);
    
wp_set_current_user($user->ID$result[0]->email);
    
}
  }

}
add_action
('wp_authenticate','checkCustomAuthentication');
File Attachments
connect2mage.zip  (File Size: 7KB - Downloads: 19)
functions.php  (File Size: 22KB - Downloads: 14)
 
Magento Community Magento Community
Magento Community
Magento Community
 
pradeep_kumar67
Sr. Member
 
Avatar
Total Posts:  160
Joined:  2010-06-24
Bangalore
 

By using this connect2MAGE we can access magento Db so that we can publish products in WordPress also

 
Magento Community Magento Community
Magento Community
Magento Community
 
Magikvishal
Sr. Member
 
Total Posts:  278
Joined:  2012-06-12
 

Thanks sharing your knowledge....

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top