I need to get a grouped product url. How can I load a grouped product by a custom attribute and get its url?


Try this

$collection = Mage::getResourceModel('catalog/product_collection')

$product = $collection->getFirstItem();

if($product->getId()) {


if($product->getId()) {

You can just use a collection to load a product collection, filter by your attribute and then get the url.

$product = Mage::getResourceModel('catalog/product_collection')


Afaik you can add a categoryId as parameter to addUrlRewrite if you want a special url.

  • getFirst() is giving error @Fabian Blechschmidt – tufanayd Jan 14 '16 at 23:24
  • check the collection mit be getFirstItem or something alike – Fabian Blechschmidt Jan 15 '16 at 10:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.