0

Exactly as the title suggests, how can i find all simple products in the system that are not part of complex products such as configurable?

I dont mind if this is done directly in the db or through some collection load but i need only the list of product ids that fit this criteria.

  • Do you want a list of the simple products not currently assigned to a configuration product, or a list of simple products with all POSSIBLE simple products that could be part of a configurable product (i.e. have the right attribute values) – Alan Storm Oct 30 '13 at 22:43
  • 1
    Anything not currently assigned would be perfect – Marty Wallace Oct 30 '13 at 23:11
2

Try this query:

SELECT
    entity_id
FROM
    catalog_product_entity
WHERE
    type_id = 'simple'
AND(
    entity_id NOT IN(
        SELECT DISTINCT
            (product_id)
        FROM
            `catalog_product_super_link` /* assocciated product ids of configurebles */
        UNION
            SELECT DISTINCT
                (linked_product_id)
            FROM
                `catalog_product_link` /* assocciated product ids of grouped */
    )
)

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.