Call-back icon  Sales: Call 800.374.8146 (N America)|757.278.0920 (International)

Magento

Open Source eCommerce Evolved

Magento Forum

   
Help with grouped products display !! 
 
Burton S.
Jr. Member
 
Avatar
Total Posts:  13
Joined:  2008-02-28
 

Let me start off by saying that I know nothing about PHP, but as a work around, in order to use Magento I need to modify some of the PHP in grouped.phtml. Grouped products are displayed as follows on the front end:

Product One-- Price Qty.
Product Two-- Price Qty.
Product Three Price Qty.
Product Four- Price Qty.

For reasons I won’t bore you with, I need to be able to display products like this:

Product One-- Price Qty. .Product Two-- Price Qty
Product Three Price Qty. .Product Four- Price Qty

After educating myself a little on PHP, I should be able to get rid of the table html so that all of the products appear in one row. I’ve tried that and it seems to work just fine.

I think I should then be able to use the “Modulas %” operator to add a <br> after every other product as the code loops through. This is where I’m lost though. I have no idea on how to add this to the code.

I’ve copied the section of grouped.phtml that displays the products below for your reference. Please help! Any guidance would really be a life saver right now.

Thanks,

John

<?php $_product = $this->getProduct() ?>
<?php $_associatedProducts = $this->getAssociatedProducts() ?>
<table cellspacing="0" class="data-table" id="super-product-table">
<thead>
<tr>
<th><?php echo $this->__('Product Name') ?></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): ?>
<tr>
<td><?php echo $this->htmlEscape($_item->getName()) ?></td>
<td class="a-right">
<?php $_price = $_item->getPrice() ?>
<?php $_finalPrice = $_item->getFinalPrice() ?>
<?php if ($_finalPrice == $_price): ?>
<span class="nobr"><?php echo Mage::helper('core')->currency($_price) ?></span><br />
<?php else: ?>
<span class="nobr old-price"><?php echo $this->__('Price') ?> <?php echo Mage::helper('core')->currency($_price) ?></span><br />
<span class="nobr special-price” style="font-size:12px;"><?php echo $this->__('Special Price') ?> <?php echo Mage::helper('core')->currency($_finalPrice) ?></span>
<?php endif; ?>
<?php if($_item->getTierPriceCount()): ?>
<?php foreach ($_item->getFormatedTierPrice() as $_tierPrice): ?>
<?php if($_tierPrice['price'] <= $_finalPrice): ?>
<span class="nobr"><?php echo $this->__('Buy %s for %s', $_tierPrice['price_qty']*1, $_tierPrice['formated_price']) ?></span>
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
</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>

 Signature 

Burton
ver. 1.0.19870.1

http://www.goBrandSource.com

 
Magento Community Magento Community
Magento Community
Magento Community
 
Burton S.
Jr. Member
 
Avatar
Total Posts:  13
Joined:  2008-02-28
 

Come on… I know there are some PHP Gurus on this board that can point me in the right direction.

Any suggestion at all would be greatly appreciated.

Thanks,

TG

 Signature 

Burton
ver. 1.0.19870.1

http://www.goBrandSource.com

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
 
Sales: Call 800.374.8146 (North America) 757.278.0920 (International)
© Copyright 2008 Varien. Magento is a trademark of Irubin Consulting Inc. DBA Varien
Privacy Policy|Terms of Service
Magento Community Count
33739 users|445 users currently online|74746 forum posts