Showing posts with label Admin. Show all posts
Showing posts with label Admin. Show all posts

Wednesday, August 29, 2012

How to reset Magento admin password

If you need to change your magento admin password, go to phpMyAdmin, select your Magento database, click the SQL tab and paste this query:

UPDATE admin_user SET password=CONCAT(MD5('sGnewpass'), ':sG') 
WHERE username='AdminUsername';


You have to change newpass in the MD5('sGnewpass') with your new password, and change 'AdminUsername' to your Magento admin username.

Execute the query and your password will be changed.

Friday, May 18, 2012

Get Current Store Information

To get information about the current store in Magento


<?php
$store = Mage::app()->getStore();

//Get Current Store Name
$storeName = $store->getName();

//Get Current Store ID
$storeName = $store->getStoreId();

//Get Current Store Code
$storeName = $store->getCode();

//Get Current Store Website ID
$storeName = $store->getWebsiteId();

//Check if the current store is active
$storeName = $store->getIsActive();

//Get Current Store Home URL
$storeName = $store->getHomeUrl();

?>

Tuesday, January 10, 2012

Get Current Logged in Customer Info

Check if the customer is logged in then

Mage::getSingleton('customer/session')->isLoggedIn();


Get Current Customer Name

Mage::getSingleton('customer/session')->getCustomer()->getName();


You can Get Current Customer All Information

echo "<pre>"; print_r(Mage::helper('customer')->getCustomer()->getData()); echo "</pre>";


Ger Current Logged in Admin

Mage::getSingleton('admin/session')->getUser();