Skip to content

Instantly share code, notes, and snippets.

@dangoodman
Created March 27, 2019 22:41
Show Gist options
  • Save dangoodman/54b54d3b91e3447d718cf3b65b2f35c3 to your computer and use it in GitHub Desktop.
Save dangoodman/54b54d3b91e3447d718cf3b65b2f35c3 to your computer and use it in GitHub Desktop.
WooCommerce, Tree Table Rate Shipping: Exclude product attributes from the 'Contains' condition.
<?php
// Paste everything below this line to your child-theme's functions.php file.
// Exclude product attributes from the 'Contains' condition.
add_filter('woocommerce_attribute_taxonomies', function($taxs) {
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 10);
foreach ($backtrace as $call) {
if (isset($call['file']) && preg_match('#wc-tree-table-rate-shipping(/|\\\\)tpl.php#', $call['file'])) {
return [];
}
}
return $taxs;
}, PHP_INT_MAX, 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment