• Resolved elshorshino

    (@elshorshino)


    Plugin looks great, just have a question..

    Is it possible to create a new pdf template in PRO version? i.e custom-pdf.php in the templates folder? Can we register it within the plugin so it appears in the settings?

    Thanks!

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

    (@pomegranate)

    Hi! While this is theoretically possible, it requires quite a bit of customization to make this work in the current version of the plugin. I’m working on the release of version 2.0 of the free version which makes this much easier, but that release is still a few weeks away. For now, the easiest way to achieve this is by using the Proforma template from the professional extension (if you don’t need that for anything else).

    I’m sorry I don’t have a more elegant solution for this now, but I’m definitely working on this and the 2.0 release will be pretty awesome 🙂

    Hope that helps!
    Ewout

    Thread Starter elshorshino

    (@elshorshino)

    Hi, thanks for your reply – that’s exactly what I plan to do, just wanted a cleaner solution for the admin area. I also managed to edit the size of each PDF (A4, A6), i.e packing slip A4, proforma A6 – It took a few lines of editing the core files of the plugin but this would be a great feature in future releases so the plguin is easily updatable without overriding changes 😉

    Look forward to the 2.0 release.

    Thanks

    Plugin Contributor Ewout

    (@pomegranate)

    Hi! No need to edit core files to adjust the page size:
    http://docs.wpovernight.com/woocommerce-pdf-invoices-packing-slips/use-custom-page-sizeorientation/

    Hope that helps!

    Ewout

    Thread Starter elshorshino

    (@elshorshino)

    Ha no way! awesome, did try and do a little digging and saw a comment saying it can’t be done (must of been an old one!) Thanks again.

    Thread Starter elshorshino

    (@elshorshino)

    Hi, as you mentioned above I am using the Proforma template for a custom size pdf, One thing I have noticed, once the customers order has been set to complete, the Proforma invoice takes place of the normal invoice in the my account page. Anyway to stop this from happening?

    Thanks

    Simon

    Plugin Contributor Ewout

    (@pomegranate)

    Hello Simon,
    Yes, you can do this with a filter:

    
    add_filter( 'wpo_wcpdf_myaccount_actions', 'wpo_wcpdf_always_display_proforma', 20, 2 );
    function wpo_wcpdf_always_display_proforma ( $actions, $order ) {
    	if ( !isset($actions['proforma']) ) {
    		$order_id = method_exists($order, 'get_id') ? $order->get_id() : $order->id;
    		$actions['proforma'] = array(
    			'url'  => wp_nonce_url( admin_url( 'admin-ajax.php?action=generate_wpo_wcpdf&template_type=proforma&order_ids=' . $order_id . '&my-account' ), 'generate_wpo_wcpdf' ),
    			'name' => apply_filters( 'wpo_wcpdf_myaccount_proforma_button', __( 'Download Proforma Invoice (PDF)', 'wpo_wcpdf_pro' ) )
    		);
    	}
    	return $actions;
    }
    

    This will show the proforma link regardless of whether there’s an invoice or not.
    If you have any other questions about the professional extension, it’s better to email support@wpovernight.com (include your order number or license key for reference). As a paying customer you’re entitled to priority support and we don’t watch this forum as often.

    Ewout

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Create a complete new custom PDF template’ is closed to new replies.