Using Two Themes – One for Main Site, One for Ecommerce

When building a page, WordPress looks in the option table in the database which theme to use. This read action can be intercepted, as you can see from the fact that you can live preview themes (more extensively with a plugin).

So, if you want to build something like this yourself, you would have to dive into the matter. It’s a bit too much to detail that out here. Or you could use a plugin like Multiple Themes.