Hi Everyone,
I know this question has been asked a few times, but I’ve scoured through the answers and no matter what I try, Relationship fields linked to a product don’t search by SKU and result in no results.
I would really appreciate any help on this! Thank you!
Yes, this topic comes up a lot, but generally it has to do with ACF fields. The issue is that ACF uses the standard WP search to find posts, meaning it only searches title and content. In order to include something else you need to modify the search query to include what you want to add. Here is a link that explains doing this https://adambalee.com/search-wordpress-by-custom-fields-without-a-plugin/
In order to add this to ACF what you need to do is to create an acf/fields/relationship/query filter. In this filter you would add the other filters that will make the changes to the query.
Hi John,
Thank you for your reply,
Ah yes, I’ve looked through that article and tried to piece together the code required to search the SKU, however, whenever I try, it doesn’t seem to work.
Sorry, I’m not really sure what we’re doing wrong but it still returns no results.
If you post some code I might be able to help you with it.