Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Custom Attribute as title
 
pazvanti
Jr. Member
 
Total Posts:  6
Joined:  2009-07-17
 

Is there any way I can set a custom attribute as the product title?
I want the title that is displayed to be the Author of the product, not the product itself. So I added the author to the “manufacturer” list. How can I now set this as the title? Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
Paul-xib
Sr. Member
 
Avatar
Total Posts:  116
Joined:  2009-02-02
The Netherlands
 

it is possible to show custom attributes. so you need to edit your catalog/product/view.phtml and other files where you want to show your attribute.

at the place where you want to show your attribute use this code:

(if the attribute is a textfield or textarea)

<?php echo $_product->getAttributeName() ?>

(if it is a dropdown)

<?php echo $_product->getAttributeText('attribute_name'?>

smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
pazvanti
Jr. Member
 
Total Posts:  6
Joined:  2009-07-17
 

Thanks.Works perfectly. :D

 
Magento Community Magento Community
Magento Community
Magento Community
 
shane_eller
Jr. Member
 
Total Posts:  4
Joined:  2009-07-16
Indianapolis, Indiana
 

I’m not able to get my custom attributes to display.

For example I have an attribute for amazon_sales_rank, and it shows up on the admin section but won’t display anything when using

$_product->getAmazonSalesRank(); on the view.phtml page.

Is there something I’m missing when creating the attributes that is important?

Thanks/

 
Magento Community Magento Community
Magento Community
Magento Community
 
Paul-xib
Sr. Member
 
Avatar
Total Posts:  116
Joined:  2009-02-02
The Netherlands
 
shane_eller - 10 August 2009 12:05 PM

I’m not able to get my custom attributes to display.

For example I have an attribute for amazon_sales_rank, and it shows up on the admin section but won’t display anything when using

$_product->getAmazonSalesRank(); on the view.phtml page.

Is there something I’m missing when creating the attributes that is important?

Thanks/

on your attribute page (in the admin) is this value:
Visible on Product View Page on Front-end

yes?

 
Magento Community Magento Community
Magento Community
Magento Community
 
ArmandoR
Jr. Member
 
Avatar
Total Posts:  21
Joined:  2008-08-21
Caldwell, Idaho, U.S.A.
 

Howdy. Just a thought. Why not use the array key. For example, if you have defined $_product.

<?php $_product $this->getProduct(); ?>

And if your new attribute was some_new_attribute:

<?php echo $_product['some_new_attribute'] ?>

Thanks. grin

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top