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

Move the position of “additional attributes”
 
redbelt
Jr. Member
 
Total Posts:  3
Joined:  2008-09-02
 

Hi,

I’m interested in using Magento, and i have a copy installed on a test area but there are a few things which I can’t work out - the first of which is “if” and “how” I could move the postion of the “additional attributes”.

Normally these are shown below the main product description, but I’m planning to use them for something slightly different, which means I would like this shown just below the price and add to cart buttons. Which files would I need to make adjustments to for this? I’m guessing maybe the “additonal.phtml” and single, or price files?

All suggestions gratefully received!

 
Magento Community Magento Community
Magento Community
Magento Community
 
somesid
Sr. Member
 
Total Posts:  83
Joined:  2008-06-20
 

Well it depends of what exactly you want to do, if you only want to move the table showing the additional attributes, you’re right it has to do with additional.phtml, just move in \app\design\frontend\default\default\template\catalog\product\view.phtml the following code where you want the table to be.

<?php if ($_additional $this->getChildHtml('additional')):?>
    
<div class="collateral-box">
        <
div class="head">
            <
h4><?php echo $this->__('Additional Information'?></h4>
        </
div>
    
<?php echo $_additional ?>
    
</div>
<?php endif;?>

If you want to display only one specific attribute anywhere in the view.phtml page, you can directly call the value like that :

// if it's a text attribute called for example 'attribute_name'
$_product->getAttributeName();

// if it's a select attribute called for example 'attribute_select'
$_product->getAttributeText('attribute_select');

Refer to this page if you want to display your custom attributes in list.

 
Magento Community Magento Community
Magento Community
Magento Community
 
redbelt
Jr. Member
 
Total Posts:  3
Joined:  2008-09-02
 

That’s worked as I wanted it to - thanks very much!

Following question (still to do with additional attributes), is it possible to show a third attribute in the row so you would have “column name - attribute one - attribute two” or for example it might look something like “Ford - Blue - Hatchback”?

 
Magento Community Magento Community
Magento Community
Magento Community
 
somesid
Sr. Member
 
Total Posts:  83
Joined:  2008-06-20
 

Yeah well you can change anything you want in the template so that would be in attributes.phtml (and not additionnal.phtml as I said earlier).

And you can do something like that to get a table with 3 cells (6 because there is the value and the label):

<?php if($_additional $this->getAdditionalData()): ?>
        
<?php $cont 
0?>
<?php 
foreach ($_additional as $_data): ?>
    <?php 
if($cont++ % == 0) echo '<tr>'?>
        
<td width="33%"><?php echo $_data['label'] ?></td>
    <
td width="33%"><?php echo $_data['value'] ?></td>
    
<?php if($cont == 0) echo '</tr>'?>
<?php 
endforeach; ?>

<?php 
endif;?>
 
Magento Community Magento Community
Magento Community
Magento Community
 
redbelt
Jr. Member
 
Total Posts:  3
Joined:  2008-09-02
 

I can see what that does, but in retrospect I think I’m asking a different question as I was really wanting the [’label’] followed by two related [’values’], which isn’t how attributes are set up to be fair - they have one label with one value. Think I might have to have a rethink..

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