• Resolved samprairie

    (@samprairie)


    I’ve looked at other threads and haven’t had any luck fixing this error.

    I just moved all of our images to an amazon server but they are still uploaded to Woocommerce. I re-uploaded the logo, didn’t work. Exported it to .png and .jpg doesn’t work.

    For now it just says Invoice at the top as I’ve deleted the logo from the plugin.

    I’ve tried to remove them several times and re-upload, but it still shows the error Image not found or type unknown.

    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @samprairie,

    This issue could be related with the fact that your images are not in your server, but in a different place, and our PDF engine (dompdf) is quite strict with this matter when the URL does not match with your own domain.

    That said, please try the following code snippet that convert the URLs within the documents from HTTPS to HTTP, to see if we can bypass this restriction:

    /**
     * PDF Invoices & Packing Slips for WooCommerce:
     * Convert URLs from HTTPS to HTTP scheme
     */
    add_filter( 'wpo_wcpdf_get_html', 'wpo_wcpdf_convert_urls', 10, 2);
    function wpo_wcpdf_convert_urls( $html, $document ) {
    	$html = str_replace( 'https://', 'https://', $html );
    	return $html;
    }

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

    Thread Starter samprairie

    (@samprairie)

    I appreciate the help Yordan, am I able to add this into the code on the theme instead of digging around in functions? Or is that the only spot?

    Thank you!

    Plugin Contributor Yordan Soares

    (@yordansoares)

    If you have a child theme, you can add code snippets in its functions.php file: don’t add code snippets to the functions.php file from your parent theme, because you may lose your customizations after updating your parent theme!

    Other way to add code snippets, that is safer in my humble opinion, is to use the Code Snippets plugin: This plugin stores the code snippets in your database, so you don’t have to worry about losing your customizations after updating your plugins or theme ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Image not found or type unknown’ is closed to new replies.