When connecting with customers from time to time you’ll want to send your customer a link to a specific product for their interest. In Easy Digital Downloads it is also possible to specially format a link so that it adds a product immediately to the cart.

Below there’s a sample URL of how such link could look like;
https://domain.com/?edd_action=add_to_cart&download_id={DOWNLOAD_ID}

You need to replace the {DOWNLOAD_ID} part with a actual ID of one of your downloads. These download IDs can be found in the URL when you’re editing a download. E.g. when you have the following URL; https://domain.com/wp-admin/post.php?post=12345&action=edit, the download ID is 12345.

Adding Download Variations to the Cart

If your download has variable pricing/options using just the above won’t work. For that to work you’d want to add a additional parameter to the URL. Here’s an example of an URL where the 2nd pricing option is added to the cart.

https://domain.com/?edd_action=add_to_cart&download_id={DOWNLOAD_ID}&edd_options[price_id]={OPTION_ID}

The {OPTION_ID} is something you’d need to replace with your own download option ID, which can be found when editing the download marked as the “Price ID: X” at a variation.

Including a Discount Code

If you also want to include a specific discount code you can add a &discount={CODE} parameter to the URL. A full URL with a download (with a specific variation) and discount would look like this;

https://domain.com/?edd_action=add_to_cart&download_id=12345&edd_options[price_id]=2&discount=25OFF

Going straight to the Checkout

Its best for your and easiest for the customer to be directly at the checkout page. The aforementioned URLs can easily be modified to go to the checkout immediately instead of the homepage. Just modify the URL to include your checkout page, e.g; https://domain.com/checkout/?edd_action=add_to_cart&download_id=12345&edd_options[price_id]=2&discount=25OFF

EDD Cart URL

The earlier mentioned URLs can be sufficient, but they do have a few shortcomings. This is why I’ve build the EDD Cart URL plugin, which allows you to setup special cart URLs like the above and more.

Add Multiple Downloads to the Cart

With the EDD Cart URL plugin you can add as many products to the cart as you want. You can select which download – including variation – and the quantity of the downloads added to the cart.

Empty the Cart Before

If you’re selling a service or a single product with different variations it sometimes wouldn’t make sense for a customer to purchase more then one. In such case it can be very convenient to empty the cart of any prior downloads.

The EDD Cart URL has a optional setting for this that you can be enabled/disabled per Cart URL. This is a feature I’m using for one of my other plugins – Keyboard Action.

Short and Clean URLs

The generated URLs by the EDD Cart URL plugin are a lot cleaner. Sending a long URL with a lot of unknown stuff in there (from the customer point of view) it may look a bit odd. The generated URLs by EDD Cart URL look a lot cleaner. As a comparison, here’s an example of how the EDD Cart URL looks like;

https://domain.com?add_to_cart=7001

There’s no limit to the amount of custom EDD Cart URLs you can create, from the settings overview you can create as many as you need;

About the author: Jeroen Sormani is actively building WordPress, WooCommerce and Easy Digital Downloads plugins. Slightly obsessed by writing high quality code.
Follow Jeroen on Twitter

Leave a Reply

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