Skip to main content
Easy Digital Downloads Documentation
Documentation, Reference Materials, and Tutorials for Easy Digital Downloads

Additional Shortcodes

‘Additional Shortcodes’ adds shortcodes to EDD that allow for showing or hiding content based on several conditions.

Supported conditions:

  • If the cart is empty
  • If the cart contains specific products
  • If the current user has made previous purchases
  • If the current user has no made no previous purchases
  • If the visitor is logged in
  • If the visitor is logged out
  • If the user has active licenses (Software Licensing required)
  • If the user has expired licenses (Software Licensing required)

Basic installation and use

Click here to download the extension. Once the extension is installed and activated you will be able to make use of the additional shortcodes (listed below).

Note: the shortcodes need opening and closing tags. As in [shortcode]Content here[/shortcode].

The Additional Shortcodes list

  • Show only if the cart has items in it:
    • [edd_cart_has_contents]Content Here[/edd_cart_has_contents]
  • Show only if the cart is empty
    • [edd_cart_is_empty]Content Here[/edd_cart_is_empty]
  • Show only if the cart contains any/all of the specified items
    • [edd_items_in_cart ids=”20″]Content Here[/edd_items_in_cart]
    • [edd_items_in_cart ids=”20,34,25:1″]Content Here[/edd_items_in_cart]
    • [edd_items_in_cart ids=”20,34,25:1″ match=”all”]Content Here[/edd_items_in_cart]
    • [edd_items_in_cart ids=”20,34,25:1″ match=”any”]Content Here[/edd_items_in_cart]
  • Show if the user has made previous purchases (will always be hidden if logged out)
    • [edd_user_has_purchases]Content Here[/edd_user_has_purchases]
  • Show only if the user has no purchases. Includes the ‘loggedout’ parameter to specify if logged out users should be included in seeing the content. (Default true)
    • [edd_user_has_no_purchases loggedout=true]Content Here[/edd_user_has_no_purchases]
  • Show content only if a user is logged in
    • [edd_is_user_logged_in]Content Here[/edd_is_user_logged_in]
  • Show content only if a user is logged out
    • [edd_is_user_logged_out]Content Here[/edd_is_user_logged_out]
  • Show content only if a user has purchased any of the specified download ids. Supports multiple IDs. If a download has variable pricing, you can pass just the ID for all options, or : for a specific variable pricing option.
    • [edd_user_has_purchased ids=”20,34,25:1″]Content Here[/edd_user_has_purchased]
  • Software Licensing Support:
    • Show content only if a user has active licenses
      • [edd_has_active_licenses]Content Here[/edd_has_active_licenses]
    • Show content only if user has expired licenses
      • [edd_has_expired_licenses]Content Here[/edd_has_expired_licenses]

Ways to make use of Additional Shortcodes

There are many ways you can make use of these additional shortcodes. You can automatically customize the content of a page for a specific user in a specific moment. This can hugely increase the chances they will convert to a customer. Here are a few examples:

  • If a visitor has a certain item in their cart, you can suggest related items to add before checkout.
  • If a visitor happens to click on their cart page, and they have not added any products, instead of just telling them ‘your cart is empty’ (which may be obvious to them) you can load products on the page. Then they can shop right from that page without having to search elsewhere or wait for another page to load.
  • If a visitor is logged in to your site, but has never purchased a product, they are demonstrating heightened intent to purchase. They are likely almost ready to purchase, they may just need a nudge. You can nudge them with a discount that is not available to the general public.

Customizations like these can be highly effective. And they are automated, once you set them up, you don’t have to think about them again.