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

Product SKU on Grouped Products page
 
SDGM
Jr. Member
 
Total Posts:  12
Joined:  2010-10-10
 

I am trying to add a couple of attributes to the grouped product grid.

I have attached an image showing how my grouped product page currently appears, and how I want it to appear.

Below is the code for grouped.phtml.  I have added in what I thought was the correct code for these changes, but nothing is appearing.

I have the SKU attribute set to show in front end.

This is the last thing I have to do before I can launch my site.  Any help would be great.

<?php


/**
 * Grouped product data template
 *
 * @see Mage_Catalog_Block_Product_View_Media
 * @see Mage_Catalog_Block_Product_View_Type_Grouped
 */
?>
<?php $_product 
$this->getProduct() ?>
<?php $_associatedProducts 
$this->getAssociatedProducts() ?>
<?php 
if($_product->isSaleable() && count($_associatedProducts)): ?>
    
<class=\"availability\"><?php echo $this->__(\'Availability: In stock.\'?></p>
<?php else: ?>
    
<class=\"availability\"><?php echo $this->__(\'Availability: Out of stock.\'?></p>
<?php endif; ?>
<table cellspacing=\"0\" class=\"data-table\" id=\"super-product-table\">
    <
col />
    <
col />
    <
col width=\"1\" />
    <
thead>
        <
tr>
        <!--
BEGIN CHANGE SEE IMAGE ///////////////////////////////////////////////////////////-->
        
<th><?php echo $this->__(\'Image\')
            
?></th>
            <!--
END CHANGE SEE IMAGE ///////////////////////////////////////////////////////// -->
            
<th><?php echo $this->__(\'Product Name\'?></th>
            <
th><?php echo $this->__(\'SKU\'?></th>
            <
th class=\"a-right\"><?php echo $this->__(\'Price\'?></th>
            
<?php if ($_product->isSaleable()): ?>
            
<th class=\"a-center\"><?php echo $this->__(\'Qty\'?></th>
            
<?php endif; ?>
        
</tr>
    </
thead>
    <
tbody>
    
<?php if (count($_associatedProducts)): ?>
    <?php 
foreach ($_associatedProducts as $_item): ?>
        <?php $_finalPriceInclTax 
$this->helper(\'tax\')->getPrice($_item$_item->getFinalPrice(), true?>
        
<tr>
        <!--
BEGIN CHANGE SEE IMAGE////////////////////////////////////////////////////////////////////// -->
       
<td>
<?php echo \'<A  href=\"\'.$this->helper(\'catalog/image\')->init($_item\'image\').\'\" ><img src=\"\'.$this->helper(\'catalog/image\')->init($_item\'thumbnail\')->resize(7777).\'\" width=\"77\"><a>\'?></td>
<!--
END CHANGE SEE IMAGE //////////////////////////////////////////////////////////////////////////////-->
            
<td><?php echo $this->htmlEscape($_item->getName()) ?></td>
            <
td><?php echo $this->htmlEscape($_item->getSku()) ?></td>
            <
td class=\"a-right\">
                
<?php echo $this->getPriceHtml($_itemtrue?>
                <?php 
echo $this->getTierPriceHtml($_item?>
            
</td>
            
<?php if ($_product->isSaleable()): ?>
            
<td class=\"a-center\">
            
<?php if ($_item->isSaleable()) : ?>
                
<input name=\"super_group[<?php echo $_item->getId() ?>]\" value=\"<?php echo $_item->getQty()*1 ?>\" type=\"text\" class=\"input-text qty\" />
            
<?php else: ?>
                <?php 
echo $this->__(\'Out of stock.\'?>
            <?php 
endif; ?>
            
</td>
            
<?php endif; ?>
        
</tr>
    
<?php endforeach; ?>
    <?php 
else: ?>
       
<tr>
           <
td colspan=\"<?php if ($_product->isSaleable()): ?>4<?php else : ?>3<?php endif; ?>\"><?php echo $this->__(\'No options of this product are available.\'?></td>
       </
tr>
    
<?php endif; ?>
    
</tbody>
</
table>
<
script type=\"text/javascript\">decorateTable(\'super-product-table\')</script>
Image Attachments
grouped.gif
 
Magento Community Magento Community
Magento Community
Magento Community
 
louise100
Sr. Member
 
Avatar
Total Posts:  168
Joined:  2009-01-26
UK
 

I found this post which has some code related to showing the associated product image on the product page:-

http://www.magentocommerce.com/wiki/4_-_themes_and_template_customization/catalog/change_product_image_on_view_page_to_associated_product_s_image

Not sure if you could use any of the code in there?

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