Skip to content

Commit 5a534ca

Browse files
committed
Merge pull request #1 from osrecio/patch-1
getAllOptions from parent
2 parents 3e5dfc3 + 7246725 commit 5a534ca

File tree

1 file changed

+8
-20
lines changed
  • code/local/AM/SubCatMode/Model/Catalog/Category/Attribute/Source

1 file changed

+8
-20
lines changed

code/local/AM/SubCatMode/Model/Catalog/Category/Attribute/Source/Mode.php

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,16 @@
22

33
class AM_SubCatMode_Model_Catalog_Category_Attribute_Source_Mode extends Mage_Catalog_Model_Category_Attribute_Source_Mode
44
{
5+
56
public function getAllOptions()
67
{
7-
if (!$this->_options) {
8-
$this->_options = array(
9-
array(
10-
'value' => Mage_Catalog_Model_Category::DM_PRODUCT,
11-
'label' => Mage::helper('catalog')->__('Products only'),
12-
),
13-
array(
14-
'value' => Mage_Catalog_Model_Category::DM_PAGE,
15-
'label' => Mage::helper('catalog')->__('Static block only'),
16-
),
17-
array(
18-
'value' => Mage_Catalog_Model_Category::DM_MIXED,
19-
'label' => Mage::helper('catalog')->__('Static block and products'),
20-
),
21-
array(
8+
$listModes = parent::getAllOptions();
9+
10+
$newlistmodes[] = array(
2211
'value' => AM_SubCatMode_Model_Catalog_Category::DM_SUBCATEGORIES,
23-
'label' => Mage::helper('catalog')->__('Subcategories only'),
24-
)
25-
);
26-
}
27-
return $this->_options;
12+
'label' => Mage::helper('catalog')->__('Subcategories only')
13+
);
14+
15+
return array_merge($listModes,$newlistmodes);;
2816
}
2917
}

0 commit comments

Comments
 (0)