error in details, if no category is defined for current article (#3160)

This commit is contained in:
Daniel Seifert 2014-10-23 08:38:08 +00:00
parent 48e7ecbaa2
commit 94b1596d1f

View File

@ -22,6 +22,7 @@ class d3_oxbasket_googleanalytics extends d3_oxbasket_googleanalytics_parent
public function d3GetCurrentLocatorTitle() public function d3GetCurrentLocatorTitle()
{ {
$sTitle = ''; $sTitle = '';
/** @var oxview $oView */
$oView = oxRegistry::getConfig()->getActiveView(); $oView = oxRegistry::getConfig()->getActiveView();
if (method_exists($oView, 'getBreadCrumb') && if (method_exists($oView, 'getBreadCrumb') &&
@ -32,8 +33,13 @@ class d3_oxbasket_googleanalytics extends d3_oxbasket_googleanalytics_parent
} }
} elseif ($oView->getClassName() == 'details' && } elseif ($oView->getClassName() == 'details' &&
( (
($oCatPath = $oView->getCategoryTree()->getPath()) || (
($oCatPath = $oView->getManufacturerTree()->getPath()) ($oCatTree = $oView->getCategoryTree()) &&
($oCatPath = $oCatTree->getPath())
) || (
($oCatTree = $oView->getManufacturerTree()) &&
($oCatPath = $oCatTree->getPath())
)
) )
) { ) {
foreach ($oCatPath as $oCat) { foreach ($oCatPath as $oCat) {