Archive for the ‘Magento’ Category

If customer is logged in on site and you want to get all information of that customer then you can get by below script: if( $customer = Mage::getSingleton('customer/session')->isLoggedIn()) { $customerData =...

In most cases, an user (A developer) need to write own code to generate an order, generate invoice for an order or generate shipment for an order then he need both order id and its increment id. You can get this increment value by following...

When I tried to export or import any profile, then I got a fatal error: Fatal error: Call to undefined method Mage_Adminhtml_Block_Abstract::getexceptions() in .......\app\code\core\Mage\Adminhtml\Block\System\Convert\Profile\Run.php on line 167 To...

I installed Magento on my local server. When I tried to add new category then I got a fatel error. What I did and what I got: I click on catalog > Manage Categories I got Fatal error: Call to undefined method...

Many times developer gets the time problem during project development. Because he works on date function which provides by PHP but site works on different server which time is different from developer country. So for this case you can use magento time...

In most cases we need to get the current logged in user information like his/her email address, Id, any other attributes value. then we can get this by below code : //Customer Email...

According to magento characteristics, we can get the custom created product attributes at front side in easy way by $_product->getCustomCreateAttribute() But when we create an attribute for an category then magento does not show by...

many times we need to do operation on two column values and show in the admin panel. for this we have to follow these steps: 1. Add column in your Grid.php file: 2. Now create a folder in the AdminHtml folder with name 'Renderer' 3. Create a...

Mostly all Models in the Magento have a corresponding Collection object that can be used to fetch multiple instances of a Model. To instantiate a Product collection, do the following $collection =...

This is most useful when you don't know that what will be table prefix on server side. This situation may be generate when you are developing project at local system and you know table prefix and you have no access on server side so you are not able to...

Any developer wants to check what sql is executing during page load. so he can check and identify the getting errors: To print the sql go to folder : app\code\core\Mage\Catalog\Model\ and open file Layer.php search the function : and...

Magento comes with built in function for retrieving URL paths. Function is called getBaseUrl() and its located under Mage class. However, function is not documented as it should be. Documentation only states that function retrieves $type parametar...

Its a very simple:


First create a static block from admin >> CMS >> static blocks and write this code in your phtml file :

getLayout()->createBlock('cms/block')->setBlockId('given_Static_block_name')->toHtml();
?>

Hi magento developers, if you are getting problem in login in admin panel after fresh magento installation on your system then I have a solution for magento version 1.4.x.x go to: app/code/core/Mage/Core/Model/Session/Abstract and open up varien.php,...

Steps for Remember me functionality in login.phtml Step 1: Please find the following path http:\\yourdomain\app\code\core\Mage\Customer\controllers\AccountController.php Step2: Find following function: public function...

I have tried many times but I didn't got success . But today I got the solution to show the currency symbol of product price: Currency Code : <?php echo $currency_code = Mage::app()->getStore()->getCurrentCurrencyCode(); ?> Currency...