Klaviyo Site Banner | Q2 2025

Product Icon

Price per Unit PRO for WooCommerce

The Price per Unit PRO extension automatically calculates the cost of one unit of your product and then displays the calculated price.

Display prices only to logged in users

I’m using Woodmart theme that allow me to hide prices for not logged in users. By the way, prices per unit are displayed in the shop, also for guests. Is there a simple way to hide them?

Screenshots

Author

Davide de Mattia

Current Status

Open

Last updated: February 24, 2025

2 comments

Log in to comment on this feature request.

  1. Davide de Mattia says:

    Yes perfect, it works fine. Thank you!

  2. MechComp says:
    Product developer March 5, 2025 8:25 pm

    Hi,

    it can be done through a piece of code inserted in functions.php of your theme or in PHP snippet.

    There are two filters which can be hooked, and it’s possible to stop the price generation there:
    apply_filters( ‘mcmp_ppu_process_product’, true, $html_price, $product );
    apply_filters( ‘mcmp_ppu_process_variation’, true, $args, $product, $variation );

    So in your case the code should look like this:
    function mcmp_hide_guest_prices( $process_product ) {
    // Returns false if user is not logged in.
    return is_user_logged_in();
    }
    add_filter( ‘mcmp_ppu_process_product’, ‘mcmp_hide_guest_prices’ );
    add_filter( ‘mcmp_ppu_process_variation’, ‘mcmp_hide_guest_prices’ );

    This should work. Let me know if you encounter any problem.