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, and comment the lines from 77 to 94 so it will look like: and save it and now try to login in admin panel. 100% you get...

 

In this post I simply showing how to find the cursor position in the window screen. function showPositionOnClick(evt) { var e = (window.event) ? window.event : evt; alert(e.clientX); } When user click on this button an event fired and it shows the position of the cursor. This code is running is both Firefox and...

 

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 loginPostAction() and Replace with: public function loginPostAction() { if ($this->_getSession()->isLoggedIn()) { $this->_redirect(’*/*/’); return; } $session = $this->_getSession(); if ($this->getRequest()->isPost()) { $login =...

 

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 Symbol : <?php echo Mage::app()->getLocale()->currency(Mage::app()->getStore()->getCurrentCurrencyCode())->getSymbol(); ?>

 

If you want to show product thumbnail on any page in your requirement size then At the showing page : <img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(100, 100) ?>" border="0" alt="<?php echo $this->htmlEscape($_product->getName()) ?>" /> Change 100, 100 to your X, Y Where X : your requirement width and Y : Requirement height.

 

There’s a little confusion among some on how to import products into a Magento ecommerce store. I spent some time today researching and trying to find the best method on doing this. The reason for my research is because there was no simple documentation anywhere that I could find on how to import products. Magento actually has built a pretty robust import/export mechanism into the ecommerce cms that has a ton of flexibility to do many things. I’m not going to cover all of those. This is...

 

window.location and window.location.href will support to all browsers but it will not support to IE6. For this I have a solution: Suppose you code is : window.location = "http://naveenos.com/"; // Not working??? // Also this does not working?? window.location.href ="http://naveenos.com/"; Then do this, setTimeout(function() { window.location = "http://naveenos.com/"; }, 0);

 

To create a site in multiple languages you should do two main things : Write this code after connection created in database file : mysql_query ( 'SET character_set_connection=utf8, character_set_results=utf8, character_set_client=binary;', $connectionID ); And write below code in common file which use in complete site : header('Content-Type: text/html; charset=ISO-8859-1');

 

What is jQuery? Directly taken from the website of jQuery -” jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages”.It is basically a JavaScript framework for writing huge task of JavaScript with few lines of code. What are the benefits of jQuery? 1) 5 lines of code of jQuery can perform better task than 25 lines of traditional Javascript code. 2) Various number...

 

What is the difference between plugins and widgets? Plugins are functions that do something to your website. They could serve a back-end purpose and never be visible to you or the public. In the other hand, a widget usually is the representation of a plugin in the form of an object that can be placed somewhere on your website via the widgets interface under the appearance menu. Widgets are always plugins, but plugins don’t always have widgets. A widget usually is a pretty and...

 

I want to get two fields value in a single value and I searched on net many times but today I try to solve at my behalf and I got the solution. Here you will get the solution to get the two fields value as single value: For example: Database :  db_bank Table :  tbl_customer Fields :  id,  first_name,  last_name And you want to get first_name and last_name as CustomerName then, SQL should be: SELECT CONCAT( cus.first_name, cus.last_name ) AS CustomerName FROM...

 

I’m going to show you a example in php and ajax to change the values of the dropdown’s options without refreshing the page. The values (options) of the dropdown are fetched from the database and the certain portion of the web pages is only refreshed without need to refresh the whole page. Let’s start with creating the two tables country and city and insert some data CREATE TABLE country ( id tinyint(4) NOT NULL auto_increment, country varchar(20) NOT NULL default '', ...

 

How are you controlling the case of the characters in your project. Talking about me, I was using ucwords() function of PHP to control the case of the characters when required. Today, I come to know two new property of CSS which controls the output of the case of the characters of the words. You can control the characters using “text-transform” and “font-variant” property of the CSS to do this. You can change the characters of words to upper case, lower case and capitalize the...

 

What is 301 redirect ? You have a website and its all pages are ranked in the search engine. And now you’ve moved these files to a new domain. What will happen in this scenario!!. You are sending the visitor to “Error 404 – File not found” page when they follow your website in the search engine. Furthermore, if you place the custom error page, then also you will be keep loosing ranking in upcoming days in search engines as the original file could not be found in the old URL. So what is...

 

Do you want to hide your web site’s server script identity ? If you don’t want to reveal the programming language ( server side script ) of your website to visitors of website so that any hacker or spammer will not be able to intrude or inject any code in your website. Here is a small technique for you, you can use .html or .asp file to work as a php file i.e. use .asp or .html extension instead of .php. You just need to create a .htaccess file and put the following code in the .htaccess...

 

I’ve seen that many of my friends are struggling with the uploads of the bigger or larger files in PHP. After looking at their struggle, i’m here to solve the problem of uploading larger or bigger files in PHP. Most of the web servers are configured such a way that a user can only upload the maximum file size of 2MB. So there might be the problem for the people who wants to upload the .pdf file of size around 15MB. But, you can increse the maximum upload file size limit by using .htaccess...