Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

From where category id is coming #60

Open
sumeetmagento opened this issue Sep 16, 2024 · 0 comments
Open

From where category id is coming #60

sumeetmagento opened this issue Sep 16, 2024 · 0 comments

Comments

@sumeetmagento
Copy link

File name - app/code/Simi/Simiconnector/Model/ResourceModel/Productlist/ProductlistCollection.php

File function -
$collection = $simiObjectManager->create('Magento\Catalog\Model\Product')->getCollection()
->addAttributeToSelect($simiObjectManager->get('Magento\Catalog\Model\Config')
->getProductAttributes())
->addMinimalPrice()
->addFinalPrice()
->addTaxPercents()
->addUrlRewrite();

when we print SQL query then category_id is coming from where it is coming ?

Debugging that part -
echo "
-----
";
echo $collection->getSelect()->__toString();
echo "
-----
";
echo "in zero"; die;

this is the SQL query -

 -----
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) AS `minimal_price`, `price_index`.`min_price`, `price_index`.`max_price`, `price_index`.`tier_price`, `cat_index`.`position` AS `cat_index_position` FROM `catalog_product_entity` AS `e` INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.customer_group_id = 0 AND price_index.website_id = '1' INNER JOIN `catalog_category_product_index_store2` AS `cat_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')
-----
in zero 

anyone is there that where cat_index.category_id=29 is coming from ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant