Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter robbie88

    (@robbie88)

    So after alot of trial and error, I figured out that the actual action event that I needed to use was ‘woocommerce_rest_insert_product_cat’

    If anyone wants to add their own webhook, you should check out the controllers in {wpRoot}/wp-content/plugins/woocommerce/includes/rest-api/Controllers/Version3/*
    Take the controller where the action is performed and check its $taxonomy variable in the class definition. If you cannot find it, it is probable defined in one of the extended classes(v2 or v1). For me it was in the ‘class-wc-rest-product-categories-v1-controller.php’ file.

    The hook will be called: “woocommerce_rest_insert_{$taxonomy}”
    You can find all the different hooks in ‘class-wc-rest-terms-controller.php’, for instance ‘woocommerce_rest_delete_product_cat’ is also a valid action to hook onto.

    I hope it helps anyone who has the issue in the future.

    • This reply was modified 3 years, 8 months ago by robbie88. Reason: forgot to mark resolved
Viewing 1 replies (of 1 total)