Product List Attribute Filter QueryMagento 1.9.2 addAttributeToFilter function not working default themeHow to filter dropdown in custom gridUpgrade from 1.9.1 to 1.9.2 ErrorMagento computed column value in 'filter_index'Magento 1.9.2.1 Column not foundMagento Admin Panel Returns 404 ErrorError Upgrade Magento 1.6 to 1.9How to add Email address in sales orders admin grid?sales order grid custom column filter QLSTATE[42S22]: Column not found: 1054 Unknown columnMagento vs manually added column into eav tableCould not filter product collection in Mage_Catalog_Block_Product_List by a custom attribute in magento 1.9

Controversial area of mathematics

Do I have to worry about players making “bad” choices on level up?

How do I use proper grammar in the negation of "have not" for the following sentence translation?

Reducing vertical space in stackrel

Error message with tabularx

What are the potential pitfalls when using metals as a currency?

How exactly does Hawking radiation decrease the mass of black holes?

Examples of non trivial equivalence relations , I mean equivalence relations without the expression " same ... as" in their definition?

Phrase for the opposite of "foolproof"

simple conditions equation

Pass By Reference VS Pass by Value

Which big number is bigger?

Meaning of Bloch representation

How to verbalise code in Mathematica?

What does KSP mean?

How can Republicans who favour free markets, consistently express anger when they don't like the outcome of that choice?

Rivers without rain

What happened to Captain America in Endgame?

Does the sign matter for proportionality?

Was there a Viking Exchange as well as a Columbian one?

Mac Pro install disk keeps ejecting itself

How can I place the product on a social media post better?

Why don't other Westeros houses use wildfire?

How can I change the color of a part of a line?



Product List Attribute Filter Query


Magento 1.9.2 addAttributeToFilter function not working default themeHow to filter dropdown in custom gridUpgrade from 1.9.1 to 1.9.2 ErrorMagento computed column value in 'filter_index'Magento 1.9.2.1 Column not foundMagento Admin Panel Returns 404 ErrorError Upgrade Magento 1.6 to 1.9How to add Email address in sales orders admin grid?sales order grid custom column filter QLSTATE[42S22]: Column not found: 1054 Unknown columnMagento vs manually added column into eav tableCould not filter product collection in Mage_Catalog_Block_Product_List by a custom attribute in magento 1.9






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








10















I have added one filter in Method _getProductCollection() of the class Mage_Catalog_Block_Product_List as follows.



protected function _getProductCollection()

...
$this->_productCollection = $layer->getProductCollection();
$this->_productCollection->getSelect()->joinInner(
array('cpe' => 'catalog_product_entity'),
'e.entity_id = cpe.entity_id'
)
->where("cpe.type_id = 'simple'");
...



The above code is working fine as of Magento Version 1.7. But whenever I write the following code, it gives




Column not found: 1054 Unknown column 'e.type_id' in 'where clause'




error.



The code (which is not working).



protected function _getProductCollection()

...
$this->_productCollection = $layer->getProductCollection();
$this->_productCollection
->addAttributeToSelect('type_id')
->addAttributeToFilter('type_id','simple');
...



Now the Questions.



  1. Will there be any performance impact if I use the first working
    code?

  2. is there any other way to get around to have a proper product
    filter?

UPDATE:



Whenever I apply the following code and use rwd theme, I am not getting any error. But whenever I user default theme, I get the below error,



Code



protected function _getProductCollection()

...
$this->_productCollection = $layer->getProductCollection();
$this->_productCollection
->addAttributeToSelect('type_id')
->addAttributeToFilter('type_id','simple');
...



Error




SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e.type_id' in
'where clause', query was: SELECT FLOOR((ROUND((e.min_price) * 1, 2))
/ 10) + 1 AS range, COUNT(*) AS count FROM
catalog_product_index_price AS e 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(2, 4) AND cat_index.category_id = '3' WHERE
(e.type_id IN('simple')) AND ( e.website_id = '1' ) AND (
e.customer_group_id = 0) AND (e.min_price IS NOT NULL) GROUP BY
FLOOR((ROUND((e.min_price) * 1, 2)) / 10) + 1 ORDER BY
FLOOR((ROUND((e.min_price) * 1, 2)) / 10) + 1 ASC











share|improve this question
















bumped to the homepage by Community 15 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • which magento version u have use?? *& have applied magento patches

    – Amit Bera
    Dec 24 '15 at 8:19







  • 1





    wtf? now has sense... i was trying over a EE 1.14 on RWD, that is just unacceptable, how can a view theme change an entire query even worst how can change the main table... this couldn't be anything but a bug. Well done @Magento Learner!

    – MauroNigrele
    Dec 29 '15 at 6:33











  • Exactly, the view theme creates problem. thanks. The code should be independent of a theme

    – Magento Learner
    Dec 29 '15 at 6:36


















10















I have added one filter in Method _getProductCollection() of the class Mage_Catalog_Block_Product_List as follows.



protected function _getProductCollection()

...
$this->_productCollection = $layer->getProductCollection();
$this->_productCollection->getSelect()->joinInner(
array('cpe' => 'catalog_product_entity'),
'e.entity_id = cpe.entity_id'
)
->where("cpe.type_id = 'simple'");
...



The above code is working fine as of Magento Version 1.7. But whenever I write the following code, it gives




Column not found: 1054 Unknown column 'e.type_id' in 'where clause'




error.



The code (which is not working).



protected function _getProductCollection()

...
$this->_productCollection = $layer->getProductCollection();
$this->_productCollection
->addAttributeToSelect('type_id')
->addAttributeToFilter('type_id','simple');
...



Now the Questions.



  1. Will there be any performance impact if I use the first working
    code?

  2. is there any other way to get around to have a proper product
    filter?

UPDATE:



Whenever I apply the following code and use rwd theme, I am not getting any error. But whenever I user default theme, I get the below error,



Code



protected function _getProductCollection()

...
$this->_productCollection = $layer->getProductCollection();
$this->_productCollection
->addAttributeToSelect('type_id')
->addAttributeToFilter('type_id','simple');
...



Error




SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e.type_id' in
'where clause', query was: SELECT FLOOR((ROUND((e.min_price) * 1, 2))
/ 10) + 1 AS range, COUNT(*) AS count FROM
catalog_product_index_price AS e 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(2, 4) AND cat_index.category_id = '3' WHERE
(e.type_id IN('simple')) AND ( e.website_id = '1' ) AND (
e.customer_group_id = 0) AND (e.min_price IS NOT NULL) GROUP BY
FLOOR((ROUND((e.min_price) * 1, 2)) / 10) + 1 ORDER BY
FLOOR((ROUND((e.min_price) * 1, 2)) / 10) + 1 ASC











share|improve this question
















bumped to the homepage by Community 15 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • which magento version u have use?? *& have applied magento patches

    – Amit Bera
    Dec 24 '15 at 8:19







  • 1





    wtf? now has sense... i was trying over a EE 1.14 on RWD, that is just unacceptable, how can a view theme change an entire query even worst how can change the main table... this couldn't be anything but a bug. Well done @Magento Learner!

    – MauroNigrele
    Dec 29 '15 at 6:33











  • Exactly, the view theme creates problem. thanks. The code should be independent of a theme

    – Magento Learner
    Dec 29 '15 at 6:36














10












10








10








I have added one filter in Method _getProductCollection() of the class Mage_Catalog_Block_Product_List as follows.



protected function _getProductCollection()

...
$this->_productCollection = $layer->getProductCollection();
$this->_productCollection->getSelect()->joinInner(
array('cpe' => 'catalog_product_entity'),
'e.entity_id = cpe.entity_id'
)
->where("cpe.type_id = 'simple'");
...



The above code is working fine as of Magento Version 1.7. But whenever I write the following code, it gives




Column not found: 1054 Unknown column 'e.type_id' in 'where clause'




error.



The code (which is not working).



protected function _getProductCollection()

...
$this->_productCollection = $layer->getProductCollection();
$this->_productCollection
->addAttributeToSelect('type_id')
->addAttributeToFilter('type_id','simple');
...



Now the Questions.



  1. Will there be any performance impact if I use the first working
    code?

  2. is there any other way to get around to have a proper product
    filter?

UPDATE:



Whenever I apply the following code and use rwd theme, I am not getting any error. But whenever I user default theme, I get the below error,



Code



protected function _getProductCollection()

...
$this->_productCollection = $layer->getProductCollection();
$this->_productCollection
->addAttributeToSelect('type_id')
->addAttributeToFilter('type_id','simple');
...



Error




SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e.type_id' in
'where clause', query was: SELECT FLOOR((ROUND((e.min_price) * 1, 2))
/ 10) + 1 AS range, COUNT(*) AS count FROM
catalog_product_index_price AS e 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(2, 4) AND cat_index.category_id = '3' WHERE
(e.type_id IN('simple')) AND ( e.website_id = '1' ) AND (
e.customer_group_id = 0) AND (e.min_price IS NOT NULL) GROUP BY
FLOOR((ROUND((e.min_price) * 1, 2)) / 10) + 1 ORDER BY
FLOOR((ROUND((e.min_price) * 1, 2)) / 10) + 1 ASC











share|improve this question
















I have added one filter in Method _getProductCollection() of the class Mage_Catalog_Block_Product_List as follows.



protected function _getProductCollection()

...
$this->_productCollection = $layer->getProductCollection();
$this->_productCollection->getSelect()->joinInner(
array('cpe' => 'catalog_product_entity'),
'e.entity_id = cpe.entity_id'
)
->where("cpe.type_id = 'simple'");
...



The above code is working fine as of Magento Version 1.7. But whenever I write the following code, it gives




Column not found: 1054 Unknown column 'e.type_id' in 'where clause'




error.



The code (which is not working).



protected function _getProductCollection()

...
$this->_productCollection = $layer->getProductCollection();
$this->_productCollection
->addAttributeToSelect('type_id')
->addAttributeToFilter('type_id','simple');
...



Now the Questions.



  1. Will there be any performance impact if I use the first working
    code?

  2. is there any other way to get around to have a proper product
    filter?

UPDATE:



Whenever I apply the following code and use rwd theme, I am not getting any error. But whenever I user default theme, I get the below error,



Code



protected function _getProductCollection()

...
$this->_productCollection = $layer->getProductCollection();
$this->_productCollection
->addAttributeToSelect('type_id')
->addAttributeToFilter('type_id','simple');
...



Error




SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e.type_id' in
'where clause', query was: SELECT FLOOR((ROUND((e.min_price) * 1, 2))
/ 10) + 1 AS range, COUNT(*) AS count FROM
catalog_product_index_price AS e 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(2, 4) AND cat_index.category_id = '3' WHERE
(e.type_id IN('simple')) AND ( e.website_id = '1' ) AND (
e.customer_group_id = 0) AND (e.min_price IS NOT NULL) GROUP BY
FLOOR((ROUND((e.min_price) * 1, 2)) / 10) + 1 ORDER BY
FLOOR((ROUND((e.min_price) * 1, 2)) / 10) + 1 ASC








magento-1.9 product-attribute performance






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 16 '17 at 10:58









sv3n

10.1k62557




10.1k62557










asked Dec 24 '15 at 8:11









Magento LearnerMagento Learner

439731




439731





bumped to the homepage by Community 15 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 15 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.














  • which magento version u have use?? *& have applied magento patches

    – Amit Bera
    Dec 24 '15 at 8:19







  • 1





    wtf? now has sense... i was trying over a EE 1.14 on RWD, that is just unacceptable, how can a view theme change an entire query even worst how can change the main table... this couldn't be anything but a bug. Well done @Magento Learner!

    – MauroNigrele
    Dec 29 '15 at 6:33











  • Exactly, the view theme creates problem. thanks. The code should be independent of a theme

    – Magento Learner
    Dec 29 '15 at 6:36


















  • which magento version u have use?? *& have applied magento patches

    – Amit Bera
    Dec 24 '15 at 8:19







  • 1





    wtf? now has sense... i was trying over a EE 1.14 on RWD, that is just unacceptable, how can a view theme change an entire query even worst how can change the main table... this couldn't be anything but a bug. Well done @Magento Learner!

    – MauroNigrele
    Dec 29 '15 at 6:33











  • Exactly, the view theme creates problem. thanks. The code should be independent of a theme

    – Magento Learner
    Dec 29 '15 at 6:36

















which magento version u have use?? *& have applied magento patches

– Amit Bera
Dec 24 '15 at 8:19






which magento version u have use?? *& have applied magento patches

– Amit Bera
Dec 24 '15 at 8:19





1




1





wtf? now has sense... i was trying over a EE 1.14 on RWD, that is just unacceptable, how can a view theme change an entire query even worst how can change the main table... this couldn't be anything but a bug. Well done @Magento Learner!

– MauroNigrele
Dec 29 '15 at 6:33





wtf? now has sense... i was trying over a EE 1.14 on RWD, that is just unacceptable, how can a view theme change an entire query even worst how can change the main table... this couldn't be anything but a bug. Well done @Magento Learner!

– MauroNigrele
Dec 29 '15 at 6:33













Exactly, the view theme creates problem. thanks. The code should be independent of a theme

– Magento Learner
Dec 29 '15 at 6:36






Exactly, the view theme creates problem. thanks. The code should be independent of a theme

– Magento Learner
Dec 29 '15 at 6:36











1 Answer
1






active

oldest

votes


















0














I think that:



$collection->addAttributeToFilter('type_id', array('eq' => 'simple');


Should works, you don't need to add type_id to select since is a catalog_product_entity column and it's retrieved by default. I always suggest to log the final query in order to get a best idea of what is happen:



Mage.:log($collection->getSelectSql(true));


BTW: The first code block has no sense at all since you are joining the main table (catalog_product_entity) to itself.






share|improve this answer

























  • " in Magento 1.7 they did an optimization on the select sql that is used for the price filtering options. They remove the FROM sql part (which is product entity - which contains type_id attribute) and make the price_index related table the main one - the one that is used in the FROM part of the query. So basically the table from which the data is selected is not the product entity table anymore (you lose all products base attributes) the main table becomes the product index. This is an core update that the Magento team added starting 1.7 versions." Refer the following

    – Magento Learner
    Dec 24 '15 at 8:54












  • sohu.io/questions/886200/…

    – Magento Learner
    Dec 24 '15 at 8:54






  • 1





    wooow my fault folk, for some reason, i was thinking in backend block getCollection method, so in this scenario your first code it's ok I'm not sure if it is the best solution but seems to be ok. Sorry

    – MauroNigrele
    Dec 24 '15 at 9:02











  • @MagentoLearner are you sure about that post? i've just re-checked on a EE1.14 i have installed and still using catalog_product_entity as main table, except when you set to use flat catalog (absolutely recommended) but in both cases you have type_id present in the select. Can you log the query as i've wrote in the original Answer?

    – MauroNigrele
    Dec 24 '15 at 9:17






  • 1





    mmmm interesting... i Also check the query in a search case and is using catalog_product_entity as main table, maybe the "magento team" have decided to rollback that changes. I can't found any 1.7 installed to check it but the idea of change the main table of an entity sounds like a very bad architectural decision... Well note that you just ruined my weekend, now i need to find and install a CE1.7 and look this crap with my own eyes... my wife will not be happy with this :)

    – MauroNigrele
    Dec 24 '15 at 9:34











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f94963%2fproduct-list-attribute-filter-query%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














I think that:



$collection->addAttributeToFilter('type_id', array('eq' => 'simple');


Should works, you don't need to add type_id to select since is a catalog_product_entity column and it's retrieved by default. I always suggest to log the final query in order to get a best idea of what is happen:



Mage.:log($collection->getSelectSql(true));


BTW: The first code block has no sense at all since you are joining the main table (catalog_product_entity) to itself.






share|improve this answer

























  • " in Magento 1.7 they did an optimization on the select sql that is used for the price filtering options. They remove the FROM sql part (which is product entity - which contains type_id attribute) and make the price_index related table the main one - the one that is used in the FROM part of the query. So basically the table from which the data is selected is not the product entity table anymore (you lose all products base attributes) the main table becomes the product index. This is an core update that the Magento team added starting 1.7 versions." Refer the following

    – Magento Learner
    Dec 24 '15 at 8:54












  • sohu.io/questions/886200/…

    – Magento Learner
    Dec 24 '15 at 8:54






  • 1





    wooow my fault folk, for some reason, i was thinking in backend block getCollection method, so in this scenario your first code it's ok I'm not sure if it is the best solution but seems to be ok. Sorry

    – MauroNigrele
    Dec 24 '15 at 9:02











  • @MagentoLearner are you sure about that post? i've just re-checked on a EE1.14 i have installed and still using catalog_product_entity as main table, except when you set to use flat catalog (absolutely recommended) but in both cases you have type_id present in the select. Can you log the query as i've wrote in the original Answer?

    – MauroNigrele
    Dec 24 '15 at 9:17






  • 1





    mmmm interesting... i Also check the query in a search case and is using catalog_product_entity as main table, maybe the "magento team" have decided to rollback that changes. I can't found any 1.7 installed to check it but the idea of change the main table of an entity sounds like a very bad architectural decision... Well note that you just ruined my weekend, now i need to find and install a CE1.7 and look this crap with my own eyes... my wife will not be happy with this :)

    – MauroNigrele
    Dec 24 '15 at 9:34















0














I think that:



$collection->addAttributeToFilter('type_id', array('eq' => 'simple');


Should works, you don't need to add type_id to select since is a catalog_product_entity column and it's retrieved by default. I always suggest to log the final query in order to get a best idea of what is happen:



Mage.:log($collection->getSelectSql(true));


BTW: The first code block has no sense at all since you are joining the main table (catalog_product_entity) to itself.






share|improve this answer

























  • " in Magento 1.7 they did an optimization on the select sql that is used for the price filtering options. They remove the FROM sql part (which is product entity - which contains type_id attribute) and make the price_index related table the main one - the one that is used in the FROM part of the query. So basically the table from which the data is selected is not the product entity table anymore (you lose all products base attributes) the main table becomes the product index. This is an core update that the Magento team added starting 1.7 versions." Refer the following

    – Magento Learner
    Dec 24 '15 at 8:54












  • sohu.io/questions/886200/…

    – Magento Learner
    Dec 24 '15 at 8:54






  • 1





    wooow my fault folk, for some reason, i was thinking in backend block getCollection method, so in this scenario your first code it's ok I'm not sure if it is the best solution but seems to be ok. Sorry

    – MauroNigrele
    Dec 24 '15 at 9:02











  • @MagentoLearner are you sure about that post? i've just re-checked on a EE1.14 i have installed and still using catalog_product_entity as main table, except when you set to use flat catalog (absolutely recommended) but in both cases you have type_id present in the select. Can you log the query as i've wrote in the original Answer?

    – MauroNigrele
    Dec 24 '15 at 9:17






  • 1





    mmmm interesting... i Also check the query in a search case and is using catalog_product_entity as main table, maybe the "magento team" have decided to rollback that changes. I can't found any 1.7 installed to check it but the idea of change the main table of an entity sounds like a very bad architectural decision... Well note that you just ruined my weekend, now i need to find and install a CE1.7 and look this crap with my own eyes... my wife will not be happy with this :)

    – MauroNigrele
    Dec 24 '15 at 9:34













0












0








0







I think that:



$collection->addAttributeToFilter('type_id', array('eq' => 'simple');


Should works, you don't need to add type_id to select since is a catalog_product_entity column and it's retrieved by default. I always suggest to log the final query in order to get a best idea of what is happen:



Mage.:log($collection->getSelectSql(true));


BTW: The first code block has no sense at all since you are joining the main table (catalog_product_entity) to itself.






share|improve this answer















I think that:



$collection->addAttributeToFilter('type_id', array('eq' => 'simple');


Should works, you don't need to add type_id to select since is a catalog_product_entity column and it's retrieved by default. I always suggest to log the final query in order to get a best idea of what is happen:



Mage.:log($collection->getSelectSql(true));


BTW: The first code block has no sense at all since you are joining the main table (catalog_product_entity) to itself.







share|improve this answer














share|improve this answer



share|improve this answer








edited Dec 24 '15 at 8:39









Manashvi Birla

6,55751841




6,55751841










answered Dec 24 '15 at 8:31









MauroNigreleMauroNigrele

2,625926




2,625926












  • " in Magento 1.7 they did an optimization on the select sql that is used for the price filtering options. They remove the FROM sql part (which is product entity - which contains type_id attribute) and make the price_index related table the main one - the one that is used in the FROM part of the query. So basically the table from which the data is selected is not the product entity table anymore (you lose all products base attributes) the main table becomes the product index. This is an core update that the Magento team added starting 1.7 versions." Refer the following

    – Magento Learner
    Dec 24 '15 at 8:54












  • sohu.io/questions/886200/…

    – Magento Learner
    Dec 24 '15 at 8:54






  • 1





    wooow my fault folk, for some reason, i was thinking in backend block getCollection method, so in this scenario your first code it's ok I'm not sure if it is the best solution but seems to be ok. Sorry

    – MauroNigrele
    Dec 24 '15 at 9:02











  • @MagentoLearner are you sure about that post? i've just re-checked on a EE1.14 i have installed and still using catalog_product_entity as main table, except when you set to use flat catalog (absolutely recommended) but in both cases you have type_id present in the select. Can you log the query as i've wrote in the original Answer?

    – MauroNigrele
    Dec 24 '15 at 9:17






  • 1





    mmmm interesting... i Also check the query in a search case and is using catalog_product_entity as main table, maybe the "magento team" have decided to rollback that changes. I can't found any 1.7 installed to check it but the idea of change the main table of an entity sounds like a very bad architectural decision... Well note that you just ruined my weekend, now i need to find and install a CE1.7 and look this crap with my own eyes... my wife will not be happy with this :)

    – MauroNigrele
    Dec 24 '15 at 9:34

















  • " in Magento 1.7 they did an optimization on the select sql that is used for the price filtering options. They remove the FROM sql part (which is product entity - which contains type_id attribute) and make the price_index related table the main one - the one that is used in the FROM part of the query. So basically the table from which the data is selected is not the product entity table anymore (you lose all products base attributes) the main table becomes the product index. This is an core update that the Magento team added starting 1.7 versions." Refer the following

    – Magento Learner
    Dec 24 '15 at 8:54












  • sohu.io/questions/886200/…

    – Magento Learner
    Dec 24 '15 at 8:54






  • 1





    wooow my fault folk, for some reason, i was thinking in backend block getCollection method, so in this scenario your first code it's ok I'm not sure if it is the best solution but seems to be ok. Sorry

    – MauroNigrele
    Dec 24 '15 at 9:02











  • @MagentoLearner are you sure about that post? i've just re-checked on a EE1.14 i have installed and still using catalog_product_entity as main table, except when you set to use flat catalog (absolutely recommended) but in both cases you have type_id present in the select. Can you log the query as i've wrote in the original Answer?

    – MauroNigrele
    Dec 24 '15 at 9:17






  • 1





    mmmm interesting... i Also check the query in a search case and is using catalog_product_entity as main table, maybe the "magento team" have decided to rollback that changes. I can't found any 1.7 installed to check it but the idea of change the main table of an entity sounds like a very bad architectural decision... Well note that you just ruined my weekend, now i need to find and install a CE1.7 and look this crap with my own eyes... my wife will not be happy with this :)

    – MauroNigrele
    Dec 24 '15 at 9:34
















" in Magento 1.7 they did an optimization on the select sql that is used for the price filtering options. They remove the FROM sql part (which is product entity - which contains type_id attribute) and make the price_index related table the main one - the one that is used in the FROM part of the query. So basically the table from which the data is selected is not the product entity table anymore (you lose all products base attributes) the main table becomes the product index. This is an core update that the Magento team added starting 1.7 versions." Refer the following

– Magento Learner
Dec 24 '15 at 8:54






" in Magento 1.7 they did an optimization on the select sql that is used for the price filtering options. They remove the FROM sql part (which is product entity - which contains type_id attribute) and make the price_index related table the main one - the one that is used in the FROM part of the query. So basically the table from which the data is selected is not the product entity table anymore (you lose all products base attributes) the main table becomes the product index. This is an core update that the Magento team added starting 1.7 versions." Refer the following

– Magento Learner
Dec 24 '15 at 8:54














sohu.io/questions/886200/…

– Magento Learner
Dec 24 '15 at 8:54





sohu.io/questions/886200/…

– Magento Learner
Dec 24 '15 at 8:54




1




1





wooow my fault folk, for some reason, i was thinking in backend block getCollection method, so in this scenario your first code it's ok I'm not sure if it is the best solution but seems to be ok. Sorry

– MauroNigrele
Dec 24 '15 at 9:02





wooow my fault folk, for some reason, i was thinking in backend block getCollection method, so in this scenario your first code it's ok I'm not sure if it is the best solution but seems to be ok. Sorry

– MauroNigrele
Dec 24 '15 at 9:02













@MagentoLearner are you sure about that post? i've just re-checked on a EE1.14 i have installed and still using catalog_product_entity as main table, except when you set to use flat catalog (absolutely recommended) but in both cases you have type_id present in the select. Can you log the query as i've wrote in the original Answer?

– MauroNigrele
Dec 24 '15 at 9:17





@MagentoLearner are you sure about that post? i've just re-checked on a EE1.14 i have installed and still using catalog_product_entity as main table, except when you set to use flat catalog (absolutely recommended) but in both cases you have type_id present in the select. Can you log the query as i've wrote in the original Answer?

– MauroNigrele
Dec 24 '15 at 9:17




1




1





mmmm interesting... i Also check the query in a search case and is using catalog_product_entity as main table, maybe the "magento team" have decided to rollback that changes. I can't found any 1.7 installed to check it but the idea of change the main table of an entity sounds like a very bad architectural decision... Well note that you just ruined my weekend, now i need to find and install a CE1.7 and look this crap with my own eyes... my wife will not be happy with this :)

– MauroNigrele
Dec 24 '15 at 9:34





mmmm interesting... i Also check the query in a search case and is using catalog_product_entity as main table, maybe the "magento team" have decided to rollback that changes. I can't found any 1.7 installed to check it but the idea of change the main table of an entity sounds like a very bad architectural decision... Well note that you just ruined my weekend, now i need to find and install a CE1.7 and look this crap with my own eyes... my wife will not be happy with this :)

– MauroNigrele
Dec 24 '15 at 9:34

















draft saved

draft discarded
















































Thanks for contributing an answer to Magento Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f94963%2fproduct-list-attribute-filter-query%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Magento 2 duplicate PHPSESSID cookie when using session_start() in custom php scriptMagento 2: User cant logged in into to account page, no error showing!Magento duplicate on subdomainGrabbing storeview from cookie (after using language selector)How do I run php custom script on magento2Magento 2: Include PHP script in headerSession lock after using Cm_RedisSessionscript php to update stockMagento set cookie popupMagento 2 session id cookie - where to find it?How to import Configurable product from csv with custom attributes using php scriptMagento 2 run custom PHP script

Can not update quote_id field of “quote_item” table magento 2Magento 2.1 - We can't remove the item. (Shopping Cart doesnt allow us to remove items before becomes empty)Add value for custom quote item attribute using REST apiREST API endpoint v1/carts/cartId/items always returns error messageCorrect way to save entries to databaseHow to remove all associated quote objects of a customer completelyMagento 2 - Save value from custom input field to quote_itemGet quote_item data using quote id and product id filter in Magento 2How to set additional data to quote_item table from controller in Magento 2?What is the purpose of additional_data column in quote_item table in magento2Set Custom Price to Quote item magento2 from controller

How to solve knockout JS error in Magento 2 Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?(Magento2) knockout.js:3012 Uncaught ReferenceError: Unable to process bindingUnable to process binding Knockout.js magento 2Cannot read property `scopeLabel` of undefined on Product Detail PageCan't get Customer Data on frontend in Magento 2Magento2 Order Summary - unable to process bindingKO templates are not loading in Magento 2.1 applicationgetting knockout js error magento 2Product grid not load -— Unable to process binding Knockout.js magento 2Product form not loaded in magento2Uncaught ReferenceError: Unable to process binding “if: function()return (isShowLegend()) ” magento 2