Skip to content

Instantly share code, notes, and snippets.

@razbakov
Created January 26, 2012 14:55
Show Gist options
  • Save razbakov/1683127 to your computer and use it in GitHub Desktop.
Save razbakov/1683127 to your computer and use it in GitHub Desktop.
ProductList in layered navigation
<?php
//...
public function setCollection($collection){
//...
$collection->joinAttribute('hohlkammern', 'catalog_product/hohlkammern', 'entity_id', null, 'right');
$collection->joinAttribute('hohlkammern_alt', 'catalog_product/hohlkammern_alt', 'entity_id', null, 'right');
$collection->joinAttribute('ausreissteg', 'catalog_product/ausreissteg', 'entity_id', null, 'right');
$whereStatement = "
at_hohlkammern.value = {$hohlkammern}
or at_hohlkammern_alt.value = {$value}
or (at_hohlkammern.value = {$hohlkammernPlusOne} and at_ausreissteg.value = 1)
or (at_hohlkammern_alt.value = {$valuePlusOne} and at_ausreissteg.value = 1)
";
$collection->getSelect()->where($whereStatement);
//...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment