Skip to content

Instantly share code, notes, and snippets.

@thor48
Forked from americkson/gist:5354605
Created November 5, 2013 14:34
Show Gist options
  • Save thor48/7319897 to your computer and use it in GitHub Desktop.
Save thor48/7319897 to your computer and use it in GitHub Desktop.

Truncate Text

truncate($STRING, $LENGTH); ?>

Ways to print attributes

  • this should work for drop downs and multi-select
getAttributeText('attribute_name'); ?>
  • this should work for text fields
getAttributeName(); ?>
  • this should work for text areas
productAttribute($_product, nl2br($_product->getAttributeName()), 'attribute_name') ?>
  • this is another possible method
htmlEscape($_product->getData('attribute_name')); ?>

custom list.phtml

put this in local.xml where the '3' is the category ID

<CATEGORY_3>
    <reference name="product_list">
        <action method="setTemplate"><name>catalog/product/software.phtml</name></action>
    </reference>
</CATEGORY_3>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment