hoping you are well, I need your help with the following topic:

I want to make a report that extracts all the products in MAGENTO that does NOT have tax_class_id = '2' (taxable goods) and although I found the record in catalog_product_index_price, it only shows me the active products or with inventory greater than zero. How can I get the tax_class_id of inactive products (with SQL)?


You can try this query

SELECT cs.`product_id`,cs.`qty`,
FROM cataloginventory_stock_item cs 
INNER JOIN catalog_product_index_price as cpi 
ON cs.product_id=cpi.`entity_id` 
WHERE cs.qty=0 AND cpi.tax_class_id=2;

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.