Show price only with login

Home Page 8DegreeThemes Forum Free Themes EightStore Lite Show price only with login

Viewing 1 reply thread
  • Author
    Posts
    • #1723
      Anonymous
      Inactive

      Hi,

      My cliente only want to show prices with login.
      I have try several codes and this plugin(Helios Solutions WooCommerce Hide Price and Add to Cart button) as well but always getting a BUG that i cant think why that happen.
      They appear to work because price real gone with no login and add to cart ti except…

      The first product of the list still shows the add to cart icon. If i change page the first one will have the add to cart icon. I didnt se antyone with this problem.

      Best Regards

    • #1724
      Anonymous
      Inactive

      Hi,

      I get the solution for the problema after some code on it. Now all ok 🙂

      New code:

      if (!is_user_logged_in()) {
      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 );
      }

      add_filter(‘woocommerce_get_price_html’,’members_only_price’);
      function members_only_price($price){
      if(is_user_logged_in() ){
      return $price;
      }
      else return ‘Preço após login‘;
      }

      Regards

Viewing 1 reply thread
  • You must be logged in to reply to this topic.

Our New Release - Eight Degree Innovative Corporate Theme (EDICT)

EDICT is a clean and innovative business WordPress theme. This business theme, built fully on theme options with Redux Framework, comes up with three stunning homepage demo layouts that can be imported with just one click of a button. Not to mention it also includes three elegantly designed blog, portfolio and header layouts.

Click on the below image for more detail.

Edict  Eight Degree Innovative Corporate Theme

Please post your questions in the respective forum above.

All questions related to our Pro theme will be answered in less than 24 hours. All questions related to our Free theme will be answered in less than 48 hours.
Our Facebook page is the best place to get updated with themes, documentation, question/answers. Please like us here: