• Resolved tarasp100878

    (@tarasp100878)


    Hello.

    I created metabox in function.php file which allow admin to download pdf file.
    When admin clicks on button “Print”, pdf file generated and sent to browser.
    Function that generates pdf attached to ‘woocommerce_process_shop_order_meta’ action, which triggered by clicking on button “Print”.
    This is not convenient because action ‘woocommerce_process_shop_order_meta’ called everytime when admin updates order and every time pdf file downloaded. When button clicked i want only download pdf file and i want to call that function by clicking on that button, but do not know how to do it in right way. I’m looking in javascript/ajax way but may be there is better solution.

    Thank you, for patience and help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Sol J. a11n

    (@solstudioim)

    Hi there @tarasp100878

    Thanks for your question!

    I understand that you’re trying to create a custom feature on the order page adding the capability to print off the order.

    Perhaps you want to consider using the following plugin: WooCommerce Print Invoices & Packing lists.

    From the description, it seems to meet your requirement:

    This plugin allows you to easily print documents for orders straight from the Orders page (individually and in bulk), while editing orders, and allows customer to view invoices from the “My Account” page.

    I hope that helps!

    Mirko P.

    (@rainfallnixfig)

    Hi there,

    We’ve not heard back from you in a while so I’ll go ahead and mark this thread as resolved. I hope you will find the above information useful.

    Please feel free to create a new thread if you have further questions.

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to call custom function after click on the metabox button ?’ is closed to new replies.