• Resolved creativek1

    (@creativek1)


    Hi there,

    I need to display both retail and VIP pricing for all viewers. I have found this hook from someone else previously but it isn’t working for me. I’m hoping there is something I’m overlooking to get this functioning? The overall look of this plugin is exactly what I need, other than this feature. I have spent way too many days looking for an alternative but your plugin is the only one I can find that is almost perfect. Please don’t tell me it’s not possible, because pretty much anything is possible with a little bit of customization.

    This is the code I was referring to. If your team could debug this I would be so incredibly grateful

    add_filter('wwp_filter_wholesale_price_html', 'display_wholesale_price', 10, 7);
    add_filter('wwp_filter_variable_product_price_range_for_none_wholesale_users', 'display_customer_price', 10, 2);
    
    /**
     * @var $product WC_Product_Simple
    */
    function display_wholesale_price($wholesale_price_html , $price , $product , $user_wholesale_role , $wholesale_price_title_text , $raw_wholesale_price , $source ) { 
       //your code
       return $wholesale_price_html;
    }
    /**
     * @var $product WC_Product_Simple
    */
    function display_customer_price($price , $product) {
       //your code
       return $wholesale_price_html;
    }

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Fauzan Azizie

    (@fauzanade)

    Hi @creativek1,

    COuld you please try the following snippet:

    add_filter('woocommerce_get_price_html', function ($price_html, $product) {
        if (!is_user_logged_in()) {
            $wwp_wholesale_prices_instance = new WWP_Wholesale_Prices(array());
            $wholesale_role = array('wholesale_customer');
            $price_html = $wwp_wholesale_prices_instance->wholesale_price_html_filter($price_html, $product, $wholesale_role);
            $price_html = str_replace('del', 'span', $price_html);
        }
        return $price_html;
    }, 5, 2);

    Please let me know how it goes. Looking forward to your reply ??

    Fauzan
    Support

    Thread Starter creativek1

    (@creativek1)

    Hi @fauzanade,

    Thank you so much for trying but, unfortunately not. When no one is logged in, it turns the product pages blank. I ended up coding myself a way to do it without a plugin. Although your plugin still looks nicer and does the full functionality I’m hoping for. I greatly appreciate your time spent on this!

    • This reply was modified 3 years, 9 months ago by creativek1.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Wholesale Prices and Regular Prices Displayed for all viewers’ is closed to new replies.