CS CART user creation via custom code – Multi Vendor Version


Hi there,

Today we will take a look about the user creation via code.

create a php file what ever you wants from the root of the cs cart folder.


define('AREA', 'C');
define('AREA_NAME', 'customer');
require dirname(__FILE__) . '/prepare.php';
require dirname(__FILE__) . '/init.php';
$user_id = $notify_user = $ship_to_another = '';
$user_data = array( 'email' => 'manisanjai@gmail.com',
'password1' => '123456',
'password2' => '123456',
'birthday' => '14/01/1988',
'b_firstname' => 'Manimaran',
'b_lastname' => 'Kalimuthu',
'b_address' => '25, 2nd street',
'b_address_2' => 'test',
'b_city' => 'test',
'b_country' => 'IN',
'b_state' => 'Tamilnadu',
'b_zipcode' => '620008',
'b_phone' => '12345678',
'user_type' => 'C'
);
$_result = fn_update_user($user_id, $user_data, $auth, $ship_to_another,$notify_user);
print_r($_result); // You can get an array with profile id and user id.
}

Just copy and paste this code to your php file. Then execute the file from the browser. You can get the result as an array with user id and profile id.

That’s All.

I hope it helps some one.

Thanks.

get the logged user id in magento


Hi Guys,
Here is the information for magento logged in users data.
Just paste this code to your magento template files or php files too.

echo Mage::helper('customer')->getCustomer()->getId();
print_r(Mage::helper('customer')->getCustomer()->getData());
echo Mage::getSingleton('customer/session')->getCustomer()->getId();