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.

2
  • 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) Oct 30, 2013 at 22:43
  • 1
    Anything not currently assigned would be perfect Oct 30, 2013 at 23:11

1 Answer 1

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 and acknowledge you have read our privacy policy.

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