-
Categories
-
Tags
attributes awards Boulder category list Code code formatting Colorado CSS custom attributes debugging Denver design discount web design discount web development featured sites freelance Free Theme great web design articles green business HTML jQuery magento magento development magento product attributes News non-profit php Post_ pr Premium Wordpress Theme product grid product list psd to magento recognition sessions small business testimonial Web Design Web Design Resources web developer web development web devleopment wordpress wordpress templates Wordpress Theme -
archives
Getting Custom Attributes in Magento
One of the flexible features of Magento is the ability to create custom attributes for products. This allows you to display and use any type of information for your products. It also allows you to specify options and choices when the user purchases the product. Often these custom attributes need to be displayed on the product detail pages. Let’s assume you are familiar with making custom attributes – so here are a few quick snippets to access Magento’s custom attributes:
Text Attributes
// Display the value of a text attribute // Where getAttributeCode is the value you entered for the attribute code <?php echo $_product->getAttributeCode; ?>
Textarea Attributes
// Display the value of a text area custom attribute // Where attributeCode is the value you entered for the attribute code <?php echo $_product->attributeCode; ?>
Drop Down Attributes
// Display the value of a drop down custom attribute // Where attribute_code is the value you entered for the attribute code <?php echo $_product->getAttributeText('attribute_code'); ?>
Check back for more snippets on each attribute type – as I come across the need for them I will add to this article.
This entry was posted in Magento and tagged attributes, custom attributes, magento, magento product attributes, web development. Bookmark the permalink.
Looked all over for this – worked great.
Cheers,
Ian
Pingback: Magento Custom Attributes in Product List | Bret Glassett – Denver web developer || Magento development, Wordpress development, Drupal development. ExpressionEngine development