Many times there arise the need to attach files to the order mail. I am giving here a brief explanation for this: I have used Magento ver. 1.7.0.0 ( In previous version there was no mailer class). 1) Rewrite Sales Class Copy the file found at app\code\core\Mage\Sales\Model\Order.php to app\code\local\Mage\Sales\Model\Order.php Overwrite the `sendNewOrderEmail()’ method found. Here […]
Category: Magento
Everything related to Magento eCommerce
Limit results collection in Magento
Many times need arises to limit collection for say pagination or for any customization. I am listing here an example which shows how to limit the collection. I have used the Product Model below.
Optgroup in Magento
For a module I was working on in one of my project, I needed to display a select box, with optgroup, Magento has inbuilt function for this. Kindly go through this post Select Box in Magento of mine for understanding how to generate select box before reading forward. For option group you need to pass […]
Event and Observer in Magento
There is an Event-Observer methodology used in Magento, Magento has been programmed to raise events in crucial areas of the flow. We can use these events for our requirement. I am describing here a way to use it. An example would be the event ‘checkout_onepage_controller_success_action’ (this has been use by me at many instances) which […]
Adminhtml Frontname in Magento
I am writing here a code snipet for fetching the name (alias) used to access admin end, which is set to ‘admin’ by default Below code for creating an admin URL
File Upload in Magento
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 […]
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.