Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I had the same issue. This is how I solved it:</p> <p>app/code/local/yourmodulename/sql/yourcustomattribute_setup/mysql4-upgrade-0.0.9-0.1.3.php</p> <pre><code>&lt;?php $installer = $this; $installer-&gt;startSetup(); $installer-&gt;addAttribute("catalog_category", "your_attribute", array( "type" =&gt; "varchar", "backend" =&gt; "", "frontend" =&gt; true, "label" =&gt; "Your Attribute", "input" =&gt; "text", "class" =&gt; "", "source" =&gt; "", "global" =&gt; Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, "visible" =&gt; true, "required" =&gt; false, "user_defined" =&gt; false, "default" =&gt; "", "searchable" =&gt; false, "filterable" =&gt; false, "comparable" =&gt; false, "visible_on_front" =&gt; true, "unique" =&gt; true, "note" =&gt; "" )); $installer-&gt;endSetup(); </code></pre> <p>app/code/local/yourmodulename/etc/config.xml</p> <pre><code>&lt;config&gt; &lt;modules&gt; &lt;Yournamespace_Yourmodulename&gt; &lt;version&gt;0.1.3&lt;/version&gt; &lt;/Yournamespace_Yourmodulename&gt; &lt;/modules&gt; &lt;frontend&gt; &lt;routers&gt; &lt;yourmodulename&gt; &lt;use&gt;standard&lt;/use&gt; &lt;args&gt; &lt;module&gt;Yournamespace_Yourmodulename&lt;/module&gt; &lt;frontName&gt;categoryattribute&lt;/frontName&gt; &lt;/args&gt; &lt;/yourmodulename&gt; &lt;/routers&gt; &lt;category&gt; &lt;collection&gt; &lt;attributes&gt; &lt;yourmodulename /&gt; &lt;/attributes&gt; &lt;/collection&gt; &lt;/category&gt; &lt;layout&gt; &lt;updates&gt; &lt;yourmodulename&gt; &lt;file&gt;categoryattribute.xml&lt;/file&gt; &lt;/yourmodulename&gt; &lt;/updates&gt; &lt;/layout&gt; &lt;/frontend&gt; &lt;global&gt; &lt;helpers&gt; &lt;yourmodulename&gt; &lt;class&gt;Yournamespace_Yourmodulename_Helper&lt;/class&gt; &lt;/yourmodulename&gt; &lt;/helpers&gt; &lt;blocks&gt; &lt;yourmodulename&gt; &lt;class&gt;Yournamespace_Yourmodulename_Block&lt;/class&gt; &lt;/yourmodulename&gt; &lt;/blocks&gt; &lt;models&gt; &lt;yourmodulename&gt; &lt;class&gt;Yournamespace_Yourmodulename_Model&lt;/class&gt; &lt;resourceModel&gt;categoryattribute_mysql4&lt;/resourceModel&gt; &lt;/yourmodulename&gt; &lt;/models&gt; &lt;resources&gt; &lt;yourmodulenamee_setup&gt; &lt;setup&gt; &lt;module&gt;Yournamespace_Yourmodulename&lt;/module&gt; &lt;class&gt;Mage_Catalog_Model_Resource_Eav_Mysql4_Setup&lt;/class&gt; &lt;/setup&gt; &lt;connection&gt; &lt;use&gt;core_setup&lt;/use&gt; &lt;/connection&gt; &lt;/yourmodulename_setup&gt; &lt;yourmodulename_write&gt; &lt;connection&gt; &lt;use&gt;core_write&lt;/use&gt; &lt;/connection&gt; &lt;/yourmodulename_write&gt; &lt;yourmodulename_read&gt; &lt;connection&gt; &lt;use&gt;core_read&lt;/use&gt; &lt;/connection&gt; &lt;/yourmodulename_read&gt; &lt;/resources&gt; &lt;/global&gt; &lt;/config&gt; </code></pre> <p>app/etc/modules/Your_modulename.xml</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;config&gt; &lt;modules&gt; &lt;Yournamespace_Yourmodulename&gt; &lt;active&gt;true&lt;/active&gt; &lt;codePool&gt;local&lt;/codePool&gt; &lt;version&gt;0.1.3&lt;/version&gt; &lt;/Yournamespace_Yourmodulename&gt; &lt;/modules&gt; &lt;/config&gt; </code></pre> <p>Check you database to see if the sql has been installed under "Eav Attribute"</p> <p>You custom category attribute should now be showing in the frontend!!!!</p> <p>Now all you need to do is show the attribute on the frontened using: </p> <pre><code>&lt;?php echo $_product-&gt;getYourattributeid(); ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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