We are using Magento 2.4.2-p2 version with SimiCart – Magento 2 Mobile App Builder
We are struggling from where category_id is coming
File name – app/code/Simi/Simiconnector/Model/ResourceModel/Productlist/ProductlistCollection.php
File function –
$collection = $simiObjectManager->create('MagentoCatalogModelProduct')->getCollection()
->addAttributeToSelect($simiObjectManager->get('MagentoCatalogModelConfig')
->getProductAttributes())
->addMinimalPrice()
->addFinalPrice()
->addTaxPercents()
->addUrlRewrite();
when we print SQL query then category_id is coming from where it is coming ?
Debugging that part –
echo $collection->getSelect()->__toString();
die;
this is the SQL query we are getting –
SELECT
e
.*,price_index
.price
,price_index
.tax_class_id
,
price_index
.final_price
, IF(price_index.tier_price IS NOT NULL,
LEAST(price_index.min_price, price_index.tier_price),
price_index.min_price) ASminimal_price
,price_index
.min_price
,
price_index
.max_price
,price_index
.tier_price
,
cat_index
.position
AScat_index_position
FROM
catalog_product_entity
ASe
INNER JOIN
catalog_product_index_price
ASprice_index
ON
price_index.entity_id = e.entity_id AND price_index.customer_group_id
= 0 AND price_index.website_id = ‘1’ INNER JOINcatalog_category_product_index_store2
AScat_index
ON
cat_index.product_id=e.entity_id AND cat_index.store_id=2 AND
cat_index.category_id=29 WHERE (e.created_in <= ‘1677618002’) AND (e.updated_in > ‘1677618002’)
We are struggling from From where category id is coming.
Does anyone know from where category id is coming ?