Image upload error

|| Magento 1.9.2 and php7 – image upload error:
check console: Uncaught Error: Function name must be a string in store.com/lib/Varien/File/Uploader.php:259

$params['object']->$params['method']($this->_file['tmp_name']);

to

$params['object']->{$params['method']}($this->_file['tmp_name']);

Catalogsearch form:

Catalogsearch > form.mini.phtml


$category = Mage::getModel('catalog/category');
if (is_object(Mage::registry('current_category'))) {
    $current_category_path = Mage::registry('current_category')->getPathIds();
} else {
    $current_category_path = array();
}
$category->load(Mage::app()->getStore()->getRootCategoryId());
$children_string = $category->getChildren();
$children = explode(',', $children_string);
$extra_options = '';
foreach ($children as $c) {
    $selected = (in_array($c, $current_category_path)) ? 'SELECTED' : '';
    $extra_options.= '<option value="' . $c . '" ' . $selected . '>' . $category->load($c)->getName() . '</option>' . "\n";
}
?>
 
<form id="search_mini_form" action="<?php echo $this->helper('catalogSearch')->getResultUrl() ?>" method="get">
    <fieldset>
        <legend><?php echo $this->__('Search Site') ?></legend>
        <span style="float: left; position: relative; top: 8px; left: 15px;">Search</span>
        <div class="mini-search">
            <select name="cat" id="cat" class="input-text">
                <option value="">All Products</option>
                <?= $extra_options ?>
            </select>
            <input id="search" type="text" class="input-text" name="<?php echo $this->helper('catalogSearch')->getQueryParamName() ?>" value="<?php echo $this->helper('catalogSearch')->getEscapedQueryText() ?>"  placeholder="<?php echo $this->quoteEscape($this->__('Search entire store here...')) ?>" />
            <button type="submit" title="<?php echo $this->quoteEscape($this->__('Search')) ?>" class="button search-button" value="Go"><span><span><?php echo $this->__('Search') ?></span></span></button>
            <div id="search_autocomplete" class="search-autocomplete"></div>
            <script type="text/javascript">
                //<![CDATA[
                var searchForm = new Varien.searchForm('search_mini_form', 'search', '<?php echo $this->__('Search your products') ?>');
                searchForm.initAutocomplete('<?php echo $this->helper('catalogSearch')->getSuggestUrl() ?>', 'search_autocomplete');
                //]]>
            </script>
        </div>
    </fieldset>
</form>




Installation Problem:

|| Fatal error: Uncaught Error: Function name must be a string in /var/www/html/magento/app/code/core/Mage/Core/Model/Layout.php:555

$out .= $this->getBlock($callback[0])->$callback[1]();

to

$out .= $this->getBlock($callback[0])->{$callback[1]}();

|| Maximum execution time of 30 seconds exceeded in magento installation.

/* solve */
go to xampp/php/php.ini and search by 

max_execution_time=30  replace to 600
max_input_time=60      replace to 600
memory_limit=128M      replace to 1000m

|| PHP extension soap must be loaded

I edited php.ini and removed the leading semicolon ( ; ) from extension=php_soap.dll.
After restarting Apache I was able to proceed with the installation without any other issues.

Upgrade magento from 1.7 to latest 1.9.2.4

1st way to upgrade :

Use the Magento Connect method:
Within each Magento installation, you can easily upgrade Magento via Magento Connect. The steps to upgrade via Magento Connect include:

  • Login to the Magento admin
  • Move to system- Magento Connect- Connect manager
  • Login to Magento Connect
  • Click on ‘check for upgrades’
  • Upgrade ‘Mage _All_Latest’. This will upgrade Magento.

2nd way to upgrade:

  1. Take a backup of current database and current 1.7 code. place maintenance.flag file inside 1.7 code folder to put website offline.
  2. Download latest magento from the http://www.magentocommerce.com/download
  3. Remove all folders and files from your 1.7 code except maintenance.flag (but you should have backup somewhere) and place all folders and files from the 1.9.
  4. Now from your 1.7 merge your following custom folders into the 1.9
    • Community app/code/community
    • Local app/code/local
    • Media
    • your theme or package (app/design/frontend/default/<your theme> or app/design/frontend/<your package>)
    • custom folders from Skin (both for adminhtml and frontend).
    • copy your custom xml files from app/etc/modules/ to current app/etc/modules/
    • any custom admin theme folder from adminhtml/default/yourtheme.
    • copy your custom folders from adminhtml/default/default/ (1.7) to adminhtml/default/default/ (1.9).
    • custom js files if any from app/js/.
  5. Now go to app/etc/local.xml.Edit database details their.put your database username and password and database name.
  6. Remove maintenance.flag file and check the site in the browser. it is done.

Magento Code

http://magento-code-snippets.tumblr.com/

||  placing upsells in the product view page
    
     <block type="catalog/product_list_upsell" name="product.info.upsell" as="upsell_products" template="catalog/product/list/upsell.phtml">
          <action method="setColumnCount"><columns>5</columns></action>
          <action method="setItemLimit"><type>upsell</type><limit>5</limit></action>
     </block>
     
     view page: <?php echo $this->getChildHtml('upsell_products'); ?>
     

||  page-title category-title
    catalog > category > view.phtml

||  get product price
    <div class="product_price">  
         <?php $_productCollection=$this->getLoadedProductCollection();
         $productBlock = $this->getLayout()->createBlock('catalog/product_price');
         echo $productBlock->getPriceHtml($_product); ?>
    </div>

||  Configuring numbres of products displayed on the mini cart:
    System > Configuration > under Sales > Checkout > Shopping Cart Sidebar

||  How to enable/disable the demo store notice in Magento.
    System tab > Configuration > Design >  HTML Head > Display Demo Store Notice.
    notice text: page > html > notice.phtml


||  Proceed to Checkout
    app/design/frontend/default/default/template/checkout/onepage/link.phtml


||  Header Top links 
    template/page/template/links.phtml

||  To understand new order id:
    go > db Look in "eav_entity_store" and find increment_last_id.
    Change "increment prefix" to a name that could understood for new order id.
    


||  sales order view All Status in Admin Panel for Comments History:
    go to design/adminhtml/def/def/template/sales/oreder/view/history.phtml

    Replace :	
    <?php foreach ($this->getStatuses() as $_code=>$_label): ?>
    To :
    <?php foreach (Mage::getSingleton('sales/order_config')->getStatuses() as $_code=>$_label): ?>


||  remove white image frame:
    <li><a href="<?php echo $this->getProductUrl()?>" title="<?php echo $this->escapeHtml($this->getProductName()) ?>" class="product-image"><img src="<?php echo $this->getProductThumbnail()->keepFrame(false)->resize(45, 50)->setWatermarkSize('30x10'); ?>" width="45" height="50" alt="<?php echo $this->escapeHtml($this->getProductName()) ?>" /></a></li>

||  wishlist product image size location:
    E:\xampp\htdocs\bbrands\app\design\frontend\bbrands\default\template\wishlist\sidebar.phtml

||  cart page product image size location:
    E:\xampp\htdocs\bbrands\app\design\frontend\bbrands\default\template\checkout\cart\item\default.phtml

||  Mini cart product image size location:
    E:\xampp\htdocs\bbrands\app\design\frontend\bbrands\default\template\checkout\cart\sidebar\default.phtml

||  where is product category  title
    app\design\frontend\default\default\template\catalog\category\view.phtml

||  How to product count:

<!-- total product count -->
    <?php $_helper = $this->helper('catalog/output'); ?>
    <?php $_category_detail = Mage::registry('current_category'); ?>
    <?php $_category_detail->getName(); ?>
    <?php $_category_detail->getId(); ?>
    <p>
        <?php
        $products_count = Mage::getModel('catalog/category')->load($_category_detail->getId())->getProductCount();
        echo'(' . ($products_count) . '&nbsp;' . 'Products Founds)';
        ?>
    </p><!-- count end -->

||	how to set up mobile theme
	iPhone|iPod|BlackBerry|Palm|Googlebot-Mobile|Mobile|mobile|mobi|Windows Mobile|Safari Mobile|Android|Opera Mini

||	<?php echo $this->getChildHtml('topMenu') ?>
	<block type="catalog/navigation" name="catalog.topnav" template="catalog/navigation/top.phtml"/>
	
||   Product total view
	<div class="total_view">
		<?php 

			$id = $id=$_helper->productAttribute($_product, $_product->getId(), 'id');

			$fromDate = '2013-12-10';
			$toDate   = now();
			$viewedProducts = Mage::getResourceModel('reports/product_collection')->addViewsCount($fromDate, $toDate);
			foreach($viewedProducts as $product) {
			if($product->getData('entity_id')==$id)
			{
				echo  "Total View Count: " . $product->getData('views');
			}
		}
		?>
	</div>

||	Checkout page Button Place Order click then ajax loading title Submitting order information 
	app/design/frontend/mypackage/mytheme/template/checkout/onepage/review/info.phtml

||	Edit was added to your shopping cart in magento 
	app/code/core/Mage/Checkout/controllers/CartController.php
	search this :  was added to your shopping cart.

||	Discount Codes
	app/design/frontend/base/default/template/checkout/cart/coupon.phtml


||	Product column count in xml page
	<action method="setColumnCount"><count>3</count></action>


||	How to Remove "Starting at" Price in Magento
	atalog/product/price.phtml
	<span class="price-label"><?php echo $this->__('Starting at:') ?></span>

||	product view page compare & wishlist
	catalog>product>view>addto.phtml

||	product view page add to cart
	catalog>product>view>addtocart.phtml

||	Magento Currency Drop Down only Currency Symbols like BDT, USD >  template/directory/currency.phtml 
    <?php //echo $_name ?> <?php echo $_code ?>

||	Currency symbols from System->Manage Currency->Symbols.

||  Magento Currency Symbol 404's when i go to admin
    solve: Change line 68 in app\code\core\Mage\CurrencySymbol\etc\config.xml
        
    <currencysymbol>Mage_CurrencySymbol_Adminhtml</currencysymbol>
                             To
    <currencysymbol before="Mage_Adminhtml">Mage_CurrencySymbol_Adminhtml</currencysymbol>
         

||	Currency:
	1.catalog.xml or page.xml
	   <block type="directory/currency" name="currency" as="currency" template="directory/currency.phtml"/>
        or
	2.anywhere phtml file
	   <?php echo $this->getLayout()->createBlock('directory/currency')->setTemplate('directory/currency.phtml')->toHtml(); ?>

||  Currency remove: local.xml file
    <catalog_category_default><remove name="currency" /></catalog_category_default>
	
	

||	clear shopping cart & Update Shopping Cart is not working 
	---> In your /app/design/frontend/yourthemepackage/default/template/checkout/cart.phtml file or /app/design/frontend/default/yourtheme/template/checkout/cart.phtml file
		 Just place on line 50 just after getUrl('checkout/cart/updatePost') ?>" method="post"> paste the below code
		 <?php echo $this->getBlockHtml('formkey'); ?>


||	Login frontend edit
	app/design/frontend/base/template/persistent/customer/form/login.php

		 
||	Checkout Login edit frontend (CHECKOUT AS A GUEST OR REGISTER)
	app/design/frontend/base/template/persistent/checkout/onepage/login.phtml


||	Product url:
	<?php echo $_product->getProductUrl() ?>

||	name :
	<?php echo $this->__('Go') ?>

||	Default product image
	1. System > Configuration > Catalog > Product Image Placeholders
	2. skin\frontend\default\mytheme\images\catalog\product\placeholder

||	Adding Links to your topLinks
	app/design/frontend/<yourtheme>/default/template/page/template/links.phtml

||	page > html >breadcrumbs.phtml

||	Only Contact Us page breadcrumbs:layout>contacts.xml
	<reference name="root">
	  <action method="unsetChild"><alias>breadcrumbs</alias></action>
		<block type="page/html_breadcrumbs" name="breadcrumbs" as="breadcrumbs">
			<action method="addCrumb">
			  <crumbName>home</crumbName>
			  <crumbInfo><label>Home</label><title>Home</title><link>/</link></crumbInfo>
			</action> 
			<action method="addCrumb">
			  <crumbName>contacts</crumbName>
			  <crumbInfo><label>Contact us</label><title>Contact us</title></crumbInfo>
			</action>
	  </block>
	  <action method="setTemplate"><template>page/empty.phtml</template></action>
	  <action method="setHeaderTitle" translate="title" module="contacts"><title>Contact Us</title></action>
	</reference>

	
||	Breadcrumbs>page.xml:
	<label>Breadcrumbs</label> 
	<label>Main Content Area</label>


||	Breadcrumbs Adding to cms pages in Magento:
	<?php
	if ((!$crumbs || !is_array($crumbs)) && $this->getUrl('')!= $this->getUrl('*/*/*', array('_current'=>true, '_use_rewrite'=>true))) {
		$breadcrumb = $this->getLayout()->getBlock('breadcrumbs');
		$breadcrumb->addCrumb('home', array('label' => Mage::helper('cms')->__('Home'), 'title' => Mage::helper('cms')->__('Home Page'), 'link' => Mage::getBaseUrl()));
		$breadcrumb->addCrumb('my_account activeBreadcrumb', array('label' => $this->getLayout()->getBlock('head')->getTitle(), 'title' => $this->getLayout()->getBlock('head')->getTitle(), 'last' => 1));
		$crumbs = $breadcrumb->_crumbs;
	 
	}
	?>

||	Showing Breadcrums anywhere in Magento:
	<?php echo $this->getLayout()->getBlock('breadcrumbs')->toHtml()?>
	

||	if you want to condition that the slide show only home page:
        
        // If it is the home page, then just show up on the home page, other pages don't show 
	||  <?php if( Mage::getSingleton('cms/page')->getIdentifier()=='home') :?>
        <div class=""></div>    
		<?php endif;?>
	or
	   // if it is the home page, then don't show up on the home page, other pages show up 
	||	<?php if(!(Mage::getSingleton('cms/page')->getIdentifier() == 'home'  && Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms')) : ?>
	

||	Short Description
	<?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?>

||	Product Detail page Description
	<?php
		$my_product = Mage::getModel('catalog/product')->load($_product->getId());
		echo $my_product->getDescription();
	?>

||	How to get attribute name and value?
	<p class="attribute"><?php echo "Author:".$attributeValue = Mage::getModel('catalog/product')->load($_product->getId())->getAttributeText('author');?></p>

||	One Page Checkout Success 2column
	---> app\design\frontend\default\default\layout\checkout.xml
		 <label>One Page Checkout Success</label>

||	Product Url
	<a href="<?php echo $_product->getProductUrl() ?>">Product Details</a>

||	Forgot Your Password? column layout->
	customer.xml

||	Admin Change(xampp\htdocs\onlinesales\app\design\adminhtml\default\default\template)-
	1. login.phtml file:69 line
	2. forgotpassword.phtml file: 64 line
	<p class="legal"><?php echo Mage::helper('adminhtml')->__('Copyright &copy; FSB.', date('Y')) ?></p>

||	Search Bar Anywhere
	<?php echo $this->getLayout()->createBlock('core/template')->setTemplate('catalogsearch/form.mini.phtml')->toHtml();?>	

||	Advanced Search
	<a href="<?php echo $this->getUrl('catalogsearch/advanced/')?>"><?php echo $this->__('Advanced Search');?></a>

||	call name<li><a href="<?php echo $this->getUrl('');?>"><?php echo $this->__('Home');?></a></li>

||	media img src for phtml
	<img alt="author" src="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);?>/wysiwyg/author/Humayun-ahmed.jpg">

||	media img src for block:
	<a href="{{store url=''}}"><img src="{{media url='folder/sub1.jpg'}}" alt="" /></a>

||	page.xml:
	<block type="page/html" name="root" output="toHtml" template="page/3columns.phtml">


||	how to call topmenu.phtml in 2columns-left.phtml page
	<?php echo $this->getLayout()->createBlock('page/html_topmenu')->setTemplate('page/html/topmenu.phtml')->toHtml();?>

||	Diaplay SKU On The Product view Page:
	<p class="p_code">Product Code: <?php echo nl2br($_product->getSku()) ?></p>
	<?php echo $this->htmlEscape($_product->getSku()) ?>
	<?php echo $sku = Mage::getModel('catalog/product')->load($_product->getId())->getSku();?>


<-- Product Name call --->
<?php echo Mage::getModel('catalog/category')->load(20)->getName(); ?>

<-- Name & view more link-->
<?php $cate_id = 15; ?>
<h2><?php echo Mage::getModel('catalog/category')->load($cate_id)->getName(); ?> <a href="<?php echo Mage::getModel('catalog/category')->load($cate_id)->getUrl(); ?>"><?php echo $this->__('View More')?></a></h2>

||	product in phtml-page:
	<?php echo $this->getLayout()->createBlock('catalog/product_list')->setCategoryId(3)->setTemplate('catalog/product/list.phtml')->toHtml();?>

||	product in home page from Block
	{{block type="catalog/product_list" category_id="3" template="catalog/product/list.phtml"}}
		or
	{{block type="catalog/product_list" column_count="4" category_id="45" limit="16" template="catalog/product/custom_scroll.phtml"}}

||	<?php $_columnCount = 4 //$this->getColumnCount(); ?>	

||	block call
	<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('opcontent')->toHtml() ?> 

||	cms page link:
	<div class="home_page">{{block type="core/template"template="page/home.phtml"}}</div>

||	catalog.xml>
	<!--Category default layout-->
	<!--Category layered navigation layout-->
	<action method="setColumnCount"><count>4</count></action>

||	no conflict jequry:
	$j = jQuery.noConflict();

||	Home page>phtml page link:
	<div class="custom_menu">
		<link rel="stylesheet" type="text/css" href="<?php echo $this->getSkinUrl('navigation/css/nav.css');?>" media="all" />
		<?php echo $this->getLayout()->createBlock('navigation/navigation')->setTemplate('navigation/left.phtml')->toHtml() ?>
	</div>

||	compare:
	<?php echo $this->getLayout()->createBlock('catalog/product_compare_sidebar')->setTemplate('catalog/product/compare/sidebar.phtml')->toHtml();?>

||	show mycart in home page from block:
	{{block type="checkout/cart_sidebar" template="checkout/cart/sidebar.phtml"}}

||	mycart xml page
	<block type="checkout/cart_sidebar" name="checkout/cart_sidebar" template="checkout/cart/sidebar.phtml"/>		
	
||	Mycart:
	<?php echo $this->getLayout()->createBlock('checkout/cart_sidebar')->setTemplate('checkout/cart/sidebar.phtml')->toHtml();?>

||	Newsletter in phtml:
	<?php echo $this->getLayout()->createBlock('newsletter/subscribe')->setTemplate('newsletter/subscribe.phtml')->toHtml();?>
	or
	<?php echo $this->getChildHtml('newsletter') ?>

||	show newsletter from block:
	{{block type="newsletter/subscribe" template="newsletter/subscribe.phtml"}}

||	Wishlist:
	<?php echo $this->getLayout()->createBlock('wishlist/customer_wishlist')->setTemplate('wishlist/sidebar.phtml')->toHtml();?>

||	Wishlist href link:
	<?php echo $this->helper('wishlist')->getListUrl()?> 

||	gaterthen code &gt; 

||	copyright code &copy;

||	Cart Count:
	<span class="my_bag"><a href="<?php echo Mage::helper('checkout/cart')->getCartUrl(); ?>">My Bag <?php $testc=Mage::helper('checkout/cart')->getItemsCount(); if($testc==0){echo "Empty";} else{ echo $testc;}?></a></span>
	<?php echo Mage::helper('checkout/cart')->getItemsCount();?>

||	Cart total amount 	
	<?php
		$grandTotal = Mage::helper('checkout/cart')->getQuote()->getGrandTotal();
		$text = $this->__('%s', Mage::helper('core')->formatPrice($grandTotal, false));
	?>
	<span class="head_amount"><?php echo $text; ?></span>
	
	
||	Can I use multiple versions of jQuery on the same page?
	Ans:http://stackoverflow.com/questions/1566595/can-i-use-multiple-versions-of-jquery-on-the-same-page
	<!-- load jQuery 1.1.3 -->
	<script type="text/javascript" src="http://example.com/jquery-1.1.3.js"></script>
	<script type="text/javascript">
	   var jQuery_1_1_3 = $.noConflict(true);
	</script>

	<!-- load jQuery 1.3.2 -->
	<script type="text/javascript" src="http://example.com/jquery-1.3.2.js"></script>
	<script type="text/javascript">
	   var jQuery_1_3_2 = $.noConflict(true);
	</script>


||	mage media link magento:
	<?php
	$media 	 = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
	$regFile = $media.'reg/regi.pdf';
	?><a href="<?php echo $regFile;?>">Download</a>

||	How to add related products tab in products detail page
		1.Go layout\catalog.xml
		search this> <block type="catalog/product_view_tabs" name="product.info.tabs" as="info_tabs" template="catalog/product/view/tabs.phtml" >
		2.<action method="addTab" translate="title" module="catalog"><alias>related</alias><title>Related Product</title><block>catalog/product_list_related</block><template>catalog/product/view/related.phtml</template></action>
		3.catalog\product\view>related.phtml page create and in this page <?php echo $this->getLayout()->getBlock('catalog.product.related')->toHtml()?> paste
		4.Related product image size (catalog\product\list\ralated.phtml)
		5.If you don't see output, you have to do must be cash refresh and logout

||	Display Related products in product details page:
	<?php //echo $this->getChildHtml('related'); ?>
	<?php //echo $this->getChildHtml('catalog.product.related') ?>
	<?php echo $this->getLayout()->getBlock('catalog.product.related')->toHtml()?>

	
||	Login & Logout:
	<ul>
		<?php if (Mage::getSingleton('customer/session')->isLoggedIn()==1): ?>
		<li class="first"><a title="Log Out" href="<?php echo $this->getUrl('customer/account/logout') ?>">Log Out</a></li>
		<?php else:?>
		<li class="first"><a title="Log In" href="<?php echo $this->getUrl('customer/account/login') ?>">Log In</a></li> | 
		<li class=""><a title="Register" href="<?php echo $this->getUrl('customer/account/create') ?>">Register</a></li> |
		<?php endif;?>
		<li><p>or create an<a href="<?php echo $this->getUrl('customer/account');?>">Account</a></p></li>
	</ul>

||	product onmouseover:
	<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->constrainOnly(FALSE)->keepAspectRatio(TRUE)->keepFrame(true)->resize(192,224); ?>" width="192" height="224" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" onmouseover="this.src='<?php echo $this->helper('catalog/image')->init($_product, 'thumbnail')->constrainOnly(FALSE)->keepAspectRatio(TRUE)->keepFrame(true)->resize(192,224) ?>';" onmouseout="this.src='<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->constrainOnly(FALSE)->keepAspectRatio(TRUE)->keepFrame(true)->resize(192,224) ?>';" /></a>

||	Audio song added code:
	<div style="position:fixed; top:0; right:0; " class="auido_play">
		<audio loop="true" autoplay="autoplay" controls="controls">
			<source type="audio/wav" src="<?php echo $this->getSkinUrl('css/song.mp3');?>"></source>
		</audio> 
	</div>
	<embed src="<?php //echo $this->getSkinUrl('css/song.mp3');?>" autostart="true" loop="true"width="2" height="0"></embed> 
	<a href="<?php //echo $this->getSkinUrl('css/song.mp3');?>">Play music</a>


||	Online Visitor and Total Visitors in Magento:
	<?php
	$visitor_count = Mage::getModel('log/visitor_online')->prepare()->getCollection()->count();
	if(!empty($visitor_count) && $visitor_count > 0)
	{
		$cnt =  $visitor_count;
		echo 'Visitors online :'.$cnt;
	}
	$write = Mage::getSingleton('core/resource')->getConnection('core_write');
	$readresult=$write->query("SELECT * FROM log_visitor ORDER BY visitor_id DESC LIMIT 1 ");
	while ($row = $readresult->fetch() )
	{
		echo "Total Visitors".$row['visitor_id'];
	}
	?> 

||	Online Visitor from BBrands:
	<?php
		 $visitor_count = Mage::getModel('log/visitor_online')->prepare()->getCollection()->count();
		 if(!empty($visitor_count) && $visitor_count > 0)
		 {
			echo $visitor_count.' Online Visitors'; 
		 }
	?>

Dynamic Menu

<!-----This is for All menu----->
<?php 
$rootcatId= Mage::app()->getStore()->getRootCategoryId(); 
$categories = Mage::getModel('catalog/category')->getCategories($rootcatId);
function  get_categories($categories) {
    $array= '<ul>';
    foreach($categories as $category) {
        $cat = Mage::getModel('catalog/category')->load($category->getId());
        $count = $cat->getProductCount();
        $array .= '<li>'.
        '<a href="' . Mage::getUrl($cat->getUrlPath()). '">' . 
                  $category->getName() . "(".$count.")</a>\n";
        if($category->hasChildren()) {
            $children = Mage::getModel('catalog/category')->getCategories($category->getId());
             $array .=  get_categories($children);
            }
         $array .= '</li>';
    }
    return  $array . '</ul>';
}
echo  get_categories($categories); 
echo "<div class=\"clearer\"></div>";
?>
<!------End------->

<!------Only Current Menu > submenu-------->
<div class="left_menu">
	<?php
		$routeDetect = Mage::app()->getFrontController()->getRequest()->getRouteName();
		if($routeDetect == 'catalog') :
	?>
	<div class="block block-whishlist">
		<div class="block-title">
			<strong><span>Current Categories</span></strong>
		</div>
		<div class="block-content">
			<?php	
				$_current_category =Mage::registry('current_category')->getId();
				$collection = Mage::getModel('catalog/category')->getCategories($_current_category);
				$helper     = Mage::helper('catalog/category');	
			?>
			<ul>
				<?php foreach ($collection as $cat):?>
					<?php if($cat->getIsActive()):?>
						<li style="border-bottom: 1px solid #ddd">
							<a href="<?php echo $helper->getCategoryUrl($cat);?>">             
								<cite><?php echo $cat->getName();?></cite>
							</a>
							<?php
								$collection_sub = Mage::getModel('catalog/category')->getCategories($cat->getId());									
							?>
							<ul>
								<?php foreach ($collection_sub as $sub):?>
									<?php if($sub->getIsActive()):?>
										<li border-bottom: 1px solid #ddd>
											<a href="<?php echo $helper->getCategoryUrl($sub);?>">             
											&nbsp;<cite><?php echo $sub->getName();?></cite>
											</a>
										</li>	
									<?php endif;?>
								<?php endforeach;?>	
							</ul>		
						</li>
					<?php endif;?>
				<?php endforeach;?>
			</ul>	
		</div>
	</div>
	<?php endif;?>							
	<?php
		$routeDetect = Mage::app()->getFrontController()->getRequest()->getRouteName();
		if($routeDetect != 'customer') :
	?>
	<?php endif;?>
</div>
<!---------End--------->