Untitled

mail@pastecode.io avatar
unknown
plain_text
4 months ago
558 B
1
Indexable
function custom_text_for_logged_out_users( $translated_text, $text, $domain ) {
    if ( !is_user_logged_in() && $domain === 'woocommerce-product-bundles' ) {
        if ( $text === 'Temporarily unavailable' || $text === 'This product is currently unavailable.' )  {
            $translated_text = 'Login to see details';
        }
    }
    return $translated_text;
}
add_filter( 'gettext', 'custom_text_for_logged_out_users', 10, 3 );

add_filter('woocommerce_bundle_empty_price_html', function($price, $item){
    return 'Login to view prices';
}, 10, 2);
Leave a Comment