Skip to content

Instantly share code, notes, and snippets.

@NickGreen
Last active December 28, 2019 11:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NickGreen/81a7dd21cfceb63dab06dd5adbb466ff to your computer and use it in GitHub Desktop.
Save NickGreen/81a7dd21cfceb63dab06dd5adbb466ff to your computer and use it in GitHub Desktop.
Allow switching to identical product
<?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