Product List Attribute Filter QueryMagento 1.9.2 addAttributeToFilter function not working default themeHow...

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

How to reduce LED flash rate (frequency)

Is there a way to get a compiler for the original B programming language?

Is contacting this expert in the field something acceptable or would it be discourteous?

What route did the Hindenburg take when traveling from Germany to the U.S.?

How to pronounce 'C++' in Spanish

how to sum variables from file in bash

Meaning of Bloch representation

How much cash can I safely carry into the USA and avoid civil forfeiture?

Error message with tabularx

How to solve constants out of the internal energy equation?

What do the phrase "Reeyan's seacrest" and the word "fraggle" mean in a sketch?

What does the "ep" capability mean?

Mac Pro install disk keeps ejecting itself

With a Canadian student visa, can I spend a night at Vancouver before continuing to Toronto?

Pulling the rope with one hand is as heavy as with two hands?

simple conditions equation

Stop and Take a Breath!

Fizzy, soft, pop and still drinks

a sore throat vs a strep throat vs strep throat

How to type a section sign (§) into the Minecraft client

How would one muzzle a full grown polar bear in the 13th century?

Which big number is bigger?

A ​Note ​on ​N!



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 8 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 8 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 8 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 8 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

“%fieldName is a required field.”, in Magento2 REST API Call for GET Method Type The Next...

How to change City field to a dropdown in Checkout step Magento 2Magento 2 : How to change UI field(s)...

變成蝙蝠會怎樣? 參考資料 外部連結 导航菜单Thomas Nagel, "What is it like to be a...