2013-10-07 219 views

回答

1

您可以使用此查詢

SELECT * 
FROM catalog_product_entity where entity_id not in (select product_id from catalog_product_super_link) 
AND type_id = 'simple' 
+0

乾杯,工作,謝謝:) – Chetan

+0

upvote並接受答案:P) – Meabed

1

使用Magento的型號

$simple_products = $model->getCollection()->addAttributeToFilter('type_id', Mage_Catalog_Model_Product_Type::TYPE_SIMPLE); 
foreach($simple_products as $simpleProduct) { 
    $parentIds = ''; 
    $parentIds = Mage::getResourceSingleton('catalog/product_type_configurable')->getParentIdsByChild($simpleProduct->getId()); 
    if(!$parentIds) { 
     echo $simpleProduct->getId(); 
    } 
} 

它將打印未與任何配置的產品相關聯的所有簡單的產品得到它。 希望這會有所幫助!

相關問題