Archive for March, 2011

Some Common Fixes of Magento

  1. I need to change the url that my site is defaulted to
    1. in phpmyadmin go to table core_config_data and edit base url fields to what you want
  2. A variety of Magento issues can be resolved by deleting cache
    1. to easily delete cache go to the /var folder and delete the /cache folder
  3. How to setup a Contact Us Page
    1. Paste this into a CMS page
      2. {{block type=’core/template’ name=’contactForm’ template=’contacts/form.phtml’}}
      3. <!– CONTACT FORM CODE END–>
  4. How to Change the database a Magento Install is pointing to
    1. go to app/etc/local.xml
    2. edit the information on this page, save and upload

for more magento tutorial visit:


How To Setup Google Adwords Conversion Tracking in magento

Today One of  my  project i have added google  adwords. So i want to share this to everyone. this is very simple only two steps

One Step-01:

open this file


then paste this code in the bottom of success.phtml file

 $order_details =  Mage::getModel(‘sales/order’)->loadByIncrementId(Mage::getSingleton(‘checkout/session’)->getLastRealOrderId());
 $adwords_saleamt = $order_details->subtotal;

then login into google account

Under the “Reporting’ tab, click on “Conversions” and follow the steps to get the code that you’ll also need to add to the success.phtml page. It will look something like this:

<!– Google Code for Sale Conversion Page –>
 <script type=”text/javascript”>
 var google_conversion_id = 0987654321;
 var google_conversion_language = “en”;
 var google_conversion_format = “3″;
 var google_conversion_color = “ffffff”;
 var google_conversion_label = “KFKFKFKFKFKF”;
 var google_conversion_value = 0;
 if (<?php echo $adwords_saleamt; ?>) {
 google_conversion_value = <?php echo $adwords_saleamt; ?>;
 <script type=”text/javascript” src=””>
 <div style=”display:inline;”>
 <img height=”1″ width=”1″ style=”border-style:none;” alt=”"  src=”;label=KFKFKFKFKFKF&amp;guid=ON&amp;script=0″/>

now paste this getting code in the bottom of success.phtml page.

that okay and it is finished


for more magento tutorial visit:

Selecting data from database using Magento

<pre>// display all regions defined for the United States
$sql = "SELECT * FROM directory_country_region WHERE country_id='US'";
$connection = Mage::getSingleton('core/resource')->getConnection('core_read');
foreach ($connection->fetchAll($sql) as $arr_row) {
	echo $arr_row['default_name'];

for more magento tutorial visit:

Inserting Data in magento using raw PHP

<pre>// insert a new US State into the region table
$sql = "INSERT INTO `directory_country_region` (`region_id`,`country_id`,`code`,`default_name`) VALUES (NULL,'US','XX','New US State')";
$connection = Mage::getSingleton('core/resource')->getConnection('core_write');

for more magento tutorial visit: