• 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-5bc5b9c8d5cb9665334713/]     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-5bc5b9c8d5cc1215083066/]    

  • 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-5bc5b9c8d641e338248073/] 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-5bc5b9c8d6424937658979/] For add for sort by a specific…