2

I want to build a Magento extension in 1.9 which will allow me to list all of the products similar to the 'Catalog -> Manage Products' Grid but I need to add an extra input field for quanitity which is then used to generate a CSV file.

I have created a basic extension thats adds a new option to the navigation menu in the admin panel but I am currently having trouble trying to figure out how to use the product collection as a data source for the adminhtml grid. I have found a tutorial that shows you how to do this for a custom database but nothing for existing data in the Magento tables.

Can anyone give me any advice on the best way of doing this?

  • 1
    You will need to change the method _prepareCollection in your Grid class to load existing product collection. Have a look at core class for product grid, it will clear many doubts about that, Just don't go too deep, you'll get confused otherwise :) – Prateek Nov 9 '15 at 12:36
  • @Prateek Do you know a particular class I can look at in the core folder? – Daniel West Nov 9 '15 at 14:49
  • 1
    I'd suggest looking into Mage_Adminhtml_Block_Catalog_Product_Grid. – Prateek Nov 10 '15 at 5:09
  • @Prateek Thanks, I will have a look at the class now. – Daniel West Nov 10 '15 at 9:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.