Skip to main content
deleted 2 characters in body
Source Link
Arnie
  • 972
  • 12
  • 25

I added a custom attribute is_featured to my Magento 1.7 store. Its a yes/no dropdown. I am setting it to yes on storeview level and to no on the standard level.

Now I try to load a collection with all the products that have is_featured set to yes. This is my code:

$products = Mage::getModel('catalog/product')$this->getCollection>_addProductAttributesAndPrices($products)->addAttributeToFilter(array(array('attribute' => 'is_featured''featured', 'eq' => '1')));
        

This only loads those products that have is_featured set to yes on both storeview and standard scope, the ones that have it set to yes on storeview only are NOT included. Why is this the case, did I miss something?

I added a custom attribute is_featured to my Magento 1.7 store. Its a yes/no dropdown. I am setting it to yes on storeview level and to no on the standard level.

Now I try to load a collection with all the products that have is_featured set to yes. This is my code:

$products = Mage::getModel('catalog/product')->getCollection()->addAttributeToFilter(array(array('attribute' => 'is_featured', 'eq' => '1')));

This only loads those products that have is_featured set to yes on both storeview and standard scope, the ones that have it set to yes on storeview only are NOT included. Why is this the case, did I miss something?

I added a custom attribute is_featured to my Magento 1.7 store. Its a yes/no dropdown. I am setting it to yes on storeview level and to no on the standard level.

Now I try to load a collection with all the products that have is_featured set to yes. This is my code:

$products = $this->_addProductAttributesAndPrices($products)->addAttributeToFilter(array(array('attribute' => 'featured', 'eq' => '1')));
        

This only loads those products that have is_featured set to yes on both storeview and standard scope, the ones that have it set to yes on storeview only are NOT included. Why is this the case, did I miss something?

Source Link
Arnie
  • 972
  • 12
  • 25

Custom attribute saved but not loaded in collection?

I added a custom attribute is_featured to my Magento 1.7 store. Its a yes/no dropdown. I am setting it to yes on storeview level and to no on the standard level.

Now I try to load a collection with all the products that have is_featured set to yes. This is my code:

$products = Mage::getModel('catalog/product')->getCollection()->addAttributeToFilter(array(array('attribute' => 'is_featured', 'eq' => '1')));

This only loads those products that have is_featured set to yes on both storeview and standard scope, the ones that have it set to yes on storeview only are NOT included. Why is this the case, did I miss something?