• Hi it is possible to show the button only for the user role i want? and for my needs hide thumbnails image on the pdf

    Thanks

Viewing 1 replies (of 1 total)
  • Plugin Author David Jensen

    (@dkjensen)

    Hello, you can show the button only for user roles by using the following in your child theme functions.php file:

    remove_action('woocommerce_proceed_to_checkout', 'wc_cart_pdf_button', 21);
    
    add_action( 'woocommerce_proceed_to_checkout', function () {
        $user = wp_get_current_user();
    
        if ( in_array( 'author', (array) $user->roles ) && function_exists( 'wc_cart_pdf_button' ) ) {
            wc_cart_pdf_button();
        }
    }, 21 );

    To hide the thumbnail column, you will need to copy the plugin file from wc-cart-pdf/templates/cart-table.php into your child theme child-theme/woocommerce/wc-cart-pdf/cart-table.php. Then modify the file inside your child theme and remove the columns that render the thumbnail. It will be lines 51 and 69-90:

Viewing 1 replies (of 1 total)
  • The topic ‘Available for specefic user’ is closed to new replies.