• Resolved laetitiad

    (@laetitiad)


    Hello!

    Thank you for the great plugin. I love it!

    Would it be possible to give us a way to remove the following action:

    add_action(‘save_post’, array($this, ‘check_product_stock_status’), 5, 2);

    Which is located in the ‘WOO_Product_Stock_Alert_Admin’ class?

    I can not remove it with “remove_action” because I don’t have access to the WOO_Product_Stock_Alert_Admin instance. Maybe you could make it global?

    I’d like to remove this action and only rely on the cron, because I don’t want that the mail are sent instantly as sometimes a product goes back in stock for less than a second (when we play with order status, usually).

    Thanks a lot !

Viewing 1 replies (of 1 total)
  • Hi,
    please add this code in the function.php of the current active theme and check:

    add_action('init', 'wc_product_stock_alert_custom');
    function wc_product_stock_alert_custom(){
    	global $WOO_Product_Stock_Alert;
    	$WOO_Product_Stock_Alert->load_class('admin');
        $WOO_Product_Stock_Alert->admin = new WOO_Product_Stock_Alert_Admin();
     	remove_action('save_post', array($WOO_Product_Stock_Alert->admin, 'check_product_stock_status'), 5, 2);
    }

    Regards,

Viewing 1 replies (of 1 total)
  • The topic ‘Add the possibility to remove this action’ is closed to new replies.