Magento: Authorize.net not displayed in Payment Information section while Checkout

Scenario: I have enabled Authorize.net payment method but it is not displayed in Payment Information section while Checkout. Problem: In the class Mage_Paygate_Model_Authorizenet, you will find the following variable:- protected $_allowCurrencyCode = array('USD'); It means, the allowed currency for Authorize.net is only US Dollar (USD). You have to add the currency code to the above … Read more

Magento: Enable Cookies Problem

Problem: When I try to add products to shopping cart, I get redirected to enable-cookies CMS page. Similarly, when I try to login as customer from customer account login, I get redirected to the same (enable-cookies) page. The enable-cookies page asks me to enable cookies in my browser. The message says: Please enable cookies in … Read more

Magento: How to get most viewed products?

Here, I will show you the code to get the most viewed products in Magento. The function addViewsCount() filters the products with their views count. Here is the code:- Get overall Most viewed products public function getMostViewedProducts() { /** * Number of products to display * You may change it to your desired value */ … Read more

Magento: Get Product Collection by Type

Products can be of different types in Magento. The different product types are Simple Product, Configurable Product, Bundle Product, Grouped Product, Downloadable Product, and Virtual Product. For example: Chair can be a Simple Product. Shoes can be of different color and size. So, shoes falls under Configurable product. A downloadable mp3 music file will fall … Read more

Magento: Setup multiple currency shop

You can easily setup a multiple currency shop in Magento. By multiple currency shop, I mean giving the user to browse products in different currencies. Magento will provide a currency dropdown in category and product listing page. When you select your desired currency, the entire products price will be changed to your selected currency. Here … Read more

Magento: Crop image

Here is a quick tip to crop image to any degree of your choice in Magento. The crop function of Varien_Image does the magic :) Here goes the code: $mainImage = Mage::getBaseDir('media') . DS . 'test' . DS . 'image.jpg'; $image = new Varien_Image($mainImage); // crop image // crop($top=0, $left=0, $right=0, $bottom=0) $image->crop(10, 10, 10, … Read more

Magento: Rotate image

Here is a quick tip to rotate image to any degree of your choice in Magento. The rotate function of Varien_Image does the magic :) Here goes the code: $mainImage = Mage::getBaseDir('media') . DS . 'test' . DS . 'image.jpg'; $image = new Varien_Image($mainImage); // rotate image with the angle of your choice // rotate($angle) … Read more

Magento: Admin Controller Override

I had to override adminhtml controller class (Mage_Adminhtml_System_ConfigController) with my module’s controller class (MyNamespace_MyModule_ConfigController). It was really tough to find the right solution. I googled, searched in magentocommerce forum and found a lot of solutions. But they didn’t work for me. After searching & trying more, I got some work done with the following piece … Read more