Magento: Language Translation for Custom Module [Step-by-Step Guide]

This article shows how you can create and use custom language translation csv file for your custom module. Suppose, I have created a new module and I want language translation file particularly for my newly made module. Here is how we do it:- In this example, Namespace: Chapagain Module Name: News 1) In config.xml file … Read more

Google Adsense: Describing CTR, CPC, CPM, RPM, Page views & Impression

Google Adsense is a very popular program for earning money online. Google Adsense generate revenue on either a per-click or per-impression basis. In this article, I will be describing some of the key terms of Google Analytics. They are Clickthrough rate (CTR), Cost-per-click (CPC), Cost-per-thousand (CPM), and Revenue per thousand impressions (RPM). Before understanding these … Read more

Magento: Solution of Invalid method Mage_Catalog_Block_Product_List_Toolbar :: isLastPage

While upgrading Magento, I got this error when I go to product list page. It says: Invalid method Mage_Catalog_Block_Product_List_Toolbar::isLastPage(Array()) Solution: I found 4 kinds of solution. This first one works & is easy. #1. – Open /app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php – Replace the parent class name From: class Mage_Catalog_Block_Product_List_Toolbar extends Mage_Core_Block_Template To: class Mage_Catalog_Block_Product_List_Toolbar extends Mage_Page_Block_Html_Pager This second … Read more

Magento: Solution of Warning: Invalid argument supplied for foreach() in …list.phtml

While upgrading Magento, I am getting this error when I go to product list page. Error: Warning: Invalid argument supplied for foreach() in …/template/catalog/product/list/toolbar.phtml Solution: Open layout/catalog.xml Find this: <block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml"> Just below the above code, add the code below: <block type="page/html_pager" name="product_list_toolbar_pager" /> Open template/catalog/product/list/toolbar.phtml Comment out some lines of code and … Read more

Magento: Cron Jobs Setup for Custom Module

Cron Job is used to perform any action in a certain interval of time. In a Magento webshop, there are certain tasks that needs cron jobs to be run, i.e. these tasks/actions need to be performed periodically. Here are some of them:- – Refreshing Catalog Price Rules – Sending Newsletters to customers – Generating Google … Read more

Magento: Get Product by SKU

Here is a quick code to get product information with SKU value. Get product information by sku // Get product by sku $sku = "microsoftnatural"; $product = Mage::getModel('catalog/product') ->loadByAttribute('sku', $sku); // print product data echo "<pre>"; print_r($product->getData()); echo "</pre>"; Get product id by sku $productIdBySku = Mage::getModel('catalog/product') ->getIdBySku('microsoftnatural'); echo $productIdBySku; Hope it helps. Thanks.

Magento: Solution for Google Analytics not tracking website

I had an old version of Magento. I had enabled google analytics tracking from Magento admin. But, google analytics was not tracking my webshop. The main reason behind this was that Google had modified its analytics tracking code and the GoogleAnalytics core module of Magento had old tracking code. To fix this issue, do the … Read more

Google Search result has stopped displaying my website/blog [Cause & Solution]

Problem: My website/blog had a good visit per day and it was also ranking good on Alexa. However, recently the per day visit has dropped drastically. And, alexa ranking is also dropping gradually day by day. Cause: There are many reasons for poor ranking in google search result. Some of them are:- – Navigation problem … Read more