• Resolved mauriziom

    (@mauriziom)


    Hi
    is it possible to create the cart PDF only if I login as shop manager?
    If I login as user, I don’t have this possibility.
    Best regards,
    Maurizio

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

    (@dkjensen)

    Hello

    Yes you can try something like this, try adding this to your child theme functions.php

    
    function child_theme_wc_cart_pdf_capabilities_check() {
        if ( ! current_user_can( 'manage_woocommerce' ) ) {
            remove_action( 'woocommerce_proceed_to_checkout', 'wc_cart_pdf_button', 21 );
        }
    }
    add_action( 'woocommerce_init', 'child_theme_wc_cart_pdf_capabilities_check', 0 );
    
Viewing 1 replies (of 1 total)
  • The topic ‘how to create cart pdf only for admin shop’ is closed to new replies.