• Resolved mukhthar

    (@mukhthar)


    Hi,
    I am trying to add a new order post column and I managed to do it.I am trying to update the post meta of the order.I used add_action hook with wpo_wcpdf_pdf_created and its updating the order meta.
    Can I restrict the order meta update only for order status “Processing”.
    In a nutshell, what I am trying to do is add an extra field to show Printed status for “Processing” status only.
    Thanks in advance,
    Mukhthar

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

    (@pomegranate)

    Hi! You can find more information about this hook and adding order meta in a recent thread here: https://www.ads-software.com/support/topic/when-creating-pdf-invoice-i-need-to-update-post-meta/#post-11851786

    You can fetch the order status with

    
    $status = $order->get_status();
    

    or in the case of that particular action hook:

    
    $status = $document->order->get_status();
    

    Good luck!

    Thread Starter mukhthar

    (@mukhthar)

    Hi,
    Thanks for the quick reply,It works great!!!
    How can i add an extra action field,which will be shown for only “processing” orders (https://prnt.sc/oxmpd3). I want to show a printer icon which do the same functionality that the other pdf action button do.
    Thanks in advance!!
    Mukhthar

    Plugin Contributor Ewout

    (@pomegranate)

    You can use the woocommerce_admin_order_actions_end action for this. If you need more help with this, I kindly suggest hiring a coder (codeable.io is a good resource for wordpress/woocommerce coders), customization like this are beyond what we can offer as part of free support for this plugin.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Updating Post meta after invoice printing’ is closed to new replies.