Created
September 1, 2022 09:36
-
-
Save somewherewarm-snippets/decc5de9657df8e0d7d09f1648fa9794 to your computer and use it in GitHub Desktop.
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: All Products for WooCommerce Subscriptions - Hide Global Subscription Plans on product pages | |
* Plugin URI: https://woocommerce.com/products/all-products-for-woocommerce-subscriptions/ | |
* Description: Use this plugin to hide Global Subscription Plans on product pages | |
* Version: 1.0 | |
* Author: WooCommerce | |
* Author URI: https://woocommerce.com/ | |
* Developer: Jason Kytros | |
* | |
* Requires at least: 2.6.0 | |
* Tested up to: 6.8 | |
* | |
* Copyright: © 2022 Automattic. | |
* License: GNU General Public License v3.0 | |
* License URI: http://www.gnu.org/licenses/gpl-3.0.html | |
*/ | |
add_filter( 'wcsatt_show_single_product_options', 'hide_global_plans_on_product_pages', 10, 2 ); | |
function hide_global_plans_on_product_pages( $show_plans, $product) { | |
$subscription_schemes = WCS_ATT_Product_Schemes::get_subscription_schemes( $product, 'local' ); | |
if ( empty( $subscription_schemes ) ) { | |
$show_plans = false; | |
} | |
return $show_plans; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment