All Access - Shortcodes

This document explains how to use the shortcodes available in the EDD All Access extension for Easy Digital Downloads.

Shortcodes:

[edd_aa_customer_passes]

This shortcode will output a list of the customer's All Access Passes along with all of the relevant details. We recommend putting it on their Customer account page.

Sample output from the [edd_aa_customer_passes] shortcode:

Once the customer clicks on "View Full Details", they will see more details about that All Access Pass:

If the All Access Pass has a download limit, the customer will see additional information about when their download limit period expires and starts over.

Shortcode: [edd_aa_all_access]

This shortcode is powerful for giving your customers a great user experience. It gives you a quick and easy way to get customers to log in and/or to purchase a specific All Access Pass. It's perfect for a page where you might be advertising an All Access Pass but also want existing All Access Pass customers to be able to log in.

This shortcode will show one of 3 different things:

1. Logged out: If the customer is logged out, they will see both "Login" and "Buy Now" buttons. 

2. Logged in without access: If they are logged in but haven't purchased the All Access Pass, they will only see the "Buy Now" button for the All Access Pass.

3. Logged in with access: If they are logged in AND have purchased the All Access Pass, they will see a "success" message. By default that message is: 
"You have an All Access Pass for Product X". You can also set it up to automatically redirect them to a different page (like a "VIP Welcome" page). Alternatively, you can also have it show restricted HTML content to users who have this All Access Pass.

This shortcode can accept the following paramaters:

  • id – the ID number of the All Access download required
  • price – whether to show the product price or not. 1 to show it, 0 to hide it.
  • text – the text displayed on the Buy Now button
  • style – the style of the purchase link, either “button” or “text”
  • color- the color of the button (when using the “button” style”:
    • gray
    • blue
    • green
    • dark gray
    • yellow
  • class – one or more custom CSS classes you want applied to the All Access Buy button
  • popup_login - Whether the login form should open in a popup modal. If you want it to, use "true" here. Otherwise leave blank.
  • buy_instructions - Text Instructions above the Buy Now button. If blank this will not be shown.
  • login_instructions - Text Instructions above the Login button. If blank this will not be shown.
  • login_btn_style - the style of the login link, either “button” or “text”. Default is "text".
  • direct – whether the purchase button should send the customer straight to PayPal or to the checkout screen.
  • preview_image - A URL to an image which will show if the user does not have access.
  • success_redirect_url – The URL the user should be directed to if they are logged in and have the All Access Pass. 
  • success_text – The message shown to a user before they are redirected when successfully logged in and purchased. By default this is "You have an All Access Pass for Product X".

Example usage:

To display a log in button and a purchase button and redirect the user if they are logged in with an All Access Pass, use the shortcode like this:

[edd_aa_all_access id="94" price_id="0" text="Add to Cart" style="button" popup_login="true" success_redirect_url="https://mywebsite.com/vip-welcome" success_text="Great! You have All Access"]

Restricting Content: Instead of using success_text, you can also show success content. This is perfect for single pages where you want to restrict exclusive content to All Access Pass holders. To show exclusive, restricted content to All Access Pass Holders, use the shortcode like this:

[edd_aa_all_access id="YOUR_ALL_ACCESS_PRODUCT_ID_HERE"]
Your restricted content goes here. It can be HTML.
[/edd_aa_all_access]

Restricting Content with a preview image: To show a preview image, use the shortcode like this:

[edd_aa_all_access id="YOUR_ALL_ACCESS_PRODUCT_ID_HERE" preview_image="http://url-to-image.jpg"] 
Your restricted content goes here. It can be HTML.
[/edd_aa_all_access]

Restricting Content with a preview image and instructional text: To show a preview image as well as output custom instructional messages to the user, use the shortcode like this:

[edd_aa_all_access id="YOUR_ALL_ACCESS_PRODUCT_ID_HERE" preview_image="http://url-to-image.jpg" buy_instructions="Buy Now to unlock access" login_instructions="Already purchased? Login here to unlock access"] 
Your restricted content goes here. It can be HTML.
[/edd_aa_all_access]

You can also place other shortcodes into the restricted area. For example, you may wish to show a person's purchase history in the same place they log in or buy. To do that, use something like this:

[edd_aa_all_access id="YOUR_ALL_ACCESS_PRODUCT_ID_HERE" buy_instructions="Buy Now to unlock access" login_instructions="Already purchased? Login here to unlock access"]
[purchase_history]
[/edd_aa_all_access]

Shortcode: [edd_aa_restrict_content]

This shortcode is very simple and can be used to output content only if the customer has a specific all access pass. Example Usage:

[edd_aa_restrict_content id="YOUR_ALL_ACCESS_PRODUCT_ID_HERE"] 
Restricted content goes here. It can be anything you'd like - even HTML.
[/edd_aa_restrict_content]

Shortcode: [edd_aa_no_access_pass]

This shortcode is very simple and can be used to output content only if the customer DOES NOT have a specific all access pass. For example, you may wish to show "sales" information only if the customer hasn't purchased yet. Example Usage:

[edd_aa_no_access_pass id="YOUR_ALL_ACCESS_PRODUCT_ID_HERE"] 
Sales content goes here. It can be anything you'd like - even HTML.
[/edd_aa_no_access_pass]

Shortcode: [downloads all_access_customer_downloads_only="yes"]

The [downloads] shortcode (which is part of Easy Digital Downloads itself), can be modified to only show products that the customer has access to through All Access. To do so, simply add this to the shortcode: all_access_customer_downloads_only="yes".

For example:

[downloads all_access_customer_downloads_only="yes"]

Shortcode: [purchase_link all_access_download_now_text="Download Now"]

The [purchase_link] shortcode (which is part of Easy Digital Downloads itself), allows you to modify the text shown to your All Access customers so that you can modify the "Download Now" text.To do so, simply add this to the shortcode: all_access_download_now_text="Download Now". Then, replace the "Download Now" with your own custom message.

For example:

[purchase_link all_access_download_now_text="YOUR CUSTOM TEXT HERE"]