• Resolved Niek

    (@nvomedia)


    For some reasons, the category count on the homepage on a webshop which I manage loses his count after sometime.
    After running the ‘Recount Terms’ function in the WordPress Admin Area > WooCommerce > System Status > Tools, the counts come back.

    Now I’m looking to run this function, let say, every hour, with an WP Cronjob to make sure that there will be always some counts.

    I know how to create an Cronjob, how can I call that Recount function in my code?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The code for this is in:
    /wp-content/plugins/woocommerce/packages/woocommerce-rest-api/src/Controllers/Version2/class-wc-rest-system-status-tools-v2-controller.php
    lines 484 – 499
    so just copy those lines into your own function.

    Thread Starter Niek

    (@nvomedia)

    Thanks! Found it, and used it!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Call the recount terms function in code’ is closed to new replies.