関連するシンプルプロダクトの属性に基づいてグループ化プロダクトリストを表示しようとしています。今私は シンプルプロダクト(Magento)の属性によるシンプルプロダクトとグループ化プロダクトの内部結合
以下のような
- Create a collection of simple products and add attribute filters like color,brand etc., like below
$productCollection = Mage::getModel('catalog/product')->getCollection()
->addStoreFilter(Mage::app()->getStore())
->addAttributeToFilter($aname,$avalue)
->addAttributeToFilter('type_id', array('eq' => 'simple'))
->addAttributeToFilter(ATTRIBUTE_CODE,ATTRIBUTE_VALUE_ID);
(->addAttributeToFilter('color',5))
- Obtain all resultant ids and get its parent ids using the below
Mage::getModel('catalog/product_type_grouped')->getParentIdsByChild($productCollection->getAllIds());
- Read the parent ids from above object and show the result in a custom grid that i created
- Created a paging logic for parent ids and do paging in view file
をしています。このロジックは、実際に多くの時間を消費し、私は単一のコレクション内のすべてのこれらの操作を行うことができます任意の方法はありますか?シンプルな商品とグループ化された商品の間のメソッドの内部結合の並べ替えかもしれません!
お勧めします。
おかげで、それはあなたがしてフィルタリングする属性に依存 バラン