• Resolved Bert O

    (@websitehelperberto)


    Had a custom packing slip built but since all of the updates, it no longer works…

    I get ‘Document of type ‘ORDERS’ for the selected order(s) could not be generated.’

    ‘Orders’ being the custom template.

    Where can I start looking to debug this error? The debug function does is not showing any errors, nor is the WordPress debug…

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor alexmigf

    (@alexmigf)

    Hello @websitehelperberto

    Can you add your template code to Pastebin please?

    Thread Starter Bert O

    (@websitehelperberto)

    It’s quite an extensive mod –

    https://pastebin.com/4MVRh47M – template

    https://pastebin.com/FX1jYZgi – function

    I am just not sure where to start as other than the error mentioned above I am not seeing any other errors.

    Plugin Contributor Ewout

    (@pomegranate)

    Because you haven’t registered the custom document properly to the plugin (extending the base/abstract class like we do with the Invoices & Packing Slips), the plugin can’t check whether it is enabled (e.g. whether the ‘enabled’ property is set in the object). Until recently it was possible to generate a PDF for a document programmatically even when it was not enabled, but because this is usually unwanted behavior we have fixed that.

    You can hook into the wpo_wcpdf_document_is_enabled filter to set your custom document to enabled like so:

    
    add_filter( 'wpo_wcpdf_document_is_enabled', function( $enabled, $document_type ) {
    	if ( 'ordertable' == $document_type ) {
    		$enabled = true;
    	}
    	return $enabled;
    }, 99, 2 );
    

    I believe that should fix the issue

    Thread Starter Bert O

    (@websitehelperberto)

    Thanks a million.

    Hai,

    I am new to this plugin. For me the invoices and packing slips are working good. But, with the proforma I got this error, ” Document of type ‘proforma’ for the selected order(s) could not be generated”.

    I have also tired the above code, but no use (added it in functions.php). I still get ” Document of type ‘proforma’ for the selected order(s) could not be generated”.

    Could you please help solve this.

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Hello @suchitra16,

    Proforma invoices are a feature for our Professional extension. www.ads-software.com doesn’t allow us to provide support for premium products in this forum.

    Please send us your question including your license key to [email protected], and we’ll do our best to help you!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Document of type… could not be generated’ is closed to new replies.