开发者

Magento dropdown with existing products

I was wondering if it's possible in Magento to make an attribute with a dropdown input type in wich you can select existing products.

If so how would one go about in doing this?

Al开发者_开发百科so if someone knows how to display the simple products inside a grouped product on the category(catalog) view, that would be real helpfull aswell.


  1. You need to create new attribute with your own source model. I hope you know how to do it. In this model you need to define method toOptionArray() where you can prepare product list as you want.
  2. It's quite easy. If you have grouped product you can fetch all associated simple product like this

    $product->getTypeInstance(true)->getAssociatedProducts($product);
    

And then you can display this list as you want

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜