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

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -