There are some instances when we are required to use Ajax features in Magento. Prototype javascript library used in Magento has inbuilt functionality for Ajax. I am describing here the basic method to use ajax. I have used version 1.6.0.0 of Magento. I am using the existing Contacts module for explanation, you can make any […]
Category: Magento
Everything related to Magento eCommerce
Root Category in Magento
In Magento, products are assigned to Website, though we can disable the product in independent store, but this is very lengthy procedure as you need to edit each and every products. So I came up with the solution to restrict the display of categories and products, though if you assign different Root Catalog to different […]
Order Profit column in Magento
I am explaining here the way to add a Profit column in Order grid seen in admin-end This column will show the profit gained per order (i.e, the difference between Cost and Selling Price) 1) Copy the app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php file to app/code/local/Mage/Adminhtml/Block/Sales/Order/Grid.php, by maintaining the directory structure 2) There is a protected function _prepareColumns, kindly paste […]
Custom Email Templates in Magento
Hello, I am explaining here the method for sending custom emails using the custom email templates with variables. 1) Create an email template from Admin-end > System > Transactional Emails, for example lets put this as Template Content 2) Suppose the id of the template created is 3 3) Below code you can write in […]
Empty Cart in Magento
In one of my project, I needed to explicity delete the items from cart after order placed. You can also use this script for making a functionlity for giving an option for empting the cart at once from cart page. Here is the script for the same. Place it in function ‘successAction’ in app\code\local\Mage\Checkout\controllers\OnepageController.php (copy […]
Product Quantity in Magento
For one of my project I needed to display the total quantities ordered in Products lifetime in product view page. Here is the code Hope this is helpful.
Grid filters in Magento
Since last few days I am working on a custom admin module, and was required to make a functionality related to Filters. The functionality was such that I needed to fetch the filters inserted in the Grid, that is if we are searching records with names like ‘john’, so here ‘john’ will be filter. Now […]
Country and States in Magento
Hello All, Magento has inbuilt model for Country and State as seen in Checkout page. In checkout page if you select Country like ‘France’ , a drop down will be seen in place of textbox for States. I am writing here the code to directly get country name from ID and also to get States […]
Disable ‘Billing Agreements’ and ‘Recurring Profiles’ in Magento
Hello All , From the new functionalities introduced from Magento 1.4.1.0 , two are ‘Billing Agreements’ and ‘Recurring Profiles’ Sad thing is that this cannot be disabled from admin completly. For hiding the links from the navigation in ‘My Account’ section of Customer, you can copy billing_agreement.xml and recurring_profile.xml from /app/design/frontend/base/default/layout/sales/ to /app/design/frontend/default/yourtheme/layout/sales/. After copying […]
Email Addresses in Magento
In Magento in adminend (Adminend > System > Configuration > Store Email Addresses) we have a section for storing various store email addresses used in sections like Orders,Sales etc Sometime need arises to get the values of these fields in our custom script I am writing here the script to get these values Hope its […]