Title: Debug tips
Last modified: October 17, 2016

---

# Debug tips

 *  Resolved [Tim](https://wordpress.org/support/users/timothyabgreen/)
 * (@timothyabgreen)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/debug-tips/)
 * Hi Claudio
 * Thanks for this plugin, it is exactly what we needed.
 * However it appeared to work perfectly for one order and is now not working. We
   have not updated any other software since installation, we have deactivated and
   re-activated the plugin but no help.
 * We are not getting any errors in the Browser Console or on the Server logs.
 * We switched to Twenty Sixteen theme and de-activate all but essential WooCommerce
   plugins. Still no luck.
 * Can you give us any debug tips to check what is going on?
    -  This topic was modified 9 years, 8 months ago by [Tim](https://wordpress.org/support/users/timothyabgreen/).

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Plugin Author [Claudio Sanches](https://wordpress.org/support/users/claudiosanches/)
 * (@claudiosanches)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/debug-tips/#post-8316142)
 * What are you doing?
    This will reduce stock levels every time that you change
   an order to “processing” or “complete”. Don’t really have anything fancy on it,
   it’s pretty simple how this plugin works.
 *  Thread Starter [Tim](https://wordpress.org/support/users/timothyabgreen/)
 * (@timothyabgreen)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/debug-tips/#post-8323538)
 * Hi
 * We are simply adding orders manually in the WooCommerce Admin area when logged
   in as Shop Manager.
 * We change the order to Processing and nothing happens.
 * I have a site on a staging server if you would like to see what is going on?
 *  Plugin Author [Claudio Sanches](https://wordpress.org/support/users/claudiosanches/)
 * (@claudiosanches)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/debug-tips/#post-8323765)
 * Try check for other installed plugins, since plugins can remove the filter `woocommerce_can_reduce_order_stock`
   and make sure that you have the “Manage Stock” option enabled in WooCommerce 
   and that you are managing stock for all your products in each product settings
   page.
 *  Thread Starter [Tim](https://wordpress.org/support/users/timothyabgreen/)
 * (@timothyabgreen)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/debug-tips/#post-8324265)
 * I can only find reference to this filter in your plugin and WooCommerce itself:
 *     ```
       Searching 3076 files for "woocommerce_can_reduce_order_stock"
   
       <removed for anonymity>/wp-content/plugins/reduce-stock-of-manual-orders-for-woocommerce-master/reduce-stock-of-manual-orders-for-woocommerce.php:
          47  
          48  			// Make sure that is possible to reduce order stock.
          49: 			add_filter( 'woocommerce_can_reduce_order_stock', '__return_true', 999 );
          50  
          51  			// Reduce or increase order stock when changing the order status on the admin screen.
   
       <removed for anonymity>/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-order.php:
        2625  	/**
        2626  	 * Reduce stock levels for all line items in the order.
        2627: 	 * Runs if stock management is enabled, but can be disabled on per-order basis by extensions @since 2.4.0 via woocommerce_can_reduce_order_stock hook.
        2628  	 */
        2629  	public function reduce_order_stock() {
        2630: 		if ( 'yes' === get_option( 'woocommerce_manage_stock' ) && apply_filters( 'woocommerce_can_reduce_order_stock', true, $this ) && sizeof( $this->get_items() ) > 0 ) {
        2631  			foreach ( $this->get_items() as $item ) {
        2632  				if ( $item['product_id'] > 0 ) {
   
       3 matches across 2 files
       ```
   
 * Nothing in the functions.php file either.
 * “Manage Stock” option is enabled in WooCommerce.
 * We have “Manage stock?” enabled at variations level.
 * Any other ideas much appreciated.
 *  Plugin Author [Claudio Sanches](https://wordpress.org/support/users/claudiosanches/)
 * (@claudiosanches)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/debug-tips/#post-8324340)
 * Show me screenshots or a video of your configuration, creating a new order and
   changing the status to “processing”.
 *  Thread Starter [Tim](https://wordpress.org/support/users/timothyabgreen/)
 * (@timothyabgreen)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/debug-tips/#post-8324380)
 * Does this help?
    [Screenshots](https://www.dropbox.com/sh/0ja7q039ycpqr0s/AADsOXbz8vs6J-ttOXb-CyA0a?dl=0)
 *  Thread Starter [Tim](https://wordpress.org/support/users/timothyabgreen/)
 * (@timothyabgreen)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/debug-tips/#post-8328559)
 * Hi Claudio
 * Were you able to view the screenshots linked above?
 * Thanks
 *  Plugin Author [Claudio Sanches](https://wordpress.org/support/users/claudiosanches/)
 * (@claudiosanches)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/debug-tips/#post-8331029)
 * [@timothyabgreen](https://wordpress.org/support/users/timothyabgreen/) the configuration
   looks fine, but still may have some plugin that is conflicting with it.
    Note
   that this plugin simple uses WooCommerce functions to do it:
 *     ```
       $order = wc_get_order( $order_id );
       $order->reduce_order_stock();
       ```
   
 * So if this code don’t reduce the stock from the other, can be an issue with WooCommerce
   or something else making the `reduce_order_stock()` unable to process it.
 *  Plugin Author [Claudio Sanches](https://wordpress.org/support/users/claudiosanches/)
 * (@claudiosanches)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/debug-tips/#post-8631741)
 * A bug has been found and fixed in version 1.0.1, which should work fine for all
   orders now.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Debug tips’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/reduce-stock-of-manual-orders-for-
   woocommerce.svg)
 * [Reduce stock of manual orders for WooCommerce](https://wordpress.org/plugins/reduce-stock-of-manual-orders-for-woocommerce/)
 * [Support Threads](https://wordpress.org/support/plugin/reduce-stock-of-manual-orders-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/reduce-stock-of-manual-orders-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/reduce-stock-of-manual-orders-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/reduce-stock-of-manual-orders-for-woocommerce/reviews/)

 * 9 replies
 * 2 participants
 * Last reply from: [Claudio Sanches](https://wordpress.org/support/users/claudiosanches/)
 * Last activity: [9 years, 5 months ago](https://wordpress.org/support/topic/debug-tips/#post-8631741)
 * Status: resolved