Magento - custom collection query to load the products that have the same attribute value -


i want make custom collection query load products have same custom attribute "art_nr".

i have done :

$art_nr = mage::getmodel('catalog/product')->load($_product->getid())->getart_nr(); 

to load attribute in current product page, , want use in request.

thanks :)

a basic example like:

$_artcollection = mage::getmodel('catalog/product')->getcollection()     ->addattributetoselect('*')     ->addfieldtofilter('art_nr', $art_nr); 

also note magic getter 'art_nr' 'getartnr', no need underscores!


Comments

Popular posts from this blog

javascript - Iterate over array and calculate average values of array-parts -

iphone - Using nested NSDictionary with Picker -

objective c - Newbie question -multiple parameters -