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

How do I remove the price for guests? 
 
sdsocali
Jr. Member
 
Avatar
Total Posts:  6
Joined:  2008-01-31
 

I want my store to only show prices, add to cart, checkout to ppl who are registered on the site. Is this possible?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jonathan Hedrén
Member
 
Total Posts:  67
Joined:  2007-08-31
Sweden
 

Yes it is possible. I would create a helper to check if the user is logged in or not and then use it in the affected templates to control whether prices and/or add-to-cart buttons are displayed. I don’t have the time to do an example right now, but I’ll see if I can do it later this day.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jonathan Hedrén
Member
 
Total Posts:  67
Joined:  2007-08-31
Sweden
 

I looked into this and found an existing helper that could be used for this. Add the following code to your templates where it’s appropriate:

<?if ($this->helper('customer/data')->isLoggedIn()):?>
   Show some prices
...
<?else:?>
  Tell the user something
<?endif
;?>
 
Magento Community Magento Community
Magento Community
Magento Community
 
mk30
Member
 
Total Posts:  73
Joined:  2007-09-18
Lithuania/Vilnius
 

Is it working?… looking forward 2 try out Magento smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
Serial Killa
Sr. Member
 
Avatar
Total Posts:  76
Joined:  2008-03-22
Malaysia
 

yeah , would like to know if this is working smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
alanin
Member
 
Total Posts:  67
Joined:  2008-02-25
Nordhausen, Germany
 

it is working - using it since 0.7 or 0.8

 
Magento Community Magento Community
Magento Community
Magento Community
 
mk30
Member
 
Total Posts:  73
Joined:  2007-09-18
Lithuania/Vilnius
 

Made an module hosted in google code link : http://code.google.com/p/magentohideprice/downloads/list it’s simple plug and play just download unpack and copy smile it should work then… some issues when user inserts product in cart the mini cart shows total value… in normal cart it shows N/A so it needs some work to make it till the end…

 
Magento Community Magento Community
Magento Community
Magento Community
 
i2p0
Sr. Member
 
Total Posts:  179
Joined:  2008-03-28
 

hi..
thank’s for your work..
have you solved the problem with minichart?? can I help you??

 
Magento Community Magento Community
Magento Community
Magento Community
 
mk30
Member
 
Total Posts:  73
Joined:  2007-09-18
Lithuania/Vilnius
 

Yes thats solved but it’s hardcoded in layout if user not logged in he will see mini login box… else he we see mini cart… I think there is more cleaner way to do this. but at the moment it fits to me smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
i2p0
Sr. Member
 
Total Posts:  179
Joined:  2008-03-28
 

i’m trying to do a similar thing…
the code that manage the minichart is in chechout>block>cart>sidebar.php…
i tried to mod it, but it doesn’t work..
grrr

so i tried to remove totally the minichart if not logged from the template>checkot>cart> sidebar.phtml
but i have some error on the helper and it doesn’t work…

what have you done for remove it??

 
Magento Community Magento Community
Magento Community
Magento Community
 
mk30
Member
 
Total Posts:  73
Joined:  2007-09-18
Lithuania/Vilnius
 

you must change layout files not templates they are xml ones… If I remember correctly you need do some changes in catalog.xml file… by the way good luck if any problems I will post code then don’t have on hand at the moment…

 
Magento Community Magento Community
Magento Community
Magento Community
 
i2p0
Sr. Member
 
Total Posts:  179
Joined:  2008-03-28
 

can you please post your code???

i’m trying but i make some mistake somewhere and it doesn’t work

thank a lot

 
Magento Community Magento Community
Magento Community
Magento Community
 
mk30
Member
 
Total Posts:  73
Joined:  2007-09-18
Lithuania/Vilnius
 

change this in customer.xml also change mini.login.phtml file its not finished till end wink restyle and add actions :D

<customer_logged_out>
        <
reference name="top.links">
            <
action method="addLink" translate="label title" module="customer"><label>Log In</label><url helper="customer/getLoginUrl"/><title>Log In</title><prepare/><urlParams/><position>100</position></action>
        </
reference>
        <
reference name="right">
        <
block type="customer/form_login" name="form_mini_login" before="catalog.compare.sidebar" template="customer/form/mini.login.phtml"/> 
        </
reference>
        <
remove name="cart_sidebar"></remove>
        <
remove name="wishlist_sidebar"></remove>
        <
remove name="reorder"></remove>
    </
customer_logged_out>
 
Magento Community Magento Community
Magento Community
Magento Community
 
i2p0
Sr. Member
 
Total Posts:  179
Joined:  2008-03-28
 

thaks a lot…

my mini_log is set for a home page box…

i have replaced it with a new box… push button only register....

i also added a mod in product.php page.... my text message is
“<p><small>Registrati per vedere il prezzo</small></p>”
without the marker te text was placed near wishlist button out of the page....

if you want you can see my work in progress at

magento test

i’m italian.. english transaltion is not fully optimized…

thaks everybody

 
Magento Community Magento Community
Magento Community
Magento Community
 
kylewhat
Member
 
Total Posts:  45
Joined:  2008-06-02
 
Jonathan Hedrén - 13 February 2008 08:51 AM

I looked into this and found an existing helper that could be used for this. Add the following code to your templates where it’s appropriate:

<?if ($this->helper('customer/data')->isLoggedIn()):?>
   Show some prices
...
<?else:?>
  Tell the user something
<?endif
;?>

Fatal error: Using $this when not in object context in /home/public_html/index.php on line 45

this doesnt seem to work

 
Magento Community Magento Community
Magento Community
Magento Community
 
i2p0
Sr. Member
 
Total Posts:  179
Joined:  2008-03-28
 

module is no more working with 1.1.1 version… sigh sigh

please mk30 can you correct your code??

i think that the problem is about the helper…
for make the template working on 1.1 i had to mod the string

All Calls to Helper (via site-wide find/replace)
Note: Function arguments have been left out in order to make changes quickly using find/replace.

$this->helper('review/product')->getSummaryHtml
Should now be the following
:

$this->getReviewsSummaryHtml
AND
$this->helper('catalog/product')->getPriceHtml
Should now be the following
:

$this->getPriceHtml
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top