Pages

Showing posts with label information. Show all posts
Showing posts with label information. Show all posts

Sunday, August 18, 2013

Cakephp-Refresh Auth Session information after a database change of current user

In order to update current user logged in Auth Session after a database change in his information in Users Table use the following command

$userid=$this->Auth->user('id');

$this->Session->write('Auth',$this->User->read(null,$userid));

That's it and your auth session is updated..

This is usually done once a user updates his information....

Authroize .Net-Error:E00044 [text]=>Customer Information Manager is not Enabled

This error I faced using Authorize .Net CIM.My only mistake was I signed up with an account with credit card present in Authorize .net developers

Sign up with an account with "Card Not Present option" and it will give you a different admin panel where you can enable disable CIM.


Friday, May 3, 2013

Magento-Get information of Items in Cart

Magento-Get Information of Items in Cart

$items=Mage::getSingleton('Checkout/Session')->getQuote()->getAllItems();

foreach($items as $item)
{
    echo $item->getName();
                      ->getQty();
                      ->getPrice();
                      ->getSku();
                      ->getProductid()
}


Social Engine 4-Get avtar of user

$user_id=Engine_Api::()_->user->getviewer->getIdentity();

$userinfo=Engine_Api::_()->user()->getUser($user_id);

$photo_id=$user_info['photo_id'];


//Fetches table Engine4_storage_files

$filesTable=Engine_APi::_()->getDbtable('files','storage');

$adapter=Engine_Db_Table::getDefaultAdapter();

$filesTableName=$filesTable->info('name');

$query=Engine_Db_Table::getDefaultAdapter()->select("storage_path")->from($statsTableName)->where("field_id=?",$photo_id)->limit(1);

$result=$query->query()->fetch();

$result['storage_path'] //has the path to your photo


Social Engine 4-Get User Info

$user_id=Engine_Api::()_->user()->getviewer()->getIdentity();

$user_info=Engine_Api::_()->user()->getUser($user_id);

Then you get an array $user_info

Now to get let us suppose email of user we use

$user_info['email'];

print_r($user_info) to get data array and check other key's

The other keys are


  1. user_id
  2. email
  3. username
  4. displayname
  5. photo_id
  6. status
  7. status_date
  8. password
  9. salt
  10. locale
  11. language
  12. timezone
  13. search
  14. show_profileviews
  15. level_id
  16. invites_used
  17. extra_invites
  18. enabled
  19. verified
  20. approved
  21. creation_date
  22. creation_ip
  23. modified_date
  24. lastlogin_date
  25. lastlogin_ip
  26. update_date
  27. member_count
  28. view_count