I want to create a admin Grid that displays all products that are using the default ( admin 0 ) scope values when i am in a store scope.
How can I filter a collection to get this desire result.
Any help would be appreciated.
Thanks.
Ryan
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityYou can get the default store id with
$defaultStoreId = Mage::app()->getWebsite()->getDefaultGroup()->getDefaultStoreId();
then you can use that ID to filter the product collection.
$productCollection = Mage::getResourceModel('catalog/product_collection')
->setStoreFilter($defaultStoreId)
->addAttributeToSelect('*');
That should give you what you are looking for.
I have not tested it so please let me know if it does not work so I can make adjustments.