• When I try to send the cart pdf to an e-mail i get this error:

    Fatal error: Uncaught WCCartPDF\Mpdf\MpdfException: Can’t open file /tmp//mpdf/ttfontdata/dejavusans.GSUBGPOStables.dat in /home/eleclerc/produtos.e-leclerc.pt/wp-content/plugins/wc-cart-pdf/src/dependencies/Mpdf/Otl.php:337 Stack trace: #0 /home/eleclerc/produtos.e-leclerc.pt/wp-content/plugins/wc-cart-pdf/src/dependencies/Mpdf/Mpdf.php(13595): WCCartPDF\Mpdf\Otl->applyOTL() #1 /home/eleclerc/produtos.e-leclerc.pt/wp-content/plugins/wc-cart-pdf/wc-cart-pdf.php(211): WCCartPDF\Mpdf\Mpdf->WriteHTML() #2 /home/eleclerc/produtos.e-leclerc.pt/wp-includes/class-wp-hook.php(324): wc_cart_pdf_process_download() #3 /home/eleclerc/produtos.e-leclerc.pt/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #4 /home/eleclerc/produtos.e-leclerc.pt/wp-includes/plugin.php(517): WP_Hook->do_action() #5 /home/eleclerc/produtos.e-leclerc.pt/wp-includes/template-loader.php(13): do_action() #6 /home/eleclerc/produtos.e-leclerc.pt/wp-blog-header.php(19): require_once(‘/home/eleclerc/…’) #7 /home/eleclerc/produtos.e-leclerc.pt/index.php(17): require(‘/home/eleclerc/…’) #8 {main} thrown in /home/eleclerc/produtos.e-leclerc.pt/wp-content/plugins/wc-cart-pdf/src/dependencies/Mpdf/Otl.php on line 337

    Any clue what it might be?

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

    (@dkjensen)

    Hello

    Could you try adding the following in your child theme functions.php or in a snippet?

    add_filter( 'wc_cart_pdf_mpdf_args', function( $args ) {
    $args['tempDir'] = get_temp_dir();

    return $args;
    } );
    Thread Starter comerelva

    (@comerelva)

    Hello,

    The error remains the same.

    Plugin Author David Jensen

    (@dkjensen)

    In the previous error it said:

    Fatal error: Uncaught WCCartPDF\Mpdf\MpdfException: Can’t open file /tmp//mpdf/ttfontdata/dejavusans.GSUBGPOStables.dat

    Can you confirm whether the error still says /tmp//mpdf after adding the code snippet?

    Thread Starter comerelva

    (@comerelva)

    Yes, it’s still the same error.

    Plugin Author David Jensen

    (@dkjensen)

    Let’s try the following snippet instead:

    add_filter( 'wc_cart_pdf_mpdf_args', function( $args ) {
    $args['tempDir'] = wp_upload_dir()['basedir'] . '/wc-cart-pdf';

    return $args;
    }, PHP_INT_MAX );
    Thread Starter comerelva

    (@comerelva)

    It worked fine now! Thanks

    Plugin Author David Jensen

    (@dkjensen)

    Awesome, glad we could get that sorted!

    That last code snippet is the default, so I’m curious if there is a code snippet somewhere already that looks like the first code snippet I sent you. Anyways, not a huge deal as the latter snippet will override that.

    Thread Starter comerelva

    (@comerelva)

    If you want to explore, I can send you the functions.php file. Or anything else you want.

    Plugin Author David Jensen

    (@dkjensen)

    It’s not a huge deal, as the last snippet will override anything that was previously set, so I’m not too worried about it. Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Critical Error’ is closed to new replies.