The best thing to do would just be to change the way the controller is getting your ID. I am assuming you don't need the 4th URI segment and that is just for SEO/usability purposes... but even if you do, you will still get it with the way this function is set up.
class Store extends CI_Controller {
//site.com/store/viewProduct/3/cake-cutter
public function viewProduct($id, $name)
{
//do stuff and now you have access to $id and $name
//$id == 3
//$name == 'cake-cutter'
}
}