PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]
Cyber Monday 2021
Cyber Monday 2021 timer

Support Forum

You need to log-in to create request (topic) to the support

Filter goods with empty taxonomy value

This support system is for all types of the plugins as for premium versions, so for free ones! If you have premium version do not forget in the private data of the request (!!not in the text of the support request!!) after its publishing insert purchase code please (see blue-green button on the right side) and press Save button.
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

I have custom taxonomy"Brands". I want to filter all products that are not tied to elements of this taxonomy. How should I do it? In the"Brands" column of the tables such goods have a note"no items"

Hello

Read this  please - https://bulk-editor.com/howto/how-to-filter-woocommerce-products-by-attachment-of-taxonomies-attributes-to-them/

Hello, Pablo!

Yes, it works! So I was looking badly :(

Is it possible to do similar to meta fields? Those. I want to filter goods with an empty meta field. Sign"!" The field name does not work for me.

Hello

Unfortunately the plugin does not have this feature.

Unfortunately

For myself, I implemented the opportunity to choose empty, not empty, existing in the goods and missing meta fields. I did this:

\ext\meta\meta.php - changed the function to :

Spoiler

public function woobe_filter_text($data) {
$metas = $this->get_fields();
if (!empty($metas)) {
foreach ($metas as $m) {
if (in_array($m['meta_key'], $this->settings->get_fields_keys())) {
if ($m['type'] == 'string') {
$data[$m['meta_key']] = array(
'placeholder' => $m['title'],
'direct' => TRUE,
'behavior_options' => array(
'LIKE' => __('LIKE', 'woocommerce-bulk-editor'),
'=' => __('EXACT (=)', 'woocommerce-bulk-editor'),
'!=' => __('NOT EXACT (!=)', 'woocommerce-bulk-editor'),
'NOT LIKE' => __('NOT LIKE', 'woocommerce-bulk-editor'),
'empty' => __('Empty', 'woocommerce-bulk-editor'), //IgorA100
'not_empty' => __('NOT empty', 'woocommerce-bulk-editor'), //IgorA100
'empty_not_exists' => __('Empty && NOT EXISTS', 'woocommerce-bulk-editor'), //IgorA100
'not_empty_exists' => __('NOT empty && EXISTS', 'woocommerce-bulk-editor'), //IgorA100
'exists' => __('EXISTS', 'woocommerce-bulk-editor'), //IgorA100
'not_exists' => __('NOT EXISTS', 'woocommerce-bulk-editor'), //IgorA100
),
'css_classes' => 'not-for-variations'
);
}
}
}
}
return $data;
}

and in functions"\ext\filters\filters.php public function woobe_apply_query_filter_data($args)" made add-ons :

Spoiler

if ($woobe_filter[$string_key]['behavior'] == 'empty'
|| $woobe_filter[$string_key]['behavior'] == 'empty_not_exists'
|| $woobe_filter[$string_key]['behavior'] == 'not_exists'
|| $woobe_filter[$string_key]['behavior'] == 'exists') $is = true;

AND:

Spoiler

// +++++ IgorA100
} elseif ($woobe_filter[$string_key]['behavior'] == 'empty') {
$meta_query[] = array(
'key' => $fields[$string_key]['meta_key'],
'value' => '',
'compare' => '='
);

} elseif ($woobe_filter[$string_key]['behavior'] == 'not_empty') {
$meta_query[] = array(
'key' => $fields[$string_key]['meta_key'],
'value' => '',
'compare' => '!='
);

} elseif ($woobe_filter[$string_key]['behavior'] == 'empty_not_exists') {
$meta_query[] = array(
'relation' => 'OR',
array(
'key' => $fields[$string_key]['meta_key'],
'value' => '',
'compare' => '='
),
array(
'key' => $fields[$string_key]['meta_key'],
'compare' => 'NOT EXISTS'
)
);
} elseif ($woobe_filter[$string_key]['behavior'] == 'not_empty_exists') {
$meta_query[] = array(
'relation' => 'OR',
array(
'key' => $fields[$string_key]['meta_key'],
'value' => '',
'compare' => '!='
),
array(
'key' => $fields[$string_key]['meta_key'],
'compare' => 'EXISTS'
)
);
} elseif ($woobe_filter[$string_key]['behavior'] == 'not_exists') {
$meta_query[] = array(
'key' => $fields[$string_key]['meta_key'],
'compare' => 'NOT EXISTS'
);
} elseif ($woobe_filter[$string_key]['behavior'] == 'exists') {
$meta_query[] = array(
'key' => $fields[$string_key]['meta_key'],
'compare' => 'EXISTS'
);

I'm not sure what I did everything correctly, but nevertheless everything began to filtered more universally.

I could not add a formatted code here, because of what the code here is now poorly read. :(

You could not make similar changes in the plugin? Or introduce hooks, in which you would make such changes? It will not be very convenient, add such lines after updating your plugin.

 

I am for myself, added support for hooks to"meta.php"

$data = apply_filters('woobe_filter_text_ext', $data, $metas, $this->settings->get_fields_keys());

and in"filters.php"

$meta_query = apply_filters('woobe_filter_meta_query_ext',$meta_query, $woobe_filter, $fields);

Thus, now when updating, I have to make one line into each file of your plugin.

Of course, I really want something similar to have in the next version of the plugin :)

It is now very convenient to choose the goods in which there are no defined meta fields at all or they are not filled, well, it can be useful to a sample of goods with only filled fields (not particularly needed, but ......)

Hello

Thank you for  cooperation!

I passed this to the developers