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

Calling data from an attribute? 
 
maxq
Sr. Member
 
Avatar
Total Posts:  126
Joined:  2008-10-27
Florida
 

I created an attribute called Specifications and then a new tab in product detail.
Can someone tell me how to pull that information into the tab area?

Here’s the code I’m using (which doesn’t work)
..........................................
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Magento to newer
* versions in the future. If you wish to customize Magento for your
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category design_default
* @package Mage
* @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

/**
* Product description template
*
* @see Mage_Catalog_Block_Product_View_Specifications
*/
?>
<div class="product-specs">
<?php echo nl2br($this->getProduct()->getSpecifications()) ?>
</div>

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
nico5
Sr. Member
 
Avatar
Total Posts:  214
Joined:  2008-02-19
France
 

Try $this->getProduct()->getData(’specifications’)

 
Magento Community Magento Community
Magento Community
Magento Community
 
maxq
Sr. Member
 
Avatar
Total Posts:  126
Joined:  2008-10-27
Florida
 

Hi
I’m not completely sure of the syntax as I’m not a PHP guy, I kind of got this dropped on me so I’m trying to work out the bugs.
Here’s what I have
<?php echo nl2br($this->getProduct()->getData(’specifications’)) ?>

I get a “use of undefined constant error”
Thanks for your help.

 
Magento Community Magento Community
Magento Community
Magento Community
 
quadra
Jr. Member
 
Avatar
Total Posts:  30
Joined:  2008-05-06
 

Are you sure this error is for the line <?php echo nl2br($this->getProduct()->getData(’specifications’)) ?> ??

 
Magento Community Magento Community
Magento Community
Magento Community
 
maxq
Sr. Member
 
Avatar
Total Posts:  126
Joined:  2008-10-27
Florida
 

Hi yes I think so, here’s the top line of the error message.

Notice: Use of undefined constant �specifications� - assumed ‘�specifications�’ in /home/content/a/i/t/aitproducts/html/app/design/frontend/default/ait/template/catalog/product/view/specifications.phtml on line 34

 
Magento Community Magento Community
Magento Community
Magento Community
 
nico5
Sr. Member
 
Avatar
Total Posts:  214
Joined:  2008-02-19
France
 

Did you forget the ‘’ around specifications ?

 
Magento Community Magento Community
Magento Community
Magento Community
 
maxq
Sr. Member
 
Avatar
Total Posts:  126
Joined:  2008-10-27
Florida
 

This is what I currently have…

<?php echo nl2br($this->getProduct()->getData("specifications")) ?>

This is my test page http://aitproducts.com/index2.php/products/snakeeye/snakeeyetm-ii-inspection-system.html
But nothing is appearing in the tab content.

I appreciate your help.
Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
maxq
Sr. Member
 
Avatar
Total Posts:  126
Joined:  2008-10-27
Florida
 

just got it to work, thanks very much for your help..
Fantastic

 
Magento Community Magento Community
Magento Community
Magento Community
 
maxq
Sr. Member
 
Avatar
Total Posts:  126
Joined:  2008-10-27
Florida
 

well kind of..
It seems to have a big blank area then the content starts further down the page.
I also have a similar problem with applications tab as it shows the specifications below that, do you know how to fix that?

I know you are not tech support and everyone’s time is valuable so I really appreciate your help.

 
Magento Community Magento Community
Magento Community
Magento Community
 
nico5
Sr. Member
 
Avatar
Total Posts:  214
Joined:  2008-02-19
France
 

This is what I see.

Image Attachments
snake.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
 
maxq
Sr. Member
 
Avatar
Total Posts:  126
Joined:  2008-10-27
Florida
 

Thanks
I think I got it figured out, when you click on the Specifications tab it was displaying data way down the page, not sure why but I’m debugging it now.

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