I've been trying without success to obtain all products with status = enabled from MAGENTO database and the price.
My query shows ALL the items (enabled and disabled ones) and i want to get only those with status = enabled.
This is my query:
SELECT main.sku, option_value_brand.value AS code_brand, code_business_unit.value as code_business_unit
FROM catalog_product_entity AS main
LEFT JOIN eav_attribute attribute_brand on attribute_brand.attribute_code = 'code_brand' and attribute_brand.entity_type_id = 4
LEFT JOIN eav_attribute attribute_business_unit on attribute_business_unit.attribute_code = 'code_business_unit' and attribute_brand.entity_type_id = 4
LEFT JOIN catalog_product_entity_int code_brand ON main.entity_id = code_brand.entity_id and code_brand.attribute_id = attribute_brand.attribute_id
LEFT JOIN eav_attribute_option option_brand on option_brand.attribute_id = code_brand.attribute_id and option_brand.option_id = code_brand.value
LEFT JOIN eav_attribute_option_value option_value_brand on option_brand.option_id = option_value_brand.option_id
LEFT JOIN catalog_product_entity_varchar code_business_unit ON main.entity_id = code_business_unit.entity_id and code_business_unit.attribute_id = attribute_business_unit.attribute_id;
How should i modify my query in order to obtain what i want (all the items with status = enabled AND the price?)
I tried to use this condition but it did not work:
WHERE catalog_product_entity_int.value = 1