Magento Themes and Magento Extensions

Magento – Show Firstname or Lastname Only In Welcome Message

Share
Posted on January 8th, 2013 | Posted by admin

If you would like to change the default welcome message in magento from “Welcome, Paul Donnelly” to “Hi Paul” or “Hello Mr Donnelly”, use the following snippets within
app\design\frontend\default\default\template\page\html\header.phtml

Firstname

<?php echo $this->__('Hi %s', Mage::getSingleton('customer/session')->getCustomer()->getFirstname()); ?>

Lastname

<?php echo $this->__('Hello Mr %s', Mage::getSingleton('customer/session')

Debugging Magento Issues

Share
Posted on January 7th, 2013 | Posted by admin
Occasionally there is a need to debug some Magento problem you may be experiencing.
  1. Enable error reporting
    In Magento’s index.php uncomment the following:

    ?
    1
    #ini_set('display_errors', 1);
  2. Turn on Magento Developer logging.
    In Magento admin System -> Configuration -> Advanced -> Developer -> Log Settings set Enabled = Yes
    This allows you to look in the magento/var/log/* log files for any errors
  3. Look at server error logs.

Magento only show free shipping

Share
Posted on January 6th, 2013 | Posted by admin

Magento only show free shipping

when you go to shipping on the Onepage checkout process and you qualify for free shipping it usually still wants to show you all the options and make you choose one. I have seen a few attempts at fixing this although i think mine is the simplest.

Magento – How to run a SQL query against the database

Share
Posted on January 4th, 2013 | Posted by admin

In order to run a SQL query against the Magento database, you first need a resource model then a database connection.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
$db = Mage::getResourceSingleton('core/resource')->getConnection('core_write');
$result = $db->query('SELECT 'entity_id' FROM 'catalog_product_entity');
if(!$result) {
    return FALSE;
}
$rows = $result->fetch(PDO::FETCH_ASSOC);
if(!$rows) {
    return FALSE;
}
print_r($rows);

How to add new column of product list page in admin section of magento

Share
Posted on January 3rd, 2013 | Posted by admin

How to add new column of product list page in admin section of magento.

At first open the following file
app\code\core\mage\adminhtml\block\catalog\product\grid.php

I have added new two column in product listing page in admin section. The code which i modified is given below.

Then to go protected function _prepareCollection() method

Page 4 of 5«12345»