Tuesday, February 21, 2012

Creating and Displaying Custom Attribute in Magento

0

It is easy and fast in creating and displaying custom attribute in product view. First go to Catalog-->Attributes-->Manage Attributes Then Add New Atrribute After that, go to Manage Attribute Set, then you must include you're created attribute to an attribute set. Drag the attribute from unassigned attribute to the group. If you will go to a certain product which is using that attribute set, you will see you're created attribute in the General Product Information. That's it! Now you will display the custom attribute in product view which is

app/design/frontend/default/name_of_your_theme/template/catalog/product/view.phtml.
This is for using textbox and textareas
getDisplayAttribute() ?>
If you are using underscores, you must remove theme and capitalize the next word. For example, "shoe_color", you must use this instead in calling your attribute name
getShoeColor();
if it is only one word for example attribute name: test
getTest() ?>
This for the using mulitselect and dropdowns
displayAttributeName('attribute_name') ?>
You must declare the actual name of the attribute to show multiselect or dropdown.

0 comments:

Post a Comment

Speak my Friend

 
Design by ThemeShift | Bloggerized by Lasantha - Free Blogger Templates | Best Web Hosting