Redirect to custom post if custom archive page has just one result?
So i have made a Custom Post Type called cars and 4 taxonomies that i use to make/edit the cars pages. I have a search&filter pro plug-in to help me sort my pages by the 4 taxonomies assigned. It gives me results on the custom archive page i made, using a grid and the search and filter plug-in. My problem is i want the archive to be redirected to the post page of the car if we have only one result in the search archive.
But i need it adapted to custom post types. Can anyone help !?