Skip to content

Instantly share code, notes, and snippets.

@andreiglingeanu
Created December 20, 2023 14:08
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 andreiglingeanu/11283392bead5bbfcab9e89e4515ed70 to your computer and use it in GitHub Desktop.
Save andreiglingeanu/11283392bead5bbfcab9e89e4515ed70 to your computer and use it in GitHub Desktop.
<?php
add_filter(
'blocksy:pro:woocommerce-extra:swatches:has-single-product-swatches',
function ($has_single_product_swatches) {
global $product;
$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