Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PluginRepublicSupport/a61f75fd70ba08518b9e58c35d1e8cef to your computer and use it in GitHub Desktop.
Save PluginRepublicSupport/a61f75fd70ba08518b9e58c35d1e8cef to your computer and use it in GitHub Desktop.
Enable the grid for specific products
<?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