• Magento

    How to override a controller in Magento

    How to override a controller in Magento In several time ,we need to override a controlller.How to override a controller in Magento. There are two process available: 1.Basic Old process. 2.Upgrade Process from Magento CE 1.5.0. First have describe second process. It available from Magento CE 1.5.0.Where, i have Overriding controllers magento core controller .I have using before tag for use to override controller of a module-   Here ,step to override a controllers: a)First check which module ,i want to override. Ex1: Suppose have override magento Magento Core Module Mage_Contacts and want override IndexController.php Write below code [crayon-5c18036b36a1a829472595/] Here <contacts> is frontend routers for Mage_Contacts, and In <customcontacts before=”Mage_Contacts”>Amit_Customcontacts</customcontacts>…

  • Magento

    How to change page layout in Magento

    In this post,you can change page layout in Magento also set a Magento page template layout How to change page layout in Magento There are in few steps,you can page pay layouts. For change the page layout,you need to change root block  template(<reference name=”root”>) using setsetTemplate() method  ,So use <action method=”setTemplate”><template>YourPageLayoutLocation/YourLayput.phtml</template></action> and apply this template by  <action method=”setIsHandle”><applied>1</applied></action>   [crayon-5c18036b37328204149575/]   Suppose i am changing template   in checkout cart page [crayon-5c18036b3732d383463027/]  

  • Magento

    Programmatically create invoice of an order in magento

    Programmatically create invoice of an order in magento and create partial invoice of an order For some time need to create invoice of  an order.I have write code for  how to create invoice of an order pragmatically here. First of   load an order by order id/order increment id, Check which items of  that order are available for create invoice. if ,invoice is not created then create invoice of those items [crayon-5c18036b379ad386074641/]     This code is create an invoice of an all items of an order. If you want to create partial invoice  of an order then you can below code   [crayon-5c18036b379b2669609905/]    

  • Magento

    Magento custom collection filter and sort

    Magento custom collection filter and sort   We have already know how to filter magento product ,customer,wishlist,order  collection  fields filters. But whenever we are working on  non-exiting model collection, then we facing problem.Here i have put some tricks how you can filter a custom collection by a field.In post,i have working on a writing how a custom collection is filter by a filed and how the collection will filter. Suppose a custom collection is [crayon-5c18036b37db2557212091/] For add addFieldToSelect('*') at that Collection for retrieves all field value for a module is Then want to filter that collection by a field name ‘age’ then use [crayon-5c18036b37db7452211329/] For add for sort by a specific…