• Resolved Lionear

    (@rbonk)


    Hi there,

    Is there a way to capture the products which was bought by a person in WooCommerce?

    We need some digital products to be added, but when a person buys them we need to capture the bought produts (after a successful checkout) and call a third party API so licenses are created.

    Any one who can point me to a direction how we could do this?

    Kind regards,
    Rick

    https://ww.wp.xz.cn/plugins/woocommerce/

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

    (@mikejolley)

    Use the woocommerce_order_completed hook and loop through the order contents. Thats how our licensing plugins work.

    Thread Starter Lionear

    (@rbonk)

    Mike, thanks for pointing me this way!
    Now I’m able to capture the order when it gets the Status completed. But it only contains the ‘Header’ of the order and not the items.

    How you do get the items itself?

    Plugin Contributor Mike Jolley

    (@mikejolley)

    Get the order with wc_get_order(). That will give you an order object.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Checkout hooks’ is closed to new replies.