/** * Returns the inherited DefaultGroupView * * @param SilvercartProductGroupPage $context Context * * @return string */ public function getDefaultGroupViewInherited($context = null) { if (is_null($context)) { $context = $this; } $defaultGroupView = $context->DefaultGroupView; if (empty($defaultGroupView) || SilvercartGroupViewHandler::getGroupView($defaultGroupView) === false) { if ($context->Parent() instanceof SilvercartProductGroupPage) { $defaultGroupView = $this->getDefaultGroupViewInherited($context->Parent()); } else { if ($context->Parent() instanceof SilvercartProductGroupHolder) { $defaultGroupView = $this->getDefaultGroupViewInherited($context->Parent()); } else { $defaultGroupView = SilvercartGroupViewHandler::getDefaultGroupView(); } } } return $defaultGroupView; }