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.

Advertisements

Get Reviews for a product in magento


Hi Guys,
Here i have added some Magento Code for Get reviews collection or Reviews Summary collection data of a Product in Magento CMS. I hope it helps lot for beginners.

$_reviews = Mage::getModel('review/review')->getCollection()
->addStoreFilter(Mage::app()->getStore()->getId())
->addStatusFilter('approved')
->addEntityFilter('product', $_product->getId())
->setDateOrder(); // You can filter the results

foreach($_reviews as $re){
print_r($re->getData()); // You can get the results here
}