Default Attributes for WooCommerce

How to exclude some attribute from the stock-based default attributes calculation?
Update the attribute id:

add_filter( 'daw_max_variations', 'daw_exclude_attribute', 10, 2 );
function daw_exclude_attribute( $max_variations, $attribute ) {
	$excluded_attribute = 25;
	return $excluded_attribute === $attribute['id'] ? 0 : $max_variations;

How to deactivate the plugin’s cache (suitable for testing the plugin functionality without waiting for the cache to be refreshed)?

add_filter( 'daw_transient_expiration', 'daw_disable_transients' );
function daw_disable_transients() {
	return '1';

Leave a comment

Your email address will not be published. Required fields are marked *