Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter fsilvalvm

    (@fsilvalvm)

    OK, thank you for your help 🙂

    Thread Starter fsilvalvm

    (@fsilvalvm)

    I placed your code on css and worked!
    Thank you, also I need to ask if it’s possible not show this message return 'Queres saber mais? <a href="'.get_permalink(woocommerce_get_page_id('myaccount')). '">Regista-te aqui!</a>';} only on first products

    Thread Starter fsilvalvm

    (@fsilvalvm)

    Yes, also I forgot to refer that this problem only happens without login

    http://lvmbarbersupplier.pt/produto/reuzel-daily-shampoo-family/

    Thread Starter fsilvalvm

    (@fsilvalvm)

    add_filter('woocommerce_get_price_html','hide_price');
    
    function hide_price($price){
    
    if(is_user_logged_in() ){
    return $price;
    }
    
    else {
    remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart' );
    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
    remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 );
    return 'Only <a href="' .get_permalink(woocommerce_get_page_id('myaccount')). '">Registered Users</a> are able to view pricing.';
      }
    
    }

    it’s the same code but you have to logout from WP admin panel to see it working.

    Thread Starter fsilvalvm

    (@fsilvalvm)

    ok, it’s working thank you 🙂

    just one more thing, which table are saved the products?

    Thread Starter fsilvalvm

    (@fsilvalvm)

    I tried with this code:
    add_filter('woocommerce_variable_price_html', 'members_only_price', 10, 2);

    and

    add_filter('woocommerce_get_price_html','members_only_price');
    
    function members_only_price($price){
    
    if(is_user_logged_in() ){
    return $price;
    }
    
    else {
    remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart' );
    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price', 10 );
    remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
    remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 );
    return 'Only <a href="' .get_permalink(woocommerce_get_page_id('myaccount')). '">Registered Users</a> are able to view pricing.';
      }
    
    }

    but i got the same problem

    Thread Starter fsilvalvm

    (@fsilvalvm)

    I placed that code on “functions.php” but don’t work :/

    Thread Starter fsilvalvm

    (@fsilvalvm)

    Hello,

    Im using Auberge theme. No, Im trying to use that image to substitute the homepage button.

Viewing 8 replies - 1 through 8 (of 8 total)