template_redirect and MarketPress

The logic behind my business is this:

1. Build a kick-ass theme and give it away for free (Shoestrap, http://bootstrap-commerce.com/downloads/downloads/shoestrap/ ).

2. After that’s done, provide premium plugins that extend this theme even more.

For example I’ve already completed a plugin that adds the necessary template files to be used with the Easy Digital Downloads plugin.

I now want to do the same for MarketPress.

So I’m building a plugin that will have the template files for MarketPress-specific pages.

I should be able to achieve what I want with the template_redirect action.

However this doesn’t seem to be the case!

Attempt 1: Do it with a template_redirect action.

function shoestrap_mp_load_template() {
global $wp_query, $post;

$frontpage_mode = get_theme_mod( 'shoestrap_mp_frontpage' );

// single product template
if ($wp_query->is_single && $wp_query->query_vars['post_type'] == 'product') {
require_once dirname(__FILE__) . '/templates/single-product.php';
}

// products category and tag template
if ( isset( $wp_query->query_vars['taxonomy'] ) && ( $wp_query->query_vars['taxonomy'] == 'product_category' || $wp_query->query_vars['taxonomy'] == 'product_tag' ) ) {
require_once dirname(__FILE__) . '/templates/products-taxonomy.php';
}

// Global products list (on frontpage, if selected so on the customizer)
if ( is_front_page() && $frontpage_mode == 'mp_list' ) {
require_once dirname(__FILE__) . '/templates/products-all.php';
}
}
add_action('template_redirect', 'shoestrap_mp_load_template', 10);

Attempt 2: Do it with a template_include filter.

function shoestrap_mp_load_template($template) {
global $wp_query, $post;

$frontpage_mode = get_theme_mod( 'shoestrap_mp_frontpage' );

// single download template
if ($wp_query->is_single && $wp_query->query_vars['post_type'] == 'product') {
return dirname(__FILE__) . '/templates/single-product.php';
}

// products category and tag template
if ( isset( $wp_query->query_vars['taxonomy'] ) && ( $wp_query->query_vars['taxonomy'] == 'product_category' || $wp_query->query_vars['taxonomy'] == 'product_tag' ) ) {
return dirname(__FILE__) . '/templates/products-taxonomy.php';
}

// Global products list (on frontpage, if selected so on the customizer)
if ( is_front_page() && $frontpage_mode == 'edd_list' ) {
return dirname(__FILE__) . '/templates/downloads-all.php';
}

return $template;
}
add_filter('template_include', 'shoestrap_mp_load_template', 1, 1);

I’ve tried numerous variations of these 2 without success.

Does anyone have any ideas?