Created
June 13, 2017 08:28
-
-
Save kreamweb/4dbec9aa284e163c6b6d5aa7efdc3e95 to your computer and use it in GitHub Desktop.
how remove the reduction of stock in a renew order
This file contains hidden or 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 | |
| if ( class_exists( 'YITH_WC_Subscription' ) ) { | |
| add_filter( 'woocommerce_can_reduce_order_stock', 'ywsbs_woocommerce_can_reduce_order_stock', 10, 2 ); | |
| function ywsbs_woocommerce_can_reduce_order_stock( $result, $order ) { | |
| $is_a_renew = yit_get_prop( $order, 'is_a_renew' ); | |
| return ( $is_a_renew == 'yes' ) ? false : $result; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment