This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Auto reduce WooCommerce order stock at checkout. | |
* Add to theme functions.php file | |
*/ | |
add_action( 'woocommerce_thankyou', 'woocommerce_reduce_order_stock' ); | |
function woocommerce_reduce_order_stock( $order_id ) { | |
global $woocommerce; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: WooCommerce Auto Restore Stock | |
* Plugin URI: http://gerhardpotgieter.com/tag/woocommerce-auto-restore-stock | |
* Description: Auto restore stock when orders are cancelled | |
* Version: 1.0.1 | |
* Author: Gerhard Potgieter | |
* Author URI: http://gerhardpotgieter.cim | |
* License: GPL2 | |
*/ |