How do I hide price for non-logged in customers

Is there a way that I can hide the price for non-logged in customers?

9 answers

Profile photo of Windig Staff 3760.00 $tone April 16, 2015
Public

Hi,
Please PM me your site’s url, admin and ftp credentials, I’ll detect the root of issue for troubleshooting.
Best Regards,
Windig

#3
Profile photo of Mall Staff 184060.00 $tone April 16, 2015
Public

Hi fairscan,

Is there a way that I can hide the price for non-logged in customers?

to show price only for logined customers only, you can try the following steps:
+ Open the template file at app\design\frontend\gem\default\template\catalog\product\list.phtml
and find to the PHP code:

<?php echo $this->getPriceHtml($_product, true) ?>

 

and replace it by PHP code:

<?php if(Mage::getSingleton('customer/session')->isLoggedIn()): ?>
     <?php echo $this->getPriceHtml($_product, true) ?>
<?php endif; ?>

and you can do as above with other template files which you want.
Hope this help.
Regards,
Mall.

#4
Profile photo of Mall Staff 184060.00 $tone April 16, 2015
Public

Hi fairscan

I just tried this, and it does not work, price is still displayed. Any other suggestions?

I have detected the template file at \app\design\frontend\gem\default\template\catalog\product\list.phtml
and i don’t see you do as i suggest at first reply.
I have created a back-up and edited the template file at \app\design\frontend\gem\default\template\catalog\product\list.phtml
You can follow this template file and do it for other template files.
The issue as you want was solved. (http://bds.wsbyfs.com.au/index.php/all-products.html)
Have a look and let me know how it goes.
Regards,
Mall.

#7

Please login or Register to Submit Answer

Written By

Comments