Magento: Show Currency Selector in header

Here, I will show you how you can change the location of currency selector to header in Magento. I suppose that you have already enabled/setup Multiple Currency in your Magento shop. If not then here is how to do it:- Magento: Setup multiple currency shop By default, the currency selector is displayed in the left … Read more

Magento: Show Currency Selector in right sidebar

Here, I will show you how you can change the location of currency selector in Magento. I suppose that you have already enabled/setup Multiple Currency in your Magento shop. If not then here is how to do it:- Magento: Setup multiple currency shop By default, the currency selector is displayed in the left sidebar. Here, … Read more

Magento: Recoverable Error: Argument 1 passed to Mage_Core_Model_Store :: setWebsite() must be an instance of Mage_Core_Model_Website

Problem: I was transfering Magento files and database from one server to another. I did complete all the transfer process of files and also exported and imported the database. After that, when I tried to access the site, I got the following error:- Recoverable Error: Argument 1 passed to Mage_Core_Model_Store::setWebsite() must be an instance of … Read more

Magento: How to select, insert, update, and delete data?

Here, I will be showing how to select, insert/add, update/edit and delete data in the Magento way. It’s about implementing the CRUD (Create Read Update Delete) concept. :) Suppose, I have a database table named ‘news‘ with the following fields:- id : int, auto increment, primary key title : varchar content : text status : … Read more

Magento: Setup Multiple Website

This step-by-step tutorial will guide you to create multiple websites in Magento. I suppose that Magento is installed in the website’s root folder. Let’s assume the website URL to be your-website.com. Magento is already installed in your-website.com. Now, we will be setting up for new website from Magento admin. Let our new website be your-new-website.com. … Read more

Magento: PayPal Website Payments Standard not displayed

Problem: PayPal payment method is not displayed in payment method section of onepage checkout in Magento. I am using “PayPal Website Payments Standard“. I have enabled this module from backend. System -> Configuration -> SALES -> Payment Methods -> PayPal Website Payments Standard. Cause: The possible cause is because base currency of your shop is … Read more

Magento: Adding category attributes

Here, I will be showing you how you can add attributes for your categories in Magento. From the admin panel, you can only add attributes to product. To add attributes to category, you need to write sql query in your phpmyadmin or a better way would be creating a new custom module and adding attributes … Read more

Magento: Set Random Order in Collection using RAND()

Scenario: You have created a custom module. You have entered certain data in your database. You need to show the data randomly. Solution: In MySQL the rand() function helps the select query to fetch data randomly. In Magento, you can select random rows from MySQL table using Zend_Db_Expr(‘RAND()’). You have to create a new function … Read more

Magento: Very Useful Collection Functions

There are different important functions that you can implement in your Collection object. The functions are present in Varien_Data_Collection_Db class. The class file is present in lib/Varien/Data/Collection/Db.php Here are some of the functions that you can use in your collection object:- /** * Get Zend_Db_Select instance */ $collection->getSelect(); /** * Get collection size */ $collection->getSelect()->getSize(); … Read more