Last active
December 20, 2023 14:46
-
-
Save andreiglingeanu/dec19ed869edc75905901ed3d9cb7d29 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 | |
add_filter( | |
'blocksy:pro:woocommerce-extra:swatches:has-single-product-swatches', | |
function ($has_single_product_swatches) { | |
global $product; | |
if (has_term(array('sneakers'), 'product_cat', $product->get_id())) { | |
return false; | |
} | |
$products_without_swatches = [ | |
// list all product IDs that should not have swatches | |
105, | |
106 | |
]; | |
if (in_array($product->get_id(), $products_without_swatches)) { | |
return false; | |
} | |
return $has_single_product_swatches; | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment