PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

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

Conditional Filtering combined with woof_steps

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
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.

Hello Pablo,

Ok here is what we have:

  1. Step of a wizard using the woof_steps
  2. We need conditional logic for certian filtering

For the wizard: https://poyntstaging.wpengine.com/router-wizard/

You select 1. product_atribute (application) then technology then 2 other atributes this is great BUT
We need if the first attribute is apples to  not show the last attribute filter and just go to the results.

Eg. I have used this condition:
mining-industrial-tunneling>pa_technology>pa_mimo the last condition should not show. Now this takes away the tech and mimo for all even the defined value.
What we want is the chosen atribute value to only show tech and mimo and skip the last filter BUT the rest should still go through all the steps?

If this works we need to create multiple conditions.... for multiple senarios?

hi so tried this as well but cannot seem to get the function to identify the value of the filter to hide the next filter altribute:

add_filter('woof_filter_shortcode_args', function($args) {

//do smth with $args here
global $WOOF;

$request = $WOOF->get_request_data();

//To exclude filters:

$args['tax_exclude']['79'] = 'pa_directionality';
return $args;
}, 99, 1);

The 79 is the term id, I also tried to replace it with with pa_atribute-filtername_mining-industrial-tunneling, but it does the same as [ product_cat->attribute] it does not identify it as [ product_cat:value->attribute-filter]

Hello

I don't quite understand what you want to do

Depending on the current search query, do you want to remove an attribute or a specific term?

Hi hi,

Based on the term selected within a category, I want to remove an attribute filter.

eg. Main category: T-shirts -> if the client select V-neck within the T-shirt category the filter attribute sex should show to filter if they are male or female.
But if the client selects"strap top" with in the category T-shirts the sex attribute should not show (as it will only be worn by women).

So the selection should determine if the attribute shows or not.

Hello

An example:

 

add_filter('woof_filter_shortcode_args', function($args) {

global $WOOF;

$request = $WOOF->get_request_data();

is(isset($request['product_cat']) AND $request['product_cat'] =="V-neck slug" ){

$args['tax_exclude'][] = 'pa_directionality';

}

return $args;
}, 99, 1);