Marketpress setup for selling courses in Moodle

Hi,

I am in the process of setting up Marketpress on a multisite system in order to let teachers within the moodle install sell their courses on their individual blogs (in the multisite system) using Marketpress.

I will (still trying to set up) use chained payments in order to receive a percentage of their sales.

Here is the setup and process:
1. A teacher signs up on WP and gets a multisite blog and is also authenticated as a teacher in Moodle (manually).
2. The teacher creates a course in Moodle.
3. The teacher sends admin a message and admin creates a cohort for that specific course.
4. The teacher creates a new product in Marketpress for the course.

Now comes my first question:
Since I'm using the wp2moodle plugin to auto enroll a user into a cohort (the cohort containing the said course), I need to make the link available to the student after he has paid.
The link is in the form of a shortcode; i.e.
[wp2moodle class='my-class' cohort='course1' target='_blank']Open my course[/wpmoodle].
How can I make this link available to the buyer?
Perhaps the page the buyer is redirected to after checkout or perhaps a protected page.
I'll have to create a cohort and link manually for every new product created.
I also do not want to let teachers place the code wherever they want. They can create a free course ($0) if they want to make it a free course instead. (For statistics).

Second question:
How do I remove the unnecessary items such as shipping, downloaded products, etc. from the product creation page as they only serve to confuse the teachers?
Also, how do I change the naming of things such as Products to Courses?
My guess would be to use the Multilingual plugin and change the English files.

Regards,
Deon

    Deon

    Hi,

    Some more information that I received from the developer of the wp2moodle plugin:

    Yep each course typically has a cohort. I did it this way because it allowed me to sell a catalogue of courses as well, by setting both the per-course cohort as well as catalogue-cohort as membership providers per course.
    The link to the moodle site is via a wordpress shortcode hosted on a page / post. Not sure if Marketpress yet supports the purchase of a page (what I understand of it's digital download option is that it won't work since the url containing the pass-through data is generated on the fly since it's internally timestamped, so there's no permament link to use). Hope that helps!

    Hope anybody can give me a few pointers on how to proceed.

    Thanks a lot,
    Deon

    Alexander

    Hi @Deon,

    There are a few paths we can take here. Does the link need to be provided via a shortcode? MarketPress allows the download URL to be filtered:

    //allows you to simply filter the url
    $url = apply_filters('mp_download_url', $url, $order, $download);

    This means that instead of a download, we could have the "Download URL" after their purchase send them directly to the link that would be opened by the WP moodle plugin.

    This would require a way to get that link via code instead of the shortcode, but might be an option.

    Otherwise the only method I can think of here is the one you've already described by creating multiple pages.

    How do I remove the unnecessary items such as shipping, downloaded products, etc. from the product creation page as they only serve to confuse the teachers?

    This custom code will do this for you:

    add_action('add_meta_boxes_product','remove_unwanted_mp_meta_boxes',999);
    function remove_unwanted_mp_meta_boxes() {
    	remove_meta_box('mp-meta-shipping','product','normal');
        remove_meta_box('mp-meta-download','product','normal');
    }

    Also, how do I change the naming of things such as Products to Courses?
    My guess would be to use the Multilingual plugin and change the English files.

    Translating would be the best option. Otherwise you would need to modify the labels in MarketPress code.

    Best regards,

    Deon

    Alexander,

    It seems my luck is out and I will have to go with the secured pages option.

    Here's the response I received from the plugin author:

    The first option is going to be the easier I think, even though the second would be a better experience.
    The problem is that the link contains dynamic, time-dependant data. If you reload the page, the data changes because it's embedding a timestamp in the data that is encrypted (as well as the unique user data).
    So it's a different url for every instance of a user/cohort.
    From what I've read of MP, this kind of linking is not supported by that system.

    If this is indeed the case and I'll have to be content with the less desirable option of creating secured pages for each product, what would be the best way of doing it?

    Regards,
    Deon

    Alexander

    Hi @Deon,

    Did you provide him with the info I added above? We can programmatically change the download URL using the hook I was referring to. This means we can hook that filter, and provide a new URL to use on the fly. Inside the filter we have access to order information, and of course the current logged in user.

    I've never seen this particular method done before with MarketPress, but it's worth a shot to link whatever code creates the URL for the shortcode into that filter.

    Otherwise I can't really say there's a best way of creating the pages per product. It would be very difficult to secure, as you don't have it tied to any order information.

    Best regards,