Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 3
How do I hide prices and Add To Cart button? 
 
RonSolo
Jr. Member
 
Total Posts:  7
Joined:  2008-08-11
 

We want the general public to be able to browse our online catalog and product lines, BUT we do NOT want them to be able to see pricing and/or add items to the shopping cart. We only want pricing and add to cart button to be visible to customers who have logged in.

How can we hide pricing and Add To Cart button to those who are not logged in?

Thank you,
Ron

 
Magento Community Magento Community
Magento Community
Magento Community
 
jfidler80
Jr. Member
 
Total Posts:  10
Joined:  2008-10-02
 

I would also like to know if this is possible. I am looking to do the same thing.

 
Magento Community Magento Community
Magento Community
Magento Community
 
rambiz
Jr. Member
 
Total Posts:  4
Joined:  2008-11-13
 

same problem. I would too.

 
Magento Community Magento Community
Magento Community
Magento Community
 
szotyi
Sr. Member
 
Total Posts:  153
Joined:  2008-11-29
 

hiding price:
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/
i think thats it…

 
Magento Community Magento Community
Magento Community
Magento Community
 
RonSolo
Jr. Member
 
Total Posts:  7
Joined:  2008-08-11
 

Are you kidding me??  I think Magento completely missed the boat on this one. And I’m surprised (and disappointed) that they haven’t implemented this yet. Do you know how many businesses out there need to hide pricing from the general public? They’re called Business-to-Business. Most of the shopping cart contenders out there (ie. Pinnacle, X-Cart, Miva, Jshop) allow this feature quite easily, whether it’s a simple checkbox or a few lines of code.

C’mon Magento!!

 
Magento Community Magento Community
Magento Community
Magento Community
 
szotyi
Sr. Member
 
Total Posts:  153
Joined:  2008-11-29
 

sorry i missed understand your request… I have edited my last post and you can find the answer there…

yeah with magento you can do that also rasberry

<?php if (Mage::getSingleton('customer/session')->isLoggedIn()) { ?>
here is the html content that i want to hide from the 
public..
<?php } ?>
 
Magento Community Magento Community
Magento Community
Magento Community
 
RonSolo
Jr. Member
 
Total Posts:  7
Joined:  2008-08-11
 

Thanks, szotyi.
Still a little lengthy in application, but at least it will get the job done. Would still like to eventually see a simpler implementation.

 
Magento Community Magento Community
Magento Community
Magento Community
 
quanguru
Jr. Member
 
Total Posts:  2
Joined:  2008-04-18
Irvine
 

thanks for the help! does the job!

 
Magento Community Magento Community
Magento Community
Magento Community
 
w4yward
Member
 
Total Posts:  35
Joined:  2008-10-08
 

Awesome, I’ve been trawling the forum all week looking for this.

 
Magento Community Magento Community
Magento Community
Magento Community
 
j0hn
Jr. Member
 
Total Posts:  2
Joined:  2008-05-17
 

Hi,

I’m new to Magento. I’ve a bit of PHP coding experience.

Modifying the core code directly scares me. Won’t it break with future updates and/or extensions?

I found the project http://code.google.com/p/magentohideprice/ but the last release is 8 months olds and clearly intended for 1.1.4. I’m on 1.3.1!

Regarding the numerous threads about this potential feature, I think there’s a high demand for a seriously maintained extension, here.

I even read Vinai who ask $250 for it: http://www.magentocommerce.com/boards/viewreply/112668/

So I’m volunteer to start a free and open source community extension to hide prices and “add to cart” buttons to visitors not logged. It would benefit to every B2B Magento shops, and we’ll get it included in Magento Connect.

What you think?

Edit: would be a good combination with Vinai’s Customer Activation http://www.magentocommerce.com/extension/489 So your content is accessible to public (and most important the search bots), but visitors wanting to see prices need to create an account that have to be validated before they can see them (so you can verify they really are professionals, for the B2B case).

 
Magento Community Magento Community
Magento Community
Magento Community
 
Interactive Trade Center B.V.
Member
 
Avatar
Total Posts:  49
Joined:  2008-12-11
The Netherlands
 

See http://www.magentocommerce.com/boards/viewthread/4946/P15/ for a free hide price module smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
cc8621
Jr. Member
 
Total Posts:  3
Joined:  2009-09-24
 

The google module which “hide price” for not login user has problem with magento’s “configurable product”, it took me a while to figure out why my configurable product will show $0 price whenever I choose any option on the product page. when I remove the google module(by deleting the Steelish directory under app/code/local), the price for configurable products show up correctly.

This HidePrice module (1.1.4) has problem with the magento 1.3.2.4 I installed:

http://code.google.com/p/magentohideprice/
(tested May 25,2009 fix, still don’t work)

One other thing, The magento extension “Simple Configurable Product” from “Organic Internet & Mobile” also cause the similar problem for the configurable products, the version I tested was 0.6beta(of course). it will cause the price $0 whenever you select any options from the product page.

http://www.magentocommerce.com/extension/596/simple-configurable-products

Although, both module will cause the $0 price issue on product page when choose any option for the configurable product. when you add them to the shopping cart. the price still show up ok there.

 
Magento Community Magento Community
Magento Community
Magento Community
 
MageParts
Guru
 
Avatar
Total Posts:  415
Joined:  2007-11-18
 

Hi there!

We released an extension about a week ago which will enable you to hide product prices and the add to cart buttons, amongst other things:

http://www.magentocommerce.com/magento-connect/MageParts/extension/3779/customer_restrictions

 
Magento Community Magento Community
Magento Community
Magento Community
 
Offside
Jr. Member
 
Total Posts:  27
Joined:  2008-09-25
 

Thanks szotyi,

this is THE ONLY way that was precisely explained, and truly worked. I was wrestling with this for days and all I found was useless - there was always something missing, poorly explained, but your contribution was truly valuable.

Thanks a lot!

 
Magento Community Magento Community
Magento Community
Magento Community
 
GoodKaarma
Member
 
Total Posts:  31
Joined:  2009-09-05
Estonia
 

Thank you szotyi - just perfect.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Instinct Media
Jr. Member
 
Total Posts:  1
Joined:  2010-10-29
 

Hay… the solution provided by szotyi worked for me..

Though the path was different in my case… but I found it the easiest solution

thanks…

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 3