Hi there,
I followed your documentation to create a custom search. You can find it here: hidden link
We plant one tree per product, all our products have a unique code. By using the unique coded inside the 'product code' field and submitting, you will find your custom product info (=where the tree of your product is planted). This works.
This will always be only one result. I now want to know if it's possible to automatically redirect to the url of the page of the instance of the custom post type that appears after you hit search.
Thank you and have a wonderful day!
Hi, there's nothing exactly like this built-in to Toolset (or WordPress searches, for that matter). Assuming you are using the wpv-view shortcode to display the search results, you would have to write some custom code to trigger a redirect with JavaScript when the results are loaded because the HTML header for the page has already been written.
Another User shared some example code that they used to trigger some JavaScript like this, and you can find it here:
https://toolset.com/forums/topic/redirect-to-first-post-if-only-one-post-is-found/
That solution may require customization based on your site's requirements, and is considered custom code.