Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- **$_productCollection = $block->getLoadedProductCollection();**
- SELECT `e`.*,
- IF(at_status.value_id > 0, at_status.value, at_status_default.value) AS
- `status`,
- `cat_index`.`position` AS
- `cat_index_position`
- FROM `catalog_product_entity` AS `e`
- INNER JOIN `catalog_product_entity_int` AS `at_status_default`
- ON ( `at_status_default`.`entity_id` = `e`.`entity_id` )
- AND ( `at_status_default`.`attribute_id` = '87' )
- AND `at_status_default`.`store_id` = 0
- LEFT JOIN `catalog_product_entity_int` AS `at_status`
- ON ( `at_status`.`entity_id` = `e`.`entity_id` )
- AND ( `at_status`.`attribute_id` = '87' )
- AND ( `at_status`.`store_id` = 1 )
- INNER JOIN `catalog_category_product_index` AS `cat_index`
- ON cat_index.product_id = e.entity_id
- AND cat_index.store_id = 1
- AND cat_index.visibility IN( 3, 2, 4 )
- AND cat_index.category_id = '2'
- WHERE ( IF(at_status.value_id > 0, at_status.value, at_status_default.value) IN
- ( 1 ) )
- ORDER BY `e`.`entity_id` DESC
- **foreach ($_productCollection as $_product):**
- SELECT `e`.*,
- IF(at_status.value_id > 0, at_status.value, at_status_default.value) AS
- `status`,
- `cat_index`.`position` AS
- `cat_index_position`,
- `stock_status_index`.`stock_status` AS
- `is_salable`
- FROM `catalog_product_entity` AS `e`
- INNER JOIN `catalog_product_entity_int` AS `at_status_default`
- ON ( `at_status_default`.`entity_id` = `e`.`entity_id` )
- AND ( `at_status_default`.`attribute_id` = '87' )
- AND `at_status_default`.`store_id` = 0
- LEFT JOIN `catalog_product_entity_int` AS `at_status`
- ON ( `at_status`.`entity_id` = `e`.`entity_id` )
- AND ( `at_status`.`attribute_id` = '87' )
- AND ( `at_status`.`store_id` = 1 )
- INNER JOIN `catalog_category_product_index` AS `cat_index`
- ON cat_index.product_id = e.entity_id
- AND cat_index.store_id = 1
- AND cat_index.visibility IN( 3, 2, 4 )
- AND cat_index.category_id = '2'
- INNER JOIN `cataloginventory_stock_status` AS `stock_status_index`
- ON e.entity_id = stock_status_index.product_id
- AND stock_status_index.website_id = 0
- AND stock_status_index.stock_id = 1
- WHERE ( IF(at_status.value_id > 0, at_status.value, at_status_default.value) IN
- ( 1 ) )
- AND ( stock_status_index.stock_status = 1 )
- ORDER BY `e`.`entity_id` DESC
Add Comment
Please, Sign In to add comment