As you already might have noticed, there are many modules in Magento which has file uploading facility in admin end. I had to make a custom form for file uploading in Magento in frontend, I am explaining here the way to upload a file. Magento has a class (Varien_File_Uploader) defined for this purpose. The class […]
Tag: Magento
Magento E-Commerce
Category and Product SOAP API in Magento
In one of my post I explained the basics of SOAP API, please refer Magento SOAP API before proceeding further I am listing here the methods to create Categories and Products using SOAP API 1) Category a) Category Creation b) Category deletion 2) Product a) Product Creation b) Product Updation b) Product Deletion 3) Assigning […]
Payment Methods in Magento
These days I am working on Payment Module. I am writing here the code which is useful and related to Payment module 1) To fetch the existing Payment Methods There is a payment module helper file existing in default Magento, which is really very helpful. Path – app/code/core/Mage/Payment/Helper/Data.php 2) To fetch only enable Payment Methods […]
Get Table Name in Magento
I am writing here a small but useful snippet of code, for getting the table name of any module (whose table name are defined in config file). This is very useful when using joins in query. Suppose my module is ‘vendor’.
Website ID from Store Group ID in Magento
Hello All, I am posting here code for fetching website information from Store Group Id. Also useful code showing relations between Stores, Groups and Websites.
Ajax in Magento
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 […]
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 […]