• Resolved sylvain68

    (@sylvain68)


    Hi again @zorem,

    I recently noticed that tracking information is displayed on our Proforma Invoices (quotations) generated through Woocommerce PDF Invoices & Packing Slips (by WP Overnight).

    There are two options in AST to disable shipment information in Invoices and Packing Slips but not for Proforma Invoices (quotation).

    FYI I added this snippet in order to remove the tracking display action in case of “proforma” document template:

    add_action( 'wpo_wcpdf_before_order_details', 'remove_shipment_info_from_proforma', -1, 4 );
    
    function remove_shipment_info_from_proforma( $template_type, $order ) {
    	
    	$wcast = WC_Advanced_Shipment_Tracking_Actions::get_instance();
    	remove_action( 'wpo_wcpdf_before_order_details', array( $wcast, 'tracking_display_in_invoice' ), 0, 4 );
    	
    	if ( $template_type !== 'proforma' ) {
    		add_action( 'wpo_wcpdf_before_order_details', array( $wcast, 'tracking_display_in_invoice' ), 0, 4 );
    	}
    	
    }

    It seems to work well but one another weird thing I’m trying to understand (for my curiosity): we also have “credit-note” invoices but we never had any shipment information, and we don’t want it, in these pdf documents. Even if the shipment is done before downloading the credit-note invoice”.

    How can we explain that? Indeed, there are no option to not display tracking info in “credit-note” template documents??

    Thanks in advance for your feedback and have a nice envening.

    Best Regards,
    Sylvain

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Zorem

    (@zorem)

    Hi, I am not sure what is credit-note and Proforma Invoices – maybe you can provide more details, I also think that need to contact the PDF plugin developer and mention us so he will add compatibility.

    Thread Starter sylvain68

    (@sylvain68)

    Hi @zorem,

    A credit note invoice is the document issued by the seller to the buyer after a refund. From a business accounting point of view, it provides justification for the refund that has been made.

    A proforma invoice is like an estimate (quote). It is usually more valuable to a company because it accurately reflects the invoice that will be issued later.

    These two documents are provided in the premium extension of WooCommerce PDF Invoices.

    By default the shipment information doesn’t seem to appear in the refund invoices (credit note), which is fine for me. For my curiosity I just wanted to know why I had to remove the action hook only for the quotes (proforma).

    I noticed indeed that it is your plugin that adds the tracking information in the documents generated by WC PDF Invoices (function “tracking_display_in_invoice”). I just wanted to warn you that there are other document template ids transmitted by the “wpo_wcpdf_before_order_details” hook: normally “proforma” and “credit-note”. If you look at your function, you will see that if the template is not “invoice” or “packing-slip”, the processing continues and the tracking information is added in the other document types:

    		$wc_ast_show_tracking_invoice = get_option('wc_ast_show_tracking_invoice');
    		$wc_ast_show_tracking_packing_slip = get_option('wc_ast_show_tracking_packing_slip');
    		if($template_type == 'invoice' && !$wc_ast_show_tracking_invoice){
    			return;
    		}
    		if($template_type == 'packing-slip' && !$wc_ast_show_tracking_packing_slip){
    			return;
    		}

    Hope this helps,

    Sylvain

    Plugin Author Zorem

    (@zorem)

    Ok, thanks for the info, I think that we will remove this code from our plugin and we will provide the code snippet including the templates for the PDF plugin users to add in functions.php
    I will send you here a link to the code snippet once we add it in docs
    Thanks

    Thread Starter sylvain68

    (@sylvain68)

    Hi @zorem,

    Thanks for your answer.

    I think your two current options are very convenient for people who want to easily add shipment tracking information in their invoices and packing slips. But I would also understand if you want to outsource them and refocus your plugin on its essential features. Not an easy choice.

    Actually if you didn’t get a lot of feedback like mine you could leave those options for which I think there was a initial demand from users? And slightly modify the “if” conditions of your code so that it only affects the two only templates of the free version of PDF Invoices (invoice & packing-slip).

    I’ll let you mark this topic as resolved if you wish, no problem ??

    Best Regards,
    Sylvain

    Plugin Author Zorem

    (@zorem)

    Hi, thanks.
    We are trying to be compatible with as many plugins as possible. in some cases, usually when we need to add option related to other plugin, we provide code snippet that users can add it to functions.php – if we will remove these options, we will provide you and all other users with a code to use. The main reason is that I do not want to update the plugin for 20000+ users b/c of change in other plugins. We will maybe create compatibility add-ons – I need to think how to provide this easy to install without effecting the AST plugin users in case of changes in other plugins.

    I will try to contact the PDF plugin developer so they will add the tracking display option in their plugin settings, which makes more sense (in case the AST plugin is also installed and active)

    I will let you know here and send you the code snippet and then close the topic

    Thanks

    Plugin Author Zorem

    (@zorem)

    Hi, We just released the latest version of the plugin and removed the compatibility code of WooCommerce PDF Invoices & Packing Slips from the plugin. You can use this code snippet in functions.php file to add tracking information in Invoices and Packing slip PDF.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Tracking information in quotation (PDF Invoices & Packing Slips)’ is closed to new replies.