• Resolved callachic

    (@callachic)


    Hi,

    I just installed this great plugin, and I need to remove weight & tracking number from the shipping labels. How do I do that?

    (And also, why is there tracking number field? How do I get it filled? Where is the data supposed to be extracted from?)

    Thank you!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author WebToffee

    (@webtoffee)

    Hi @callachic,

    Please copy below code snippet to your active theme’s functions.php to remove te weight and tracking number. Tracking number barcode is generated from the invoice number.

    add_filter('wf_pklist_add_custom_css','wt_pklist_add_custom_css_in_shippinglabel',10,3);
    function wt_pklist_add_custom_css_in_shippinglabel($custom_css,$template_type,$template_for_pdf)
    {
    if($template_type=='shippinglabel')
    {
       $custom_css.='.wfte_weight{ display:none !important;}.wfte_tracking_number{display:none !important;}';
       if($template_for_pdf)
       {
        $custom_css.='.wfte_weight{ display:none !important;}.wfte_tracking_number{display:none !important;}';
       }
    }
    return $custom_css;
    }
    Thread Starter callachic

    (@callachic)

    @webtoffee when I try to add the above code, I got the following error when I try to generate the shipping labels:

    Fatal error: Uncaught ArgumentCountError: Too few arguments to function wt_pklist_add_custom_css_in_shippinglabel(), 2 passed in /home/ernal266/public_html/tokomasmulia.com/wp-includes/class-wp-hook.php on line 287 and exactly 3 expected in /home/ernal266/public_html/tokomasmulia.com/wp-content/plugins/mulia-additional-codes/mulia-additional-codes.php:111 Stack trace: #0 /home/ernal266/public_html/tokomasmulia.com/wp-includes/class-wp-hook.php(287): wt_pklist_add_custom_css_in_shippinglabel(”, ‘shippinglabel’) #1 /home/ernal266/public_html/tokomasmulia.com/wp-includes/plugin.php(206): WP_Hook->apply_filters(”, Array) #2 /home/ernal266/public_html/tokomasmulia.com/wp-content/plugins/print-invoices-packing-slip-labels-for-woocommerce/admin/modules/customizer/customizer.php(347): apply_filters(‘wf_pklist_add_c…’, ”, ‘shippinglabel’) #3 /home/ernal266/public_html/tokomasmulia.com/wp-content/plugins/print-invoices-packing-slip-labels-for-woocommerce/admin/modules/customizer/customizer.php(772): Wf_Woocommerce_Packing_List in /home/ernal266/public_html/tokomasmulia.com/wp-content/plugins/mulia-additional-codes/mulia-additional-codes.php on line 111
    There has been a critical error on your website. Please check your site admin email inbox for instructions.

    Plugin Author WebToffee

    (@webtoffee)

    Hi @callachic,

    Sorry about that. Here is the updated code:

    add_filter('wf_pklist_add_custom_css','wt_pklist_add_custom_css_shippinglabel',10,2);
    function wt_pklist_add_custom_css_shippinglabel($custom_css,$template_type)
    {
    if($template_type=='shippinglabel')
    {
       
       $custom_css.='.wfte_weight{ display:none !important;}.wfte_invoice_number{display:none !important;}';
    }
    return $custom_css;
    }
    Thread Starter callachic

    (@callachic)

    @webtoffee Thanks for your kind help, the code works like a charm =)

    Plugin Author WebToffee

    (@webtoffee)

    Hi @callachic,

    Please leave us a review if you like the plugin and support.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Remove Weight & Tracking Number from Shipping Labels’ is closed to new replies.