• Resolved chalojak

    (@chalojak)


    Hi,

    my first question is how can I replace the wcdn_ prefix of the file and rename invoice suffix (need a local language). I scrolled through the code, but was not able to identify the right place…

    Second question is on the invoice availability. Currenly, the invoice is available to download immediately after the order is created, even if it is not completed. I would like to still be able set to “Show print button on My Account page” as yes, but have the download link available only once the order changes status to finished. This is based on the local legal environment. I found the workaround to send it only by email and have this action fired by the order completion, but it is a pity not to use the key feature of this plugin, which is the download of it.

    Many thanks for this very useful plugin!

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

    (@priyankajagtap)

    Hi @chalojak,

    Apologies for the delay in response to this.

    Thank you for elaborating your requirements in detail.

    >> my first question is how can I replace the wcdn_ prefix of the file and rename invoice suffix (need a local language). I scrolled through the code, but was not able to identify the right place.
    : If you are using the Simple template of our plugin then you can see there are options to set the prefix and suffix as per your requirements in the “Numbering” option under the WooCommerce -> Invoice -> Templates tab.
    Screenshot for your reference: https://app.screencast.com/rm47P6RvgEwHn

    >> Regarding your requirement of invoice availability, you mean the “Print” button should be displayed on the My Account page only for the Completed Orders, right?
    Please confirm. So I will discuss your requirements with the development team and check if any hook/filter is available to achieve your requirements. I will get back to you with an update.

    Thread Starter chalojak

    (@chalojak)

    Hi,

    Yes, I confirm the?requirement is the control when the “Print” button should be displayed on My Account page. For me, it is for instance only once the order is Completed. Others may want to have it triggered at different events like order Processed, etc.

    Plugin Author priyankajagtap

    (@priyankajagtap)

    Hi @chalojak,

    Thank you for confirming your requirement.

    I have forwarded your requirement to the development team. They will check if we have any hook/filter available to achieve your requirements and we will provide you an update of the same.

    Plugin Author priyankajagtap

    (@priyankajagtap)

    Hi @chalojak,

    Our developer has implemented a solution to achieve your requirements. The developer has added the filte ‘wcdn_show_print_button_for_order_status’ in our plugin to achieve this.

    Below is the link to download the modified file “class-wcdn-theme.php” of our plugin that contains the patch: https://www.dropbox.com/scl/fi/q0kbah1jkzj12tehsjd0u/class-wcdn-theme.php?rlkey=l9o6cdus3jq02fttd5can61wm&st=3o4jlpgi&dl=0

    Kindly download the file and you need to replace it with the existing file via FTP on the below-mentioned path: wp-content \ plugins \woocommerce-delivery-notes \ includes \ <HERE>

    Once you have uploaded the modified file, please add the below-provided custom code to the “functions.php” file of your currently active theme.

    add_filter( 'wcdn_show_print_button_for_order_status', 'custom_show_print_button_for_on_hold', 10, 1 );

    /**
    Add this code snippet in the functions.php file of your currently active theme.
    Show print button on based on order status(only work on My-account page).
    */

    function custom_show_print_button_for_on_hold( $order_status ) {
    return ( 'completed' === $order_status ); // Only return true if the order status is 'completed'.
    // return in_array( $order_status, array( 'on-hold', 'completed' ), true ); // Replace order status.
    }

    Please note that this filter is only works for the My Account page.

    Kindly check the same and let me know if it works as per your requirements.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.