Forum Replies Created

Viewing 1 replies (of 1 total)
  • Hi @rauser

    I came here to ask the same, and felt that the developer is not around. Below you can find how I performed said task, it is not pretty, though.

    Place this code in functions.php file. Once you are logged in as admin, all the stats for product count will be flushed.

    Caution: note that after you flushed the view counts, you need to comment the add action row, otherwise -obviously- every time you view a page as admin, the stats would be flushed.

    Hope it helps

    //add_action("admin_head", "remove_product_view_count");
    function remove_product_view_count(){
       $ids = wc_get_products( array( 'return' => 'ids', 'limit' => -1 ) );
       foreach($ids as $id){
          update_post_meta( $id, "zwcmvp_product_view_count", (string) 0 );
       }
    }
Viewing 1 replies (of 1 total)