0
I am trying to change the display of the products to Random when only when the category is the daughter of the main I made the following code:
$id = 2;
$cat = Mage::getModel('catalog/category')->load($id);
$subcats = $cat->getChildren();
$categoria = $_productCollection->getCategoryIds();
foreach(explode(',',$subcats) as $subCatid){
$_category = Mage::getModel('catalog/category')->load($subCatid);
if($_category->getIsActive() and $categoria = $_category ){
$_productCollection=$this->getLoadedProductCollection();
}
}
There is a lot of error :( who can help there thank.
A lot fish in his last answers, my dear Otto :( . . . And if I wanted to know why your code solves the problem?
– brasofilo
Master @brasofilo tried to explain a little better the functioning, grateful for the criticism
– Otto
guy already tried so the question is that this check has to be done inside the file list.phtml
– Renorram
updated the answer I hope to help you
– Otto
I will test here thank you for your attention.
– Renorram
I updated there the expensive question I hope you now understand exactly what I’m trying to do.
– Renorram