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

category set as default/standard

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.
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.

hi,

i'd like to have the filter set to one product category by default: when you visit the shop you'd only see products of category X. pre-filtered, basically.

i have tried https://products-filter.com/manipulate-search-data-options but it didn't work. are there any other options?

thanks in advance!

Hello

but it didn't work - it means you did something wrong

Or  use  shortcodts with attribute - taxonomies - https://products-filter.com/shortcode/woof

i've tried again and also tried the shortcode - but it didn't work.

do you have an idea what i might have done wrong or are there any known conflicts with the divi theme?

i have added

if (is_front_page())
{
add_filter('woof_get_request_data', 'my_woof_get_request_data');
}

function my_woof_get_request_data($request)
{
$request['product_cat'] = 'hundehalsbaender';
//$request['product_cat']='hundehalsbaender';
return $request;
}

to the functions.php - no effect.

https://penina-hunde-accessoires.de/shop

Hello

Your code - https://c2n.me/4eHBpwM.png - means it will only work on the main page and this code is not executed on the shop page

Try  it:

 

if (is_shop())
{
add_filter('woof_get_request_data', 'my_woof_get_request_data');
}

function my_woof_get_request_data($request)
{
$request['product_cat'] = 'hundehalsbaender';
//$request['product_cat']='hundehalsbaender';
return $request;
}

thank you pablo!

i've tried it - unfortunatly still no effect.

i've also cleared the cache, disabled the caching and SEO plugins - still doesn't work, it shows all products (not just the hundehalsbaender/collars).

it's my first shop project, maybe i've really made a dumb mistake ..?

Hello

Ok! Try  this  version of the  code

add_filter('woof_get_request_data', 'my_woof_get_request_data');

function my_woof_get_request_data($request)
{

if (is_shop()){
$request['product_cat'] = 'hundehalsbaender';
}
return $request;
}

thank you once again, pablo!

now the filter is set, but it still shows all products .. and one can't disable this category.

(that's what it looks like with the snippet atm https://penina-hunde-accessoires.de/shop)

Hello

and one can't disable this category -  of course you can't reset this search because you added it to the code

if you want this search to be temporary, use the link to go to this page:

https://penina-hunde-accessoires.de/shop?swoof=1&product_cat=hundehalsbaender

oooops, sure, my mistake.

to use the link was the very first thing i have tried, but i thought there would be a more elegant solution - especially because dynamic redirects can be tricky.

anyway, so i go full circle back to the start and it works after all :)

thanks again for your patience and support!

Hello

Welcome;)