5

I am planning to allow the guest user to be able to view the product catalog. But I would like them not to see the prices. Is there a way to do that?

3

1 Answer 1

8

You have a few options:

Do it yourself

app/design/frontend/default/default/template/catalog/product/price.phtml

insert at the very beggining of the file:

<?php if (Mage::getSingleton('customer/session')->isLoggedIn()) { ?>

insert at the very end of the file

<?php } ?>

hiding add to cart:

app/design/frontend/default/default/template/catalog/product/list.phtml

<?php if($_product->isSaleable()): ?>
                    <button class="form-button" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><?php echo $this->__('Add to Cart') ?></span></button>
                <?php else: ?>
                <div class="out-of-stock"><?php echo $this->__('Out of stock') ?></div>
                <?php endif; ?>

before that code insert:

<?php if (Mage::getSingleton('customer/session')->isLoggedIn()) { ?>

after that code insert:

<?php } ?>

you will find two times in the file..(one for the list mode one for grid mode!)

app/design/frontend/default/default/template/catalog/product/view.phtml

<div class="add-to-holder">
                    <?php if($_product->isSaleable()): ?>
                        <?php echo $this->getChildHtml('addtocart') ?>
                        <?php if( $this->helper('wishlist')->isAllow() || $_compareUrl=$this->helper('catalog/product_compare')->getAddUrl($_product)): ?>
                            <span class="add-or"><?php // echo $this->__('OR') ?></span>
                        <?php endif; ?>
                    <?php endif; ?>
                    <?php echo $this->getChildHtml('addto') ?>
                </div>

before that code insert:

<?php if (Mage::getSingleton('customer/session')->isLoggedIn()) { ?>

after that code insert:

<?php } ?>

if you have tier prices etc.. you have to use the same trick in the other files. u can find them in one of this files in the folder:

app/design/frontend/default/default/template/catalog/product/

Source: http://www.magentocommerce.com/boards/viewthread/22673/


Install a module

There are several available:

A free B2B plugin on Github that lists hiding prices for guests among its features:

https://github.com/sitewards/B2BProfessional

Or, one you can buy:

http://www.magentocommerce.com/magento-connect/bolasevich/extension/2096/hide-product-price-for-non-registered-users

Finally, one that is even more expensive:

http://www.magentocommerce.com/magento-connect/Cart2Quote/extension/5905/not2order_hide_price_disable_ordering


Source: https://stackoverflow.com/questions/6299366/hide-prices-and-disable-checkout-for-guests

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