0

When I try generate products feed then I get error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e.qty' in 'where clause', query was: SELECT COUNT(DISTINCT e.entity_id) FROM `catalog_product_entity` AS `e` INNER JOIN `catalog_product_website` AS `product_website` ON product_website.product_id = e.entity_id AND product_website.website_id = 1 LEFT JOIN `catalog_product_entity_int` AS `tbl_status_1` ON e.entity_id = tbl_status_1.entity_id AND tbl_status_1.attribute_id=94 LEFT JOIN `catalog_product_entity_int` AS `tbl_visibility_2` ON e.entity_id = tbl_visibility_2.entity_id AND tbl_visibility_2.attribute_id=96 LEFT JOIN `catalog_category_product` AS `tbl_category_ids_4` ON e.entity_id = tbl_category_ids_4.product_id WHERE (((tbl_status_1.value = '1') AND (tbl_visibility_2.value = '4') AND (e.qty >= '1

I try:

delete var/cache

indexer:reset

indexer:reindex

and also I try use flat product: no

reindex again

Still issue

1 Answer 1

0

Firstly, your query's got a wrong syntax. It's missing "')))". Well, the error is pretty clear, your table 'e' (catalog_product_entity) does not have a column called 'qty'.

But your query is full of errors:

Table 'catalog_product_entity_int' does not have a column 'entity_id' by default in Magento 2. It's now row_id.

This is as good as I can fix your query. It's missing qty column, as I mentioned, does not exist in the referred table.

SELECT COUNT(DISTINCT e.entity_id) 
FROM `catalog_product_entity` AS `e` 
INNER JOIN `catalog_product_website` AS `product_website` ON product_website.product_id = e.entity_id AND product_website.website_id = 1 
LEFT JOIN `catalog_product_entity_int` AS `tbl_status_1` ON e.entity_id = tbl_status_1.`row_id` AND tbl_status_1.`attribute_id`=94 
LEFT JOIN `catalog_product_entity_int` AS `tbl_visibility_2` ON e.entity_id = tbl_visibility_2.row_id AND tbl_visibility_2.attribute_id=96 
LEFT JOIN `catalog_category_product` AS `tbl_category_ids_4` ON e.entity_id = tbl_category_ids_4.product_id 
WHERE (tbl_status_1.`value` = '1') AND (tbl_visibility_2.value = '4')

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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