WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
To show prices only to registered users (8 posts)

  1. webseosteve
    Member
    Posted 1 year ago #

    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/

  2. rhonz10
    Member
    Posted 1 year ago #

    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

  3. webseosteve
    Member
    Posted 1 year ago #

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

    Steve

  4. webseosteve
    Member
    Posted 1 year ago #

    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.

  5. bheadrick
    Member
    Posted 1 year ago #

  6. rhonz10
    Member
    Posted 1 year ago #

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

  7. webseosteve
    Member
    Posted 1 year ago #

    Thankyou Rhon very very much for your help :)

  8. viviansank
    Member
    Posted 1 year ago #

    I like too
    in this case when ADD button showing prices :(

    how show prices only users logged in wordpress ??

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic