-
Categories
-
Tags
attributes authorize.net awards category list Code code formatting CSS custom attributes debug debugging design featured sites Free Theme great web design articles HTML jQuery jQuery Tabs magento magento development magento product attributes News payment methods php Post_ Premium Wordpress Theme product grid product list programming recognition sessions Web Design Web Design Resources web development wordpress 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 Code, 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