Magento: Creating Varien Object & Collection from any Array data

Varien_Object and Varien_Collection are the parent/super class for most of the Magento Models and Collections respectively. The path for Varien_Object is lib/Varien/Object & for Varien_Collection is lib/Varien/Data/Collection.php. This article shows how you can create new Varien objects and collections from any array or object data you have. Here is the code:- /** * Creating new … Read more

Auto Currency Switcher: Magento Extension [FREE]

Auto Currency Switcher is a currency switcher extension which automatically switches store currency based on visitor’s IP address. This module is compatible with Magento version 1.3 and later (Magento 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9). Auto Currency Switcher extension tracks visitor’s IP address and automatically changes the store currency to the visitor’s location currency. … Read more

Magento: Paypal Express Checkout Showing Empty Order Data [FIXED]

I am using Magento verion 1.4.0.1 and I had this issue. I had enabled Paypal Express Checkout payment method. When I choose this method on checkout, I was redirected to Paypal website but order data was not displayed there. The main reason in my case was due to applied discount to the cart. I had … Read more

Magento: Download product links instead of opening in browser

Scenario: I have a downloadable product. After I order the product and when my order is complete, I am able to download the product links from ‘My Downloadable Products’ menu in Customer Account section. I go to ‘My Downloadable Products’ section and I click on the links to download. However, the PDF file opens in … Read more

Magento: Override default language translation

This article shows how you can override the default language texts. For example, you want to change the following texts:- – Customer ‘Account Information’ to ‘Your Account Info’ – Checkout ‘Billing Information’ to ‘Your Billing Information’ For this, you have to:- 1) Open app/design/frontend/default/default/locale/en_US/translate.csv (the location of this file may vary according to template package, … Read more

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

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