• Resolved Daniel Proczko

    (@diggler)


    Receiving the following error:

    Fatal error: call_user_func_array(): Argument #1 ($callback) must be a valid callback, function “wcpdf_a6_packing_slips” not found or invalid function name/wordpress/wp-includes/class-wp-hook.php (326)#0 /wordpress/wp-includes/plugin.php(205): WP_Hook->apply_filters(‘letter’, Array) #1 /www/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/documents/abstract-wcpdf-order-document.php(933): apply_filters(‘wpo_wcpdf_paper…’, ‘letter’, ‘packing-slip’, Object(WPO\WC\PDF_Invoices\Documents\Packing_Slip)) #2 /www/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/documents/abstract-wcpdf-order-document.php(1004): WPO\WC\PDF_Invoices\Documents\Order_Document->get_pdf() #3 /www/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/class-wcpdf-main.php(580): WPO\WC\PDF_Invoices\Documents\Order_Document->output_pdf(‘inline’) #4 /wordpress/wp-includes/class-wp-hook.php(324): WPO\WC\PDF_Invoices\Main->generate_document_ajax(”) #5 /wordpress/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(”, Array) #6 /wordpress/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #7 /wordpress/wp-admin/admin-ajax.php(188): do_action(‘wp_ajax_generat…’) #8 {main}

    Possibly an issue or conflict with Divi theme.

    • This topic was modified 1 year, 1 month ago by Daniel Proczko. Reason: additional information
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @diggler:

    It is likely that you were applying a custom paper size for the packing slip, but maybe the callback was deleted?

    Anyway, try activating this function in your site to fix it:

    function wcpdf_a6_packing_slips( $paper_format, $document_type ) {
        if ( $document_type == 'packing-slip' ) {
            $paper_format = 'a6';
        }
        return $paper_format;
    }

    If you haven’t worked with code snippets (actions/filters) or functions.php before, read this guide: How to use filters

    Let me know if it worked!

    Thread Starter Daniel Proczko

    (@diggler)

    FYI: I’ve set the paper size to letter in the general settings.

    I will try and report back shortly.

    Thread Starter Daniel Proczko

    (@diggler)

    That fixed the issue. But can it be set to letter size: 8.5″ x 11″?

    It’s printing on 3 pages when set to a6.

    Plugin Contributor Yordan Soares

    (@yordansoares)

    FYI: I’ve set the paper size to letter in the general settings.

    If you are filtering the paper size with the wpo_wcpdf_paper_format filter hook somewhere, that setting will still be ignored. Therefore, you have to remove that code snippet, or activate the function above (if you want to set a custom paper size indeed) to fix the issue.

    I will try and report back shortly.

    Sure! Take your time and let us know if you still need help with this ??

    Thread Starter Daniel Proczko

    (@diggler)

    I solved it. Just changed a6 to a4 and it generates in letter size.

    All fixed. Not sure why I need the functions. But it works. Thanks.

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Thanks for confirming that it is working now!

    Not sure why I need the functions.

    This is because you are filtering the paper size with the wpo_wcpdf_paper_format?hook, as mentioned above.

    Are you maybe using a code snippets plugin or have code snippet within the functions file? Try searching by the hook above to find it faster ??

    Thread Starter Daniel Proczko

    (@diggler)

    Shoot! I see there is a function hidden and not commented. I removed all of the functions associated with this plugin and it works as intended. Thank you.

    Plugin Contributor Yordan Soares

    (@yordansoares)

    I’m glad to hear that you found it! ??

    BTW, if you don’t mind and have the time, do you think you could leave us a review?

    Thanks in advance and all the best with your store!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Fatal Error’ is closed to new replies.