No setting needed as this is the path it will ALWAYS take. If you enable WiFi and an open network or one that you've previously saved is available, your phone will automatically connect to WiFi and route data through that.
There is, however, an Advanced option that will always check for data connection; if your WiFi is available but no internet access is present, then it will automatically switch to Mobile Data; this setting is off by default.