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

woof_products meta possible?

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!

Is it possible to filter by meta using woof_products? I would like to show only certain products on a page based on a specific meta field. I've reviewed to documentation and I'm unsure of which direction to take. Would i use woof_get_meta_query? I know the easy way would be to setup product categories, but the system that feeds products to woocommerce doesn't support that option.

Appreciate the help in advance!

Hello

To  show  products  use  [woof_products]

To  set exact  meta  data - https://products-filter.com/manipulate-search-data-options/

An  example :

if (is_page('your_page_Slug'))
{
add_filter('woof_get_request_data', 'my_woof_get_request_data');
}

function my_woof_get_request_data($request)
{
$request['select_Meta_Key'] = 'Meta Value';
return $request;
}

Hello

Thanks for the response!  I've reviewed the above and the provided link. On the page, I'm using [woof_products] and I've added the following code as a snippet but the products are still not being filtered properly. I'm still seeing all products. Am I missing something?

if (is_page('test-products'))
{
add_filter('woof_get_request_data', 'my_woof_get_request_data');
}
function my_woof_get_request_data($request){
$request['_category']='bulk containers';
return $request;
}

I appreciate your help!

Hello

 Am I missing something? - Yes!  Please  check  it - https://c2n.me/4bbcKLE.png it looks like I didn’t explain it well

To understand it better. Please  create  a  filter  by  this  meta  field - https://products-filter.com/extencion/woocommerce-filter-by-meta-fields/

Pay attention to what data that filter will add to the url.  And this data must be added to the code

Pablo,

I've updated the code as directed (I think) to the below, but I still can't get it to work.

if (is_page('test-products'))
{
add_filter('woof_get_request_data', 'my_woof_get_request_data');
}
function my_woof_get_request_data($request){
$request['select__category']='1';
return $request;
}

When I filter normally, my url ends with: /test-products/?swoof=1&select__category=1 ,which shows me the products I'm after.

I'm not sure what I'm doing wrong here. If you have time to check it out I'd appreciate it. Sorry for being a pain.

Hello

Please  add  FTP  access - https://c2n.me/43SC6rb.png ->https://c2n.me/42BAoj4.png - I will  check  it

Added. Thank You!

Hello

I  changed the  code.

New  code:

add_filter('gdoc_table_html', 'decode_html_in_gdoc_table');

add_filter('woof_get_request_data',function($request){
if(is_page('test-products')){
$request['select__category']='1';
}
return $request;
});

Result:  https://c2n.me/4bdJHzt.jpg

Pablo - Thanks for your help on this! Everything seems to be working as desired.

Thanks again!

Hello

Welcome;)