Note that there are some explanatory texts on larger screens.

plurals
  1. POHow I can sort Magento Category top Menu
    text
    copied!<p>i need sort the category navigation top in base of a parameter of the category. The parameter of the category is orden and this is add to Magento with the next script:</p> <pre><code>$installer = $this; $setup = new Mage_Eav_Model_Entity_Setup('core_setup'); $installer-&gt;startSetup(); $setup-&gt;addAttribute('catalog_category', 'sort', array( 'group' =&gt; 'General', 'input' =&gt; 'text', 'type' =&gt; 'varchar', 'label' =&gt; 'sort', 'backend' =&gt; '', 'visible' =&gt; 1, 'required' =&gt; 0, 'user_defined' =&gt; 1, 'global' =&gt; Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, )); $installer-&gt;endSetup(); </code></pre> <p>But i don´t know how sort in base of this attribute. If you see Mage_Catalog_Block_Navigation you can see the next function </p> <pre><code>/** * Get catagories of current store * * @return Varien_Data_Tree_Node_Collection */ public function getStoreCategories() { $helper = Mage::helper('catalog/category'); return $helper-&gt;getStoreCategories(); } </code></pre> <p>This is a Varien_Data_Tree_Node_Collection object type that i don´t how sort this type of object, i think in get collection of the categories and order this in base of my custom attribute, given that you can passing true parameter to </p> <pre><code>return $helper-&gt;getStoreCategories(false,true); </code></pre> <p>and get and type Mage_Catalog_Model_Resource_Eav_Mysql4_Category_Collection and try order this.</p> <p>Any Ideas for this problem?? Thanks in advance</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload