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?
-
1Already been answered here: stackoverflow.com/questions/6299366/…– ErfanCommented Feb 6, 2013 at 3:30
-
check this answer its exactly what you need ! stackoverflow.com/questions/12325934/…– MeabedCommented Feb 7, 2013 at 11:09
-
1We should answer this question once on the magento SO site, to use it as reference. We can only mark duplicates inside our site :-) so please copy the comment into an answer.– Fabian BlechschmidtCommented Feb 9, 2013 at 12:38
1 Answer
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:
Finally, one that is even more expensive:
Source: https://stackoverflow.com/questions/6299366/hide-prices-and-disable-checkout-for-guests