• Resolved Mikko

    (@sainionmikko)


    Hi guys,
    What do I need to modify to change the links and buttons shown to the customer after checkout, in emails and on My Page, to print with the Receipt template and not with the Invoice template? I can select whether these are shown to the customer but not which of the documents can he/she print.
    My orders are always already paid for before showing the print option, so the customer would need the receipt, not the invoice.
    Thanks in advance!
    Mikko

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author priyankajagtap

    (@priyankajagtap)

    Hi @sainionmikko,

    Thank you for sharing your requirement.

    There are two filter hooks available in our plugin which you can modify to achieve your mentioned requirement. You can change the text of the invoice and order to ‘receipt’. These filters are available in the “class-wcdn-theme.php” file of our plugin.
    A path to the file: wp-content/plugins/woocommerce-delivery-notes/includes/<here>

    apply_filters( ‘wcdn_theme_print_button_template_type_complete_status’, ‘invoice’ );
    apply_filters( ‘wcdn_theme_print_button_template_type’, ‘order’ );

    Please check and let us know whether the provided information is helpful to achieve your requirement or not.

    Regards,
    Priyanka

    Thread Starter Mikko

    (@sainionmikko)

    Hi Priyanka,
    Thanks a lot, this worked out perfectly. I guess when I update the plugin, these changes are lost?
    Best regards,
    Mikko

    Plugin Author priyankajagtap

    (@priyankajagtap)

    Hi @sainionmikko,

    I am glad that the provided information was helpful to achieve your requirement.

    Yes, the changes you have done in the plugin file will get removed when you update our plugin in the future. To avoid this, what you can do is, you can add the below-provided code in the functions.php file of your currently active theme. So this code will not get lost after updating our plugin in the future.

    Code:

    add_filter( 'wcdn_theme_print_button_template_type_complete_status', 'wcdn_theme_print_button_template_type_complete_status_callback', 10, 1 );
    
      function wcdn_theme_print_button_template_type_complete_status_callback( $type ) {
        return "receipt";
      }
    
      add_filter( 'wcdn_theme_print_button_template_type', 'wcdn_theme_print_button_template_type_callback', 10, 1 );
    
      function wcdn_theme_print_button_template_type_callback( $type ) {
        return "receipt";
      }

    Once you have added this code, please check and let us know whether the code is working fine or not. Do let us know if you have any questions.

    Regards,
    Priyanka Jagtap

    Thread Starter Mikko

    (@sainionmikko)

    Thanks again Priyanka!
    It took me a while to implement the code but now that you had an update I had to do it. And it worked like a charm!
    Thanks a lot, great support!
    Best regards,
    Mikko

    Plugin Author priyankajagtap

    (@priyankajagtap)

    Hi @sainionmikko,

    Thank you for appreciating our support. ??

    It would be great if you could write a review for us on our plugin’s review page. That would help immensely.

    Regards,
    Priyanka Jagtap

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Frontend: print receipt, not invoice’ is closed to new replies.