- Darren Felton
Total Posts: 2
Just wanted to post about my experience. May just happen to save someone else hours of anguish. However if they find themselves here I’m guessing there’s a good chance they’re already to that point.
For a custom module of mine, I had written my own Admin controller which would take in a CSV file that would update / import products. Customer wanted to use a CSV format of his own that he found easier to use, and was not compatible with Magento’s out of the box import/export tool. Anyways, newly imported products would import just fine… ALMOST. They showed up on the front end of the website correctly, and they would show up under “Category Products” to the category they had been assigned to. However, they would NOT show up under the “Manage Products” grid. I could however, directly open the product for editing by knowing the product ID and going to the URL directly. After simply saving the product from the edit product form it would then appear in the Manage products grid. Of course this would not work for the client.
After endless hours of pouring over code I finally discovered what was happening. See, this client’s site had a multiselect field added to the Manage Products grid (yes, I know this doesn’t make sense, since you can have multiple values on a multiselect, and the products grid only will show one value per row. He asked for it and insisted I add it anyway). Well, this attribute was not being set within my Admin controller’s logic for newly created products. Therefore, the product would not have any record in the ‘catalog_product_entity_varchar’ for this attribute. Because of this, it just so happened that the product was being filtered out of the collection on the Manage Products grid, even before any search terms were being applied.
My solution was simply to add this in the import script:
This is a pretty unique scenario so I doubt anyone will use this advice anytime soon. But should they find themselves in a similar scenario I hope this helps. This would apply to any import script you write for products, and you just so happen to have a multiselect added to the “Manage Products” grid. You need to set a value for that product attribute on the import. Even if it is just setting it to null.