Easy Digital Downloads: Force account creation by cart total

Force account creation in Easy Digital Downloads if the cart total reaches a certain amount.

Following on from yesterday’s force account creation by category or tag, here’s how you can force account creation at checkout by the cart total. Simply change the $limit variable in the code example below and the customer will be forced to create an account when this cart total is reached.

You can find more useful code snippets for Easy Digital Downloads in the EDD Code Snippet Library.

Easy Digital Downloads: Force account creation by category or tag

Force account creation in Easy Digital Downloads if any of the downloads in the cart belong to a specific download category or download tag.

Here’s how you can force account creation in Easy Digital Downloads if any of the downloads in the cart belong to a specific download category or download tag.

Simply add your download categories and tags into each of the arrays shown below.

You can find more useful code snippets for Easy Digital Downloads in the EDD Code Snippet Library.

Prevent multiple cart subscriptions in Easy Digital Downloads

If you’re selling subscriptions with Easy Digital Downloads, then chances are you’re already using the EDD Recurring Payments add-on.

Since you can’t purchase more than 1 subscription at a time, I’ve put together a small plugin that will prevent a customer from adding more than 1 subscription download to the cart. If a download exists in the cart that’s already setup for recurring payments, a simple alert will be shown to the customer informing then that multiple subscriptions cannot be purchased at the same time.

Download plugin

Tested with Easy Digital Downloads v2.0.4 and Recurring Payments v2.14.

Hide purchase link for specific categories in Easy Digital Downloads

This tutorial for Easy Digital Downloads will show you how you can hide the purchase links of downloads that belong to specific download categories.

This tutorial for Easy Digital Downloads will show you how you can hide the purchase links of downloads that belong to specific download categories. The purchase link will be hidden wherever the downloads shortcode is used, and on the single download pages.

Copy and paste the following function (mind the opening PHP tag!) into your child theme’s functions.php or place into a custom plugin. Add your download categories into the array using either the category name, category slug, or category ID.

Restrict cart to one download at a time in Easy Digital Downloads

This code snippet will show you how you can restrict the cart to one download at a time in Easy Digital Downloads

A customer on the Easy Digital Downloads forums needed a way to limit their checkout cart to only 1 download at a time.

The following filter will clear the cart right before a download is added via the purchase buttons, meaning only the most recently added download will exist in the cart.

Copy and paste the following filter into your child theme’s functions.php or custom plugin:

Change the button text for free downloads in Easy Digital Downloads

This tutorial will show you how you can change the button text for free downloads in Easy Digital Downloads

This code snippet will show you how you can change the button text of a free download in Easy Digital Downloads. By default it shows Free – Add to Cart which sometimes is not ideal.

The default button text for free downloads

The default button text for free downloads
The default button text for free downloads

Our new button text for free downloads

Our new button text for free downloads
Our new button text for free downloads

Copy and paste the following function (mind the opening PHP tag) into your child theme’s functions.php or custom plugin. Change the $free_download_text variable on the first line of the function to what you’d like your button to say for free downloads.

There’s also a plugin version if you prefer.

Say “thanks!” to your customers with EDD Purchase Rewards

Reward customers that purchase from your online store with the free EDD Purchase Rewards plugin for Easy Digital Downloads

Have you ever wanted to reward customers that purchase from your online store? With the free EDD Purchase Rewards plugin for Easy Digital Downloads you can do just that. They simply make a purchase, and receive a discount which is shown on the confirmation page (it can also be sent to their email)!

Or, would you like your customers to share their latest purchase before they get a discount? Enable this setting, and ask the customer to share their purchase to their favorite social network before their discount is unlocked for future use. The site owner benefits from more exposure (hopefully more sales), and the customer receives a nice discount to use on their next purchase. It’s a win for everyone!

Providing your customers with a little something extra after they have placed their trust in your products or services is a great way to build loyalty. These customers are more likely to purchase from you again in the future, and more likely to tell others about their positive experience.

Download now for free

Ask customers to share for a specified percentage or flat rate
Optionally ask your customers to share before receiving the discount
As soon as the customers have shared, they are rewarded with a discount code. This can be a discount code you've already made, or choose to create one on the spot
As soon as the customer has shared, they are rewarded with a discount code. This can be a preselected discount code, or choose to create a unique one-time use discount code.
The one-time use, unqique discount code is created just for the customer
The unique, one-time use discount code is created for the customer. The customer’s email address is used for the name so it’s easily identifiable.
A payment note is recorded showing the discount code that was stored against the purchase
A payment note is recorded showing the discount code that was stored against the purchase.

Let’s look at what this plugin allows you to do:

  1. Reward the customer with a discount code for purchasing from you
  2. Pre-select a discount code, or generate a unique, one-time use discount for the customer. The generated discount can be a percentage, or flat amount.
  3. Optionally make the customer share their purchase to at least 1 social network before receiving their discount
  4. Optionally set a minimum purchase amount before the customer is rewarded with a discount
  5. Optionally send the discount to the customer when they are rewarded with a discount
  6. Use the plugin as a simple sharing tool without the need to reward customers with discounts
  7. Optionally use a shortcode for finer placement on the purchase confirmation page
  8. Customize the reward email
  9. Customize the twitter message
  10. Customize the default sharing title, default sharing message, reward title, reward message, reward sharing title, reward sharing message, reward sharing thanks title and reward sharing thanks message.

Download EDD Purchase Rewards from the WordPress repository. If you’re a developer and wish to contribute, it’s also hosted on GitHub.

Force user accounts for orders over $0.00 in Easy Digital Downloads

Force account creation at checkout for orders over $0.00 in Easy Digital Downloads

If you’re using Easy Digital Downloads, this tutorial will show you how you can force a customer to create a user account at checkout, but only for orders over $0.00. If the customer’s order is $0.00 (free purchase) then creating a user account will be optional.

Make sure Disable Guest Checkout is not enabled, and Show Register / Login Form? is enabled. You can find these options under downloads -> settings -> misc. It should look like this:

Misc settings in Easy Digital Downloads

The code

Copy and paste the following function (mind the opening PHP tag) into your child theme’s functions.php or custom plugin.

That’s it!

Deselect other pricing options when last option is checked

This tutorial will show you how you can automatically deselect all the other pricing options when the very last option is checked.

With Easy Digital Downloads you can enable the multi-option purchase mode (shown below) which will allow the customer to select and add more than one pricing option to their cart. This tutorial will show you how you can automatically deselect all the other pricing options when the very last option is checked.

Imagine that you are selling an MP3 album with Easy Digital Downloads. You allow the customer to purchase each song individually, with the last pricing option being the full album. It would be nice (and convenient) to deselect all the other pricing options, if the customer had chosen a few songs, but then decided to purchase the full album. There’s no real point in the customer purchasing the same song twice.

Multi-option purchase mode enabled
Multi-option purchase mode enabled
The standard behaviour of multi-check pricing options
The standard behaviour of multi-check pricing options
Checking the last pricing option now deselects the others
Checking the last pricing option now deselects the others

Copy and paste the following function (mind the opening PHP tag) into your child theme’s functions.php or custom plugin.