• Hello, i have got a problem.I want to update stock_status of all products with sql using this $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 status has changed. But the product is still invisible on the shop page. Please help
    I think is a problem with shop visibility

    • This topic was modified 4 years, 5 months ago by matshop.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support con

    (@conschneider)

    Engineer

    Hi there,

    > The status has changed. But the product is still invisible on the shop page.

    Do the values display ok, when you edit the product? If yes, it might be front end caching getting in the way of things.

    Kind regards,

    Thread Starter matshop

    (@matshop)

    Yes, when i open the product from woocommerse->products the status has changed. But in shop page still the old status. How to clean frontend catch with sql?

    Plugin Support con

    (@conschneider)

    Engineer

    > But in shop page still the old status. How to clean frontend catch with sql?

    I suppose that depends on what is used for caching and if there is a setting that you change using SQL that triggers cache cleaning.

    What cache do you active?

    Kind regards,

    Thread Starter matshop

    (@matshop)

    I dont use any caching service..by defualt i think worpress and sevrer is using catch…i tried super cache and when i update the status i used to delete cache but still no changes in stock page.. I also tried with wc_update(stock_status) that worked, but is very slower becouse i want to change stock status by cron for 20.000 products andd the server gets down, so that i tried to find a solotion with sql.

    Thread Starter matshop

    (@matshop)

    This happens only if i first change product stock status manually from control panel.

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