WordPress.org

Support

Support » Plugins and Hacks » WooCommerce » To show prices only to registered users

To show prices only to registered users

  • webseosteve

    @webseosteve

    Hi all,

    Im hoping that someone will be able to assist me with setting up woocommerce so that only registered users can view prices on the products.

    For example, a guset cannot see the prices, but once a user registers they will be able to see each products price.

    I realise this might not be a standard option and I am willing to pay an expert coder to make this possible.

    cheers…

    Steve

    http://wordpress.org/extend/plugins/woocommerce/

Viewing 7 replies - 1 through 7 (of 7 total)
  • rhonz10

    @rhonz10

    look for the file price.php inside woocommerce templates folder, copy it to your_theme_folder/woocommerce/loop and if you’ve already done so,
    edit this line of code:

    <?php if ($price_html = $product->get_price_html()) : ?>
    	<span class="price"><?php echo $price_html; ?></span>
    <?php endif; ?>

    to this:

    <?php
    if(is_user_logged_in()){
        if ($price_html = $product->get_price_html()) : ?>
        <span class="price"><?php echo $price_html; ?></span>
        <?php
        endif;
    }
    ?>


    Rhon

    webseosteve

    @webseosteve

    Wow, rhonz10 for the help. I will try it out tonight. I wasn’t expecting an answer this quick. Very much appreciated.

    Steve

    webseosteve

    @webseosteve

    Hi Rhon

    I tried the code you gave me above, but Im sorry to say, it did not work. I am happy to pay you to help me get it to work. The site in question is http://www.adelaide-whitegoods-specialists.com.au/main/ and as a guest you will see that the prices are still showing.

    bheadrick

    @bheadrick

    rhonz10

    @rhonz10

    No worries, you can try Bryan’s solution..

    webseosteve

    @webseosteve

    Thankyou Rhon very very much for your help 🙂

    I like too
    in this case when ADD button showing prices 🙁

    how show prices only users logged in wordpress ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘To show prices only to registered users’ is closed to new replies.
Skip to toolbar