Home Forums WoodMart support forum Show price for a specific product category in woodmart

Show price for a specific product category in woodmart

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #417116

    bilkyroot
    Participant

    Is there any hook code for showing price on some categories with enabled option “Hide add to cart and price” ?

    • This topic was modified 2 years, 1 month ago by bilkyroot.
    #417139

    bilkyroot
    Participant

    I also use this code instead of theme option but i still need to modify it..
    but there is another problem, my button shows up even if i disable it in code..

    
    add_filter( 'woocommerce_get_price_html', 'bbloomer_hide_price_addcart_not_logged_in', 9999, 2 );
     
    function bbloomer_hide_price_addcart_not_logged_in( $price, $product ) {
       if ( ! is_user_logged_in() ) { 
          $price = '<div><a href="' . get_permalink( wc_get_page_id( 'myaccount' ) ) . '">' . __( 'Login to see prices', 'bbloomer' ) . '</a></div>';
          remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
          remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 1000 );
       }
       return $price;
    }
    
    Attachments:
    You must be logged in to view attached files.
    #417302

    Hello,

    Sorry but there is no option in Theme Settings available for that. It requires Customization and this is beyond our limitations and support policy scope. Hope you can understand our limitations.

    The option currently works globally for all Categories and Shop pages.

    Best Regards

Viewing 3 posts - 1 through 3 (of 3 total)