Question

On my grouped products if the product has a tier price then it shows it in each table row for every product. Is there a way i can get the tier price to show just under the title of the product. I have added a picture to show you the problem and also where i want the tier price to be shown. enter image description here

My grouped.phtml looks like this

<?php $this->setPreconfiguredValue(); ?>
<?php $_product = $this->getProduct(); ?>
<?php $_associatedProducts = $this->getAssociatedProducts(); ?>
<?php $_hasAssociatedProducts = count($_associatedProducts) > 0; ?>
<?php if ($_product->isAvailable() && $_hasAssociatedProducts): ?>
    <p class="availability availability-grouped in-stock"><?php echo $this->__('Availability:') ?> <span><?php echo $this->__('In stock') ?></span></p>
<?php else: ?>
    <p class="availability availability-grouped out-of-stock"><?php echo $this->__('Availability:') ?> <span><?php echo $this->__('Out of stock') ?></span></p>
<?php endif; ?>



<?php if (Mage::getStoreConfig('settings/labels/sku')): ?>
<p class="sku-grouped"><?php echo $this->__('Code:') ?> <span><?php echo $_product->getSku() ?></span></p>
<?php endif; ?>
<?php echo $this->getChildHtml('product_type_data_extra') ?>
<table class="data-table grouped-items-table" id="super-product-table">
    <col />
    <col />
    <col width="1" />
    <thead>
        <tr>
            <th><?php echo $this->__('Size') ?></th>
            <?php if ($this->getCanShowProductPrice($_product)): ?>
            <th class="a-left"><?php echo $this->__('Price') ?></th>
            <?php endif; ?>
            <?php if ($_product->isSaleable()): ?>
            <th class="a-center"><?php echo $this->__('Qty') ?></th>
            <?php endif; ?>
        </tr>
    </thead>
    <tbody>
    <?php if ($_hasAssociatedProducts): ?>
    <?php foreach ($_associatedProducts as $_item): ?>
        <?php $_finalPriceInclTax = $this->helper('tax')->getPrice($_item, $_item->getFinalPrice(), true) ?>
        <tr>
            <td><?php echo $this->htmlEscape($_item->getName()) ?></td>
            <?php if ($this->getCanShowProductPrice($_product)): ?>
            <td class="a-left">
                <?php if ($this->getCanShowProductPrice($_item)): ?>
                <?php echo $this->getPriceHtml($_item, true) ?>
            <?php $this->getTierPriceHtml($_item)?> 
                <br>
                <?php if ( $_item->getTierPrice()): ?>
                <?php echo $this->getTierPriceHtml($_item)?> 
                <?php endif; ?>  
                <?php endif; ?>
            </td>
            <?php endif; ?>
            <?php if ($_product->isSaleable()): ?>
            <td class="a-center">
            <?php if ($_item->isSaleable()) : ?>
                <input type="text" name="super_group[<?php echo $_item->getId() ?>]" maxlength="12" value="<?php echo $_item->getQty()*1 ?>" title="<?php echo $this->__('Qty') ?>" class="input-text qty" />
            <?php else: ?>
                <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p>
            <?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>
<div>

This block of code show my tier price

    <?php $this->getTierPriceHtml($_item)?> 
        <br>
        <?php if ( $_item->getTierPrice()): ?>
        <?php echo $this->getTierPriceHtml($_item)?> 
        <?php endif; ?> 

I tried to just move this to where the SKU is being called but i get the error, calling on a non-object. I assume this si because the main product doesnt have a tier price and the associated products haven't been loaded yet. IF this is the case how can i get the associated products to load so i can grab the tier price

If i am not being clear just let me know and i will try to clear it up for you.

Thank you in advance for your help.

Was it helpful?

Solution

as you define you want tire price as the arrow indicate.

So in this case if i am not wrong you want the tire price only one time at the top of the list.?!

so you have to just make another loop structure same as hall product collection get and only get tire price and store in variable and display at top.

if i am not getting your question describe in depth. Thanks.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top