I used a WiFi extender to solve the problem with my Samsung 46" Smart TV, UN46ES6100.
Only two years old, the TV initially had spotty connectivity, then finally failed to connect to the internet entirely. I could see the wireless network I wanted to connect to in the Network setup process, but after trying to connect, it would fail.
After 5+ hours on the phone with Samsung support over the span of about 4 phone calls, the determination was made by Samsung that my WiFi card in the TV would need to be replaced. That option didn't appeal to me, so I headed to Best Buy to purchase a Roku box and offload "Smart" from my TV. Fortunately, the Best Buy sales guy pointed me to a WiFi extender to solve the problem instead. It attaches to the back of the TV, plugs into the ethernet port (which still works) to deliver the connectivity, and draws power from the USB port on the TV, so wireless has been restored for $30. Brilliant!
The key to this solution is that you have an ethernet port on the TV, and it is still working properly.
I used the Netgear WNCE2001, but any equivalent device should work.