Skip to content

Commit

Permalink
Merge pull request #59 from jhoelzl/master
Browse files Browse the repository at this point in the history
Check if array has values to prevent log output in system.log

Fixes #54
  • Loading branch information
andrewhowdencom authored May 16, 2017
2 parents 8ad7b0f + 99e5ec2 commit 4b8af84
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions app/code/community/Sitewards/B2BProfessional/Model/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,12 @@ protected function removePriceFilter($oBlock)
{
$aFilterableAttributes = $oBlock->getData('_filterable_attributes');
$aNewFilterableAttributes = array();
foreach ($aFilterableAttributes as $oFilterableAttribute) {
if ($oFilterableAttribute->getAttributeCode() != 'price') {
$aNewFilterableAttributes[] = $oFilterableAttribute;

if (is_array($aFilterableAttributes) || is_object($aFilterableAttributes)) {
foreach ($aFilterableAttributes as $oFilterableAttribute) {
if ($oFilterableAttribute->getAttributeCode() != 'price') {
$aNewFilterableAttributes[] = $oFilterableAttribute;
}
}
}
$oBlock->setData('_filterable_attributes', $aNewFilterableAttributes);
Expand Down Expand Up @@ -308,4 +311,4 @@ protected function getEventsProduct(Varien_Event_Observer $oObserver)
{
return $oObserver->getProduct();
}
}
}

0 comments on commit 4b8af84

Please sign in to comment.