1

I need to show a message such as "call us" for certain products.

I cannot find any extension that works nicely with grouped products (which I use) - so making my own hack seems to be the only solution.

I saw this thread: Hiding Price if 0

and using that, we get the code:

<?php if ($_product->getFinalPrice() == 0) : ?>
    <h2>Call  To Order</h2>
<?php else: ?> 
    <?php echo $this->getPriceHtml($_product); ?>
<?php endif; ?>

But maybe I don't put it in correctly, but it shows the call to order message for me + prices for all items in the list. Here is my code:

<td class="a-right">
                <?php if ($this->getCanShowProductPrice($_item)): ?>
                <?php echo $this->getPriceHtml($_item, true) ?>

                <?php //new hide price function ?>
                <?php if ($_product->getFinalPrice() == 0) : ?>
                <h2>Call  To Order</h2>
                <?php else: ?> 
                <?php echo $this->getPriceHtml($_product); ?>
                <?php endif; ?>
                <?php //end of new hide price function ?>


                <?php echo $this->getTierPriceHtml($_item) ?>
                <?php endif; ?>
            </td>

Any tips on how to get that working? Thanks!

2

Try

<td class="a-right">
            <?php if ($this->getCanShowProductPrice($_item)): ?>


            <?php //new hide price function ?>
            <?php if ($_item->getFinalPrice() == 0) : ?>
            <h2>Call  To Order</h2>
            <?php else: ?> 
            <?php echo $this->getPriceHtml($_item); ?>
            <?php endif; ?>
            <?php //end of new hide price function ?>


            <?php echo $this->getTierPriceHtml($_item) ?>
            <?php endif; ?>
        </td>

and if that dont work, change $_item for $_product.

  • 1
    OH YOU ARE A GENIUS!!! spent a day on this, and its fixed in 2 secs. LOVE YOU!!!!! – egg Jul 25 '14 at 16:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.