I guess I’m more confused as to why it should be outside of WordPress?
Instead of redirecting your users to a completely different mobile site, you could just use some media-queries for mobile resolutions.
Other than that, you might be able to simply access the database directly, but that goes above my knowledge level. You won’t be able to use any hook like the one in the original post outside of WordPress.
(also, just to clarify, a WordPress ‘shortcode’ would look like this: [display-products] — just in case you are asking elsewhere and people are confused!)