Created
March 27, 2019 22:41
-
-
Save dangoodman/54b54d3b91e3447d718cf3b65b2f35c3 to your computer and use it in GitHub Desktop.
WooCommerce, Tree Table Rate Shipping: Exclude product attributes from the 'Contains' condition.
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 | |
// 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