Created
October 4, 2023 13:23
-
-
Save PluginRepublicSupport/a61f75fd70ba08518b9e58c35d1e8cef to your computer and use it in GitHub Desktop.
Enable the grid for specific products
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 | |
function custom_enable_variations_grid($enable, $product_id) { | |
// Add your specific product IDs here | |
$specific_product_ids = array(234,324,336); // Replace with your product IDs | |
if (in_array($product_id, $specific_product_ids)) { | |
return true; // Enable the grid for specific products | |
} | |
// For all other products, return the original value | |
return $enable; | |
} | |
add_filter('wcbvp_enable_variations_grid', 'custom_enable_variations_grid', 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment