MarketPress and Membership: How to combine them to let members download a product for free while vis

I want to combine the membership site where I use MarketPress for the product listing and free download for members and an external shop I am using. My idea is the site works similar to the wpmudev one: members can download a product for free while non-members (or from a different member level) can purchase an item. Would this be possible and if how?

What's more: I have to use the link to the product file for security reasons and not have MarketPress distribute the file. MarketPress may handle downloads fine but this is not 100% perfect. I am using my files outside of my webroot, so even the link can be guessed or shared, the file can't be downloaded. So what I actually want to do is: show members this external links instead of the Buy Now button.

  • Charltan
    • Site Builder, Child of Zeus

    Hi and thanks @aristath
    Regarding the template file:

    Is there any example code I can use as a starting point? e.g. what template does the default mp plugin use? The only thing I want to change is the Buy Now/Download button like so: if member_level->display download link, if visitor->display buy now button.

    Am I correct I will have to copy the page.php file in my theme folder and rename it to mp_product.php and mp_productlist.php?

  • aristath
    • Recruit

    You will have to copy the functions from marketpress/marketpress-includes/template-funcions.php file to your theme's functions.php, rename all functions (for example _mp_cart_shipping should become _custom_mp_cart_shipping and so on), then edit the mp_buy_button to add your customizations, and on your template files add
    <?php custom_mp_list_products(); ?>
    for your archives template and
    <?php custom_mp_product(); ?>
    for your single product template.

    I hope that helps...


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.