Marketpress External Link Issue

Hi,

I am using both marketpress and membership plugin.

In marketpress I have created products with external link, and I want that external link button which is currently and Buy Button in my site to be protected for an membership access level.

I tested it by putting the code in the external link section, but its not working, so what can be the fix?

or if the developer of the plugin can help me here with the problem.

  • Alexander

    Hi @mbeneteau,

    Membership has a function that allows you to check if the user is on a particular level.

    If you want, I can look at making a function that code this protection to a specific user level. It would also affect all products. Let me know if this is ok - I'd just need a bit of time to check on this

    If you're looking for something more flexible where you have new controls to manage this functionality, you'd basically need another plugin altogether, or an add-on for Membership. Coding an entire plugin like this isn't something I could help with through support, but you can look into hire a developer from our job boards: https://premium.wpmudev.org/wpmu-jobs/

    Best regards,

  • mbeneteau

    I don't think so that you will need to code the whole plugin from scratch.

    I just asked to help or develop the feature where one can implement the user access level using shortcodes to the external link section of the product.

    I want people to signup to an free membership before they can see the buy now links, because I will be using short-codes of free membership to protect the buy now button of the products, so that if a user is just a visitor then he cannot view the buy now button, beside he has to register for a free membership account.

  • Alexander

    Hi @mbeneteau,

    I'm sorry about the less helpful response before. I've taken another look at this for you. Unfortunately we don't an easy way to change mp_product_link before it is used on the page. I will check with the developers, maybe this is something that could eventually be added to the plugin with a filter.

    For now, it's only possible by editing template-functions.php

    This will be lost on a plugin update because it is a core plugin file, but if you're ok with this, you can try the following:

    Go to line 1856. This is where you can find where this link is displayed. You'll notice that line 1857 is blank. Enter this code in that blank line:

    if(!current_user_is_member()) $product_link = 'http://yoursite.com/register';

    Then update the URL in that code. This will replace the product link, with a link of your choice if the user isn't a member.

    Best regards,

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.