Last active
December 28, 2019 11:01
-
-
Save NickGreen/81a7dd21cfceb63dab06dd5adbb466ff to your computer and use it in GitHub Desktop.
Allow switching to identical product
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 | |
/** | |
* Plugin Name: WooCommerce Subscriptions - Allow Same Product Switch | |
* Plugin URI: | |
* Description: Allow switching to same product for WooCommerce Subscriptions | |
* Version: 1.0 | |
* Author: Nick Green | |
* Author URI: | |
**/ | |
function allow_identical_switches( $is_identical_product, $product_id, $quantity, $variation_id, $subscription, $item ) { | |
return false; | |
} | |
add_filter( 'woocommerce_subscriptions_switch_is_identical_product', 'allow_identical_switches', 100, 6 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment