• Resolved matshop

    (@matshop)


    Hello, i want to update stock status of all shop pruducts (about 20.000) by cron). I’m using sql querys like: $wpdb->query(“Update wp_postmeta Set meta_value = ‘instock’ Where post_id = $product_id And meta_key = ‘_stock_status'”);
    $wpdb->query(“Update wp_wc_product_meta_lookup Set stock_status = ‘instock’ Where product_id = $product_id”);

    The problem is when i manually make a product outofstock by dashboard and then run the queries, the stock status changes to instock but the product is still invisable in shop page. That because i have hide outofstock products in shop. So i think i have to make the product visable again in shop by sql. Does anyone know about it?
    Thanks..

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘update stock_status using sql query’ is closed to new replies.