Skip to content

Instantly share code, notes, and snippets.

@just-tom
Created June 10, 2015 12:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save just-tom/479c3f8578738fcb6ae1 to your computer and use it in GitHub Desktop.
Save just-tom/479c3f8578738fcb6ae1 to your computer and use it in GitHub Desktop.
Add custom attributes to collections with XML
/** Add custom attribute to category collection on frontend */
<frontend>
<category>
<collection>
<attributes>
<some_category_attribute/>
</attributes>
</collection>
</category>
</frontend>
/** Add custom attribute to product collection on frontend */
<frontend>
<product>
<collection>
<attributes>
<some_product_attribute/>
</attributes>
</collection>
</product>
</frontend>
/** Add attributes to any config node that permits it e.g sales_quote_item */
<global>
<sales>
<quote>
<item>
<product_attributes>
<some_product_attribute />
</product_attributes>
</item>
</quote>
</sales>
</global>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment