Version Notes
Flyermenu
Download this release
Release Info
Developer | Gaggle |
Extension | flyer_menu |
Version | 1.0.1 |
Comparing to | |
See all releases |
Code changes from version 1.0.0 to 1.0.1
app/code/local/Gaggle/Flyermenu/Block/Flyermenu.php
CHANGED
@@ -12,14 +12,29 @@ class Gaggle_Flyermenu_Block_Flyermenu extends Mage_Core_Block_Template{
|
|
12 |
$html=$this->_getHtml($rootCategory);
|
13 |
return $html;
|
14 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
protected function _getHtml($category)
|
16 |
{
|
17 |
-
$children=$
|
18 |
$parentLevel = $category->getLevel();
|
19 |
$html='<ul >';
|
20 |
-
foreach(
|
21 |
{
|
22 |
-
|
23 |
if($child->getIsActive()&&$child->getInclude_in_menu())
|
24 |
{
|
25 |
$html .= '<li class="level-'.$parentLevel.'" >';
|
12 |
$html=$this->_getHtml($rootCategory);
|
13 |
return $html;
|
14 |
}
|
15 |
+
function getSortedChildCategories($category)
|
16 |
+
{
|
17 |
+
$childrenArray = explode(',',$category->getChildren());
|
18 |
+
// remove parent id from array in case it gets returned
|
19 |
+
if ($key = array_search($category->getId(), $childrenArray)) {
|
20 |
+
unset($childrenArray[$key]);
|
21 |
+
}
|
22 |
+
$collection = Mage::getModel('catalog/category')->getCollection()
|
23 |
+
->addAttributeToFilter('entity_id', array('in' => $childrenArray))
|
24 |
+
->addAttributeToSelect('*')
|
25 |
+
->setOrder('position','ASC');
|
26 |
+
|
27 |
+
|
28 |
+
return $collection;
|
29 |
+
}
|
30 |
protected function _getHtml($category)
|
31 |
{
|
32 |
+
$children=$this->getSortedChildCategories($category);
|
33 |
$parentLevel = $category->getLevel();
|
34 |
$html='<ul >';
|
35 |
+
foreach($children as $child)
|
36 |
{
|
37 |
+
|
38 |
if($child->getIsActive()&&$child->getInclude_in_menu())
|
39 |
{
|
40 |
$html .= '<li class="level-'.$parentLevel.'" >';
|
package.xml
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>flyer_menu</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL 3.0)</license>
|
7 |
<channel>community</channel>
|
@@ -10,9 +10,9 @@
|
|
10 |
<description>Flyermenu</description>
|
11 |
<notes>Flyermenu</notes>
|
12 |
<authors><author><name>Gaggle</name><user>Any</user><email>gaggle.thread@gmail.com</email></author></authors>
|
13 |
-
<date>2015-
|
14 |
-
<time>
|
15 |
-
<contents><target name="magelocal"><dir name="Gaggle"><dir name="Flyermenu"><dir name="Block"><file name="Flyermenu.php" hash="
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>flyer_menu</name>
|
4 |
+
<version>1.0.1</version>
|
5 |
<stability>stable</stability>
|
6 |
<license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL 3.0)</license>
|
7 |
<channel>community</channel>
|
10 |
<description>Flyermenu</description>
|
11 |
<notes>Flyermenu</notes>
|
12 |
<authors><author><name>Gaggle</name><user>Any</user><email>gaggle.thread@gmail.com</email></author></authors>
|
13 |
+
<date>2015-04-19</date>
|
14 |
+
<time>08:50:26</time>
|
15 |
+
<contents><target name="magelocal"><dir name="Gaggle"><dir name="Flyermenu"><dir name="Block"><file name="Flyermenu.php" hash="c97d9cf51ecb262a06d06190b1bd98ea"/></dir><dir name="Helper"><file name="Data.php" hash="d6c0187663c04a9f2fd9c78d22182ae1"/></dir><dir name="Model"><file name="Options.php" hash="7468f87b46660b44989dbedc7f3d7a97"/></dir><dir name="controllers"><file name="IndexController.php" hash="60cee570a2251f12cb67bb1b762285e9"/></dir><dir name="etc"><file name="adminhtml.xml" hash="bbb92272e1972c7a3b22ba434f04e10a"/><file name="config.xml" hash="5ee7d5d77793a07de1ca66fb99ca7c94"/><file name="system.xml" hash="a9287e71ec6106afd4c4fe9db58d883d"/></dir><dir name="sql"><dir name="flyermenu_setup"><file name="mysql4-install-1.0.0.php" hash="ec6570a3301cd0099203c736962c9040"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Gaggle_Flyermenu.xml" hash="580078936bd0394519461d31f18343de"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><dir name="gaggle"><file name="flyermenu.xml" hash="a71d66443125bf6543dc26aed36ae012"/></dir></dir><dir name="template"><dir name="gaggle"><dir name="flyermenu"><file name="flyermenu.phtml" hash="eb2c833ae50e3a31f4dba416c88e0e4f"/></dir></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="gaggle"><dir name="flyermenu"><dir name="css"><file name="styles.css" hash="73346c691554c3b392fa089deef2b72d"/></dir></dir></dir></dir></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|