Skip to content

Commit dee4855

Browse files
luigifabfballiano
authored andcommitted
Added support for "ifconfig" for layout updates (#2974)
1 parent 75b62de commit dee4855

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

app/code/core/Mage/Core/Model/Layout/Update.php

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -405,10 +405,16 @@ protected function _getUpdateString($handle)
405405
public function fetchRecursiveUpdates($updateXml)
406406
{
407407
foreach ($updateXml->children() as $child) {
408-
if (strtolower($child->getName()) == 'update' && isset($child['handle'])) {
409-
$this->merge((string)$child['handle']);
410-
// Adding merged layout handle to the list of applied hanles
411-
$this->addHandle((string)$child['handle']);
408+
if ((strtolower($child->getName()) == 'update') && isset($child['handle'])) {
409+
$allow = true;
410+
if (isset($child['ifconfig']) && ($configPath = (string)$child['ifconfig'])) {
411+
$allow = Mage::getStoreConfigFlag($configPath);
412+
}
413+
if ($allow) {
414+
$this->merge((string)$child['handle']);
415+
// Adding merged layout handle to the list of applied hanles
416+
$this->addHandle((string)$child['handle']);
417+
}
412418
}
413419
}
414420
return $this;

0 commit comments

Comments
 (0)