WooCommerce Tips: Pay, Play & Download

16 Comments

woocommerce-tipsCan WooCommerce Do This?

There’s a lot of things you can do when you use WooCommerce. One of the most recent questions I saw about WooCommerce was an interesting question that I thought you might like to hear (and see answered).

The goal was to create a site where a person could purchase a video – both as a digital download and as a page where you could watch it online.

WooCommerce makes it easy to sell digital downloads. But how do you do the other part – the “now that I paid, I’d like to watch it right away”?

Needed Plugins & Extensions

In order to do this, you’ll need the following plugins and extensions:

WooCommerce Tips: The 7-Step Tutorial

The precursor of this tutorial is to install all the plugins listed above and activate them on your site. Once you’re done with that, we’re ready to get started.

1. Add a Group

While it seems counter-intuitive to start with the custom group, everything you’re doing will be based on this, so it’s the first place you want to start.

AddNewGroupWhy are you creating a group? Because you’ll use this group (and it’s rights/capabilities) to limit who has access to the page where you’ll host your video. Every time someone purchases your product, you’ll put them into this group, automatically.

2. Add a “view” capability

After you’ve created a group, you’re going to want to create a new capability. This will be the “view my videos” capability so that anyone in the group you created will get to see the page (because it will have the capability restriction on it).

AddCapabilityBut creating your capability isn’t enough. You need to link it to your group. So click on Groups again in the menu and then map the capability to the group you’ve created.

AssignCapabilitiesIn this image, you’ll see I’ve created a Watch101 group, with a View101 capability. These capabilities (from these groups) will be leveraged to protect or give access to your video page(s).

3. Configure the rest of the Groups plugin

One last step to take care of in the Groups plugin is the configuration to make sure that your new capabilities show up in the right places to let you use them. You want to make sure that pages and posts are checked, but also, scroll down looking for your new capabilities and make sure you check them too.

CapabilitiesReadAccess

4. Configure WooCommerce

If you’ve installed the Groups for WooCommerce extension right, you’ll see a Groups link in the WooCommerce menu. If that’s the case, click on it, so you can configure the integration between WooCommerce and Groups.

The key is telling WooCommerce when to put the user (that just registered) into the group – while the order is processing, or after the order is complete.

DetermineWhenAddToGroup

One last note you’ll notice is that you have to let users create accounts, so just expect that to show up. You can’t determine who sees and doesn’t see stuff without them having an account. So WooCommerce will automatically have people register.

5. Create your Page

Now we’re getting somewhere. Go create a page where you’ll host your videos. It could be one page with one video. Or a page with several. You’re call. But this is the page that people will have rights to, after purchasing the video to download.

AccessRestrictions

What you’ll notice is that on the top right you’ll have the option to determine who gets rights to see this page. Those checkboxes are capabilities. Since you’ve matched those capabilities to your group, anyone in that group will get to view this page.

6. Create Your Downloadable Product

With groups and capabilities defined, and your page set up, you’re now ready to create your downloadable product.

So step into WooCommerce and create a new product. Make it simple, and check the “downloadable” box, so that you can define the url of the file that you want people to be able to download (in this case your downloadable video file).

SimpleDownloadable7. Configure the Product’s Groups Options

We’re finally there. The flow is pretty simple.

People will buy your downloadable video, automatically get access to the file, and then get access to the page where they could view it. But they can’t see the page if they’re not in the right group.

That’s your last step. Click on the Groups part of the product, and determine which groups you want to put someone in after they’ve purchased this product.

AddUserToGroup

Additional Notes

When you do this right, the page you create will give a 404 for people who don’t have rights. Only those with rights will see the page.

Additionally, when it comes to hosting video, I use Vimeo Pro so that I can not only embed my video, but limit who can embed it by domain (where only my domain is listed).

This solution doesn’t look at recurring charges. This is a one-time charge solution. If you want recurring charges, you’d need to add the Subscriptions extension for WooCommerce.

Conclusion

You can’t do everything with WordPress, or with WooCommerce. But you can do a lot. Hopefully this has introduced you to Groups and the WooCommerce Groups extension and how helpful it can be in creating solutions like this one.

About This Site

This site is hosted by Pagely - running on Amazon's hardware, making it lightning fast. They're a managed WordPress host which means they take care of my site so I don't have to. Starting at $24/month, this may be the perfect solution for you too.

16 comments

  1. Enrique says:

    Really good tutorial! Only a question: How the buyer know the link of the page where the video is? Is there any way to include in the account of the user?

    Thanks in advance and excuse my english…

  2. Ed H. says:

    @enrique, the buyer will get a link on their order confirmation page below the item name, and also in the My Account page generated by WooCommerce.

  3. Ed H. says:

    Chris, my site is setup using your info here and I noticed that the download link for the product uses a redirect to the product, which at first, looks like it has a Unique Key attached to it which gives it access to the file/product. Is that a unique key or is it just some arbitrary numbers? Looks like http://www.site.com/checkout/order-received/order=1234&order_asdfghjkl987654.

    The characters after order_ appear to be a unique key, is that correct? If so, I just wanted to figure out a way to tap into this unique key to be able to email it, etc., to the user after payment.

    Thanks!

  4. Chris, I have done each step of this tutorial and there is no link to the page in the order email, nor in the my-account page. There is no connection between the product and the page. Please tell me what I am doing wrong.

    • satemasov says:

      When you configure the product, go to the advanced section and add a Purchase Note. This note will show in the checkout confirmation page as well as in the confirmation email. I included a link to the page where they can view the video.

  5. satemasov says:

    This is exactly what I was looking for. Thank you. The piece I’m curious about: If a user has logged out, and then tries to click on the link in the email confirmation, they will also gets 404. Is there no way to prompt for login when pages exist, but just require particular access?

  6. Noir says:

    Hi Chris,

    Thanks for this great post.

    Is the groups plug-in still necesary in the current version of Woocommerce and are there any alternatives from WooCommerce themselves? From what I read the Groups plug-in year-over-year updates are dropping, and I would like to make sure we have the best possible support to keep the stability of the webshop as top-notch as possible.

    Any ideas would be a great help. Thanks!!

  7. Aayush says:

    Hi Chris,

    I have a requirement for an e-commerce store and i am not sure if this can be fulfilled using woocommerce. Let me try explain the exact scenario.

    Assumptions:
    1) I run a store which sells digital (Downloadable) brochure templates which any one can buy and customize
    2) There are around 200 unique brochure templates on the site

    Requirements:
    1) I wish to sell these brochure templates independently @ $10 each
    2) I wish to offer three subscriptions as follows:
    a) Pack 1 – $50 – 6 Downloads max – 1 Year Validity – 1 User – Access to all the templates
    b) Pack 2 – $100 – 15 Downloads max – 1 Year Validity – 1 User – Access to all the templates
    c) Pack 3 – $150 – 30 Downloads max – 1 Year Validity – 1 User – Access to all the templates

    Please let me know the plugins which will be useful to achieve the required result and how to configure the same.

    Thanks in advance.

  8. Julian says:

    Hey Chris,
    Great post, this is looking like it is going to be the solution I need to sell my video. I have gone through the entire process as you mentioned. But the link to the page on my website that comes through via email is always taking me to a 404 page? Any suggestions, I need a resolution ASAP as we are going live in a week. And any help would be massively appreciated!
    Thanks!!

      • Julian says:

        Thanks for that. I installed and did that too, but the same error comes up. When I receive the email from woocomerce to ‘view & download’ my video and I click on that link it takes me to a different URL than what I specified in my digital product. But when I simply type in the proper URL while logged in, the page comes up?
        So it’s giving me permission to see the page when I am logged in (by manually type it in), it’s just the URL that is in the email and in My Orders page is directing me to a 404 page that doesn’t exist?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>