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

In Stock Snippet Works But Has An Issue

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.

Hey,

 

I found the following code snippet in this help forum for enabling the"In Stock" filter by default:

add_filter('woof_get_request_data', 'my_woof_get_request_data');

function my_woof_get_request_data($data){
$data['stock']='instock';
return $data;
}

 

While this does work, the user is then unable to uncheck/disable the"In Stock" filter to view out of stock items. How do I have the"In Stock" filter enabled by default but also allow the user to disable it later if they want?

Hello

Unfortunately the plugin does not have this feature.

In this case, just use the link to this page with additional attributes: ?swoof=1&stock=instock

An example:  http://your_site.com/shop/?swoof=1&stock=instock