Docs – Easy Digital Downloads https://easydigitaldownloads.com Sell Digital Products With WordPress Tue, 15 Jul 2025 19:42:29 +0000 en-US hourly 1 https://wordpress.org/?v=6.8.2 https://easydigitaldownloads.com/wp-content/uploads/2023/10/cropped-new-favicon-1-32x32.png Docs – Easy Digital Downloads https://easydigitaldownloads.com 32 32 How to use EU VAT Exports https://easydigitaldownloads.com/docs/eu-vat-reports-exports/ Tue, 15 Jul 2025 19:42:22 +0000 https://easydigitaldownloads.com/?post_type=edd_doc&p=1822002 Important: This feature requires an active Easy Digital Downloads (Pro) license key and for the Easy Digital Downloads (Pro) plugin to be installed and activated. Don’t have Easy Digital Downloads (Pro)? Get it today! Easy Digital Downloads (Pro) includes a number of reports and export tools to make it easier for you to download the

The post How to use EU VAT Exports first appeared on Easy Digital Downloads.

]]>
Important: This feature requires an active Easy Digital Downloads (Pro) license key and for the Easy Digital Downloads (Pro) plugin to be installed and activated. Don’t have Easy Digital Downloads (Pro)? Get it today!

Easy Digital Downloads (Pro) includes a number of reports and export tools to make it easier for you to download the data necessary to submit your MOSS EU VAT returns. Before getting started, be sure that your site has the most up-to-date version of Easy Digital Downloads (Pro). If you need help getting started with Easy Digital Downloads and EU VAT, you can read our guide on how to set up EU VAT.

Note: The information in this article is not tax advice and is provided in order to help understand the tools available with Easy Digital Downloads to aid in your MOSS VAT return submissions. All information should be verified with a tax professional for accuracy for your business.

When do I have to submit my MOSS VAT returns by?

When collecting VAT from customers in the EU, it is generally suggested that you submit your VAT return by the 20th of the month following the end of each quarter. This means by the 20th of April, you would submit data for the period of January 1st through March 31st. It is also recommended to use the Mini-One-Stop-Shop (MOSS) system to handle submitting a single tax return and payment for the entire EU, as it allows you to register for a European VAT no matter your location.

Below we’ll provide you with multiple methods to export your MOSS VAT data from Easy Digital Downloads (Pro) to aide you in gathering the required information for these returns. These three methods are:

  • EU VAT Summary Export – This is the easiest option, and is best for when your store’s main currency is the same currency that you have set in the MOSS VAT return.
  • Third-Party Accounting Systems – If you are using a system like Xero, Sage, or QuickBooks, and have added the VAT collected from each country, use this method.
  • EDD Orders Export – If your store’s main currency is different from the currency used in the MOSS VAT return, and you aren’t using a 3rd party system, use this method.

EU VAT Summary Export

Easy Digital Downloads (Pro) provides a report that will summarize all VAT collected. This export will be provided in the same format that you will need when uploading/inserting in to your MOSS tax return, making it quick and easy for you to file your returns.

What does this report contain?

The EU VAT Summary report contains all the necessary information needed for your MOSS return, by country. This includes:

  • Country
  • Standard VAT Rate
  • Value of Items (Excluding VAT)
  • VAT

This CSV is formatted to match the same way that your MOSS VAT return asks for it, making your return quick and easy.

Exporting the EU VAT Summary

  1. Go to Downloads > Reports > Exports
  2. Scroll down to the Export EU VAT export.
  3. Select the Start and End Dates for the period that you are reporting for.
  4. Click Generate CSV.
  5. When the Export is done, a CSV file will be downloaded to your computer automatically.
  6. Open the CSV file using any spreadsheet software (Google Sheets, and Microsoft Excel work great).
  7. This spreadsheet will contain all the information you need to input into your MOSS VAT return, separated by country.

Important currency information

The EU VAT Summary Export is provided based on the Easy Digital Downloads store currency found at Downloads > Settings > General > Currency. If you use our Multi Currency plugin, no additional steps are needed, as all price information for each payment is saved in your store’s main currency.

If your store currency does not match the currency that you need to submit your MOSS VAT return in, then you should use a different method.

Tax collected in your own country

If you are located in the EU, then you may notice that the report does not include details of the tax collected for your own home country. This is intentional as the report generated is information you need for your EU VAT tax return, which should not contain tax collected in your home country. Tax collected in your home country should be submitted in your local tax returns.

Third-Party Accounting Systems

Many people use Easy Digital Downloads alongside an electronic accounting platform such as Xero, QuickBooks or Sage. If you add all your sales (including the tax collected and details of the customer’s country) to a separate system – either via manual import or by integrating your accounting system with EDD – then you can use this system to generate a report listing all the EU VAT that you collected during a specific period. You can use this report to create your quarterly MOSS return.

For instructions on how to generate MOSS VAT reports using this method, please consult the documentation for your chosen accounting system.

EDD Orders Export

You can use the Easy Digital Downloads orders export to get the information you need for the MOSS VAT return:

1.  Go to Downloads > Reports > Export.

2.  In the Export Orders tool, select the dates for the period for which you need to submit a tax return. Click the button to download the order records for ‘All statuses’.

3.  This will save a CSV file to your computer. Open it using any spreadsheet software (e.g. Excel, Numbers or Google Sheets).

4.  Reformat the spreadsheet as follows (for instructions on how to sort columns etc., please see the documentation for your spreadsheet software):

  • Delete all the columns apart from ‘Country Name’, ‘Amount’, ‘Tax’ and ‘Date’.
  • Sort the spreadsheet by the ‘Tax‘ column and remove all records where no VAT was paid, as you don’t need to report on these.
  • Sort the spreadsheet by the ‘Status’ column and delete any statuses that you don’t need to report on. For example, you should remove ‘refunded’, ‘abandoned’ (if you are using an abandoned cart plugin), ‘failed’, ‘cancelled’ etc. If you are using the Recurring Payments extension then you should keep all payments with the ‘complete’ and ‘edd\_subscription’ statuses because new sales and renewal payments should be included in your EU VAT tax return.
  • Next sort the spreadsheet by the ‘Country Name’ column.
  • If your company is based in the EU or UK – Delete any payments from customers in your own country, because you will be submitting a separate domestic tax return for this and don’t need to include it in your MOSS return. (For example, if you’re in the United Kingdom then you should remove any UK sales and submit this on your UK tax return instead.)
  • Insert a new row between the payments for each country.
  • Now use your mouse to highlight the ‘Tax’ column for all the payments relating to the first country in the table (e.g. Belgium).
  • If your store’s main currency is not Euros, then you should then look up the exchange rate published by the European Central Bank on the last reporting day of the VAT MOSS quarter (or if it’s a weekend, or bank holiday the next available day), and convert the totals for each country into Euros. This is essential because you must submit your MOSS return in Euros and not your base currency.

Use the SUM function to calculate the total price and VAT collected for that country. This is the information that you need to enter on the MOSS VAT return.

Frequently Asked Questions

What if a country’s VAT rate changed during the period covered by my return?

EU countries normally change their VAT rates at the end of a reporting period, so this is unlikely to happen. If it ever does happen, then the report will show the latest VAT rate if it has changed. The amounts collected will be correct, so long as you keep Easy Digital Downloads itself up to date.

If you have “Automatic VAT Rates” enabled, EDD will take care of updating tax rates automatically.

How do I download an EC Sales List?

In addition to the MOSS tax return, if you are in an EU country, then you may need to submit a list of all your sales where the VAT was reverse charged.

Easy Digital Downloads also includes an export for this purpose.

To create the report, go to Downloads > Reports > Export and find the Export EC Sales List report. You can then select the start and end date that you are reporting on, and download the data into a CSV file.

The report contains all the information that is required for the EC Sales List. You can open it using any spreadsheet software.

The post How to use EU VAT Exports first appeared on Easy Digital Downloads.

]]>
Migrating from the EU VAT Extension https://easydigitaldownloads.com/docs/migrating-from-eu-vat-extension/ Tue, 15 Jul 2025 19:42:13 +0000 https://easydigitaldownloads.com/?post_type=edd_doc&p=1821832 This guide will walk you through transitioning from the third-party Easy Digital Downloads – EU VAT plugin to the native VAT functionality now built into Easy Digital Downloads (EDD). The migration process is designed to be straightforward and seamless. Most importantly, all of your existing order data, including VAT information, will remain intact and unchanged.

The post Migrating from the EU VAT Extension first appeared on Easy Digital Downloads.

]]>

This guide will walk you through transitioning from the third-party Easy Digital Downloads – EU VAT plugin to the native VAT functionality now built into Easy Digital Downloads (EDD).

The migration process is designed to be straightforward and seamless. Most importantly, all of your existing order data, including VAT information, will remain intact and unchanged. While we have improved the data handling and validation, it is stored and displayed in a way to ensure you will not lose any historical records.

The first step to enabling the built-in EU VAT feature for Easy Digital Downloads, is to ensure you have updated to the latest Easy Digital Downloads plugin version.

Important: This feature requires an active Easy Digital Downloads (Pro) license key and for the Easy Digital Downloads (Pro) plugin to be installed and activated. Don’t have Easy Digital Downloads (Pro)? Get it today!

Switching to built-in EU VAT

Once you have updated, all you have to do is enable the setting, and Easy Digital Downloads handle the rest.

Navigate to Downloads > Settings > Taxes in your WordPress Dashboard

Now ensure you have the Enable Taxes setting toggled on, and you can then enable the EU VAT option at the bottom of the settings.

Note: The EU VAT feature in Easy Digital Downloads (Pro) is not enabled by default, in order to prevent any conflicts or customizations you may have with the Easy Digital Downloads – EU VAT extension. Easy Digital Downloads will not automatically switch your site over to our native EU VAT support without your explicit action to enable it.

That is it! Once you enable the Easy Digital Downloads VAT setting, Easy Digital Downloads – EU VAT plugin will be automatically deactivated to prevent any conflicts.

Key Changes and Improvements in EU VAT

While the transition to our built-in EU VAT feature is simple, we have added some additional time-saving features and improvements to streamline your experience.

Improved VAT Rate Management

To ensure a smooth transition, EDD will automatically import the rates you were using in the third-party plugin and register them as official tax rates within EDD. This means that all aspects of Easy Digital Downloads are natively aware of your VAT tax rates, including settings, reporting, and exports.

Note for advanced users and developers: If you were using the edd_vat_current_eu_vat_rates filter to modify rates, the migration process will respect your filtered values.

New Automatic Rate Updates

You can now enable Automatic Rates from the EU VAT settings screen. This adds a weekly task to your site that checks our VAT Rate API for the latest official EU tax rates. If a country’s rate has changed, EDD will update it for you automatically, ensuring you have the latest published rates.

We know keeping your tax rates updated is important and you should not have to wait for an update to Easy Digital Downloads (Pro) to get them, so we’ve made this feature available to all Easy Digital Downloads users, Lite and Pro, via our own VAT Rates API.

Note: This automatic process will not overwrite any tax rates that you have manually created. The Automatic VAT Rates feature is opt-in.

Simplified UK VAT Validation

VAT Number validation is now included automatically through our API. Not only does this simplify your store’s configuration, but helps ensure we can continue to ensure continued compatibility without the need for a plugin update.

Looking for more information about our EU VAT feature?
You can read more in our How to Set Up EU VAT article.

The post Migrating from the EU VAT Extension first appeared on Easy Digital Downloads.

]]>
How to Set Up EU VAT https://easydigitaldownloads.com/docs/eu-vat/ Tue, 08 Jul 2025 09:02:21 +0000 https://easydigitaldownloads.com/?post_type=edd_doc&p=1821807 Important: This feature requires an active Easy Digital Downloads (Pro) license key and for the Easy Digital Downloads (Pro) plugin to be installed and activated. Don’t have Easy Digital Downloads (Pro)? Get it today! Easy Digital Downloads supports EU VAT Tax and VAT Number validation without the need for any additional plugins of extensions. Before

The post How to Set Up EU VAT first appeared on Easy Digital Downloads.

]]>
Important: This feature requires an active Easy Digital Downloads (Pro) license key and for the Easy Digital Downloads (Pro) plugin to be installed and activated. Don’t have Easy Digital Downloads (Pro)? Get it today!

Easy Digital Downloads supports EU VAT Tax and VAT Number validation without the need for any additional plugins of extensions. Before you get started, ensure you have updated Easy Digital Downloads to the latest version. This guide will walk you through enabling EU VAT collection with Easy Digital Downloads, as well as configuring automatic VAT Tax rate updates, and VAT Number validation.

Enabling EU VAT

In order to enable EU VAT, you must first have the main Taxes enabled in EDD. Please navigate to the Downloads > Settings > Taxes page, then enable the Enable Taxes feature.

Once enabled, additional settings will show on this page, along with the EU VAT option at the bottom of the page. Enable the EU VAT setting and then click the Save Changes button.

Enabling the EU VAT feature in Easy Digital downloads.

Configuring EU VAT

Once EU VAT is enabled, a new sub-menu item called EU VAT will be visible, where you can finish configuring your store for EU VAT.

Where to find the EU VAT settings in Easy Digital Downloads.

Automatic Rates

Next, you’ll want to keep your tax rates up to date is important, so Easy Digital Downloads can regularly check for new published VAT Tax rates and register them with your store. The automatic VAT Tax rates are available to both Free and Pro users of Easy Digital Downloads.

When this feature is enabled, your store will check our custom API for the latest VAT Tax rates for countries. This feature is not enabled by default and is opt-in.

Automatically updating EU VAT Tax Rates with Easy Digital Downloads.

Once activated and you’ve saved your settings, Easy Digital Downloads will schedule a background task to retrieve the latest rates. Please allow a few minutes for those rates to be retrieved. You will see an admin notice that this process is scheduled.

Important Note: Should you disable this feature, you will be required to monitor and update your EU VAT Tax rates manually.

Order Details

Enabling this option will show the VAT information on the customer receipt page.

Reverse Charge in Home Country


By default, if your store is based in an EU member country, VAT will always be charged on sales to customers in your own country, even if they provide a valid EU VAT number.


This is because EU reverse charge rules do not apply to domestic transactions. In most EU countries, businesses are required to charge VAT on local sales, regardless of whether the customer is a consumer or a business.

If you’re located in an EU country that explicitly exempts domestic B2B sales from VAT when a valid VAT number is provided, you may enable this setting in Easy Digital Downloads. When enabled, VAT will be reverse-charged for domestic business customers, meaning they won’t be charged VAT at checkout—but they’ll be responsible for accounting for it themselves.

Enabling EU VAT Reverse Charges in Easy Digital Downloads.

⚠ Important: Only enable this option if your local tax authority allows domestic reverse charges for B2B transactions. Not all EU countries permit this. Please check with a tax professional to determine if you need this setting.

VAT Number Validation

Now that you are configured for collecting VAT Tax, you can ensure that your customers are supplying valid VAT Numbers at checkout with our validation feature. When required, a field will be shown at checkout for customers to enter their VAT Number and validate it before they complete their purchase.

Once you’ve activated your Easy Digital Downloads (Pro) license key, VAT Number validation at checkout is automatically handled for you!

Company Information

All the fields in this section will be displayed on the order details page(receipt) if you have enabled the ‘Order details’ setting above.

Country and Country of VAT Registration fields

Country – This defaults to the ‘Base Country’ selected in the general Easy Digital Downloads settings. You should change this if your store is NOT based in your base country.

Country of VAT registration – Use this field to select the country that issued your EU VAT number:

  • If you are registered for VAT in the country where you are actually based, select your actual country.
  • If you are registered for VAT in a different country (e.g., under the MOSS system) – Select ‘EU MOSS Number’.
Displaying your Company information, including EU VAT Number on the Easy Digital Downloads receipt.

If you are already using a 3rd Party Extension to add EU VAT Support
you learn about migrating to our built-in EU VAT feature.

The post How to Set Up EU VAT first appeared on Easy Digital Downloads.

]]>
Setting up Square Payments https://easydigitaldownloads.com/docs/setting-up-square-payments/ Tue, 17 Jun 2025 23:14:35 +0000 https://easydigitaldownloads.com/?post_type=edd_doc&p=1821158 This tutorial will show you how to set up the Square integration with Easy Digital Downloads, so you can start taking payments. Connecting Square to Your WordPress Site Before you get started, please ensure that your Easy Digital Downloads Currency is set to the same currency as your business location in Square. If these do

The post Setting up Square Payments first appeared on Easy Digital Downloads.

]]>
This tutorial will show you how to set up the Square integration with Easy Digital Downloads, so you can start taking payments.

Connecting Square to Your WordPress Site

Before you get started, please ensure that your Easy Digital Downloads Currency is set to the same currency as your business location in Square. If these do not match, you will not be able to process payments. Either change your currency in Easy Digital Downloads, or select a different business location in your EDD Square settings.

Easy Digital Downloads enables you to connect your site to Square in just a few clicks. First, go to Downloads » Settings in your WordPress admin area and click on the Payments tab, and select Square from the list of sections.

Once you’ve confirmed your currency is configured correctly, you can continue to connect with Square by clicking the Connect with Square button.

Note: For Easy Digital Downloads payment integrations, Test mode and Live mode are configured separately. Make sure the Test Mode option is left unchecked in the Downloads > Settings > Payments to ensure you can process transactions once your products are published.

Next, you’ll be prompted to log in to your Square account. Enter your email address and password, then click on Sign In.

Square will then ask if you want to grant Easy Digital Downloads certain permissions related to your account. Click on Allow to proceed.

This will bring you back to your Easy Digital Downloads Square settings. If the connection was successful, you’ll see a section that shows the connected account and some information regarding any further steps you need to take.

The Primary location for your business will also be imported into your Easy Digital Downloads settings from Square. If your business has multiple active locations, you can select which one you want to use from the Location ID dropdown.

Note: Locations are managed within your Square account. For help with adding, removing, or editing locations, please see Square’s documentation on this topic.

Lastly, make sure to save your settings before leaving this screen.

Setting Up Square Webhooks

Webhooks allow Easy Digital Downloads to receive real-time updates from Square when a payment is completed, refunded, or updated. With Square webhooks enabled, your forms stay in sync automatically, so you don’t have to manually track payment changes.

To learn how to connect Square webhooks to Easy Digital Downloads, follow our guide on setting up Square webhooks.

Connecting in Test Mode

To connect your Easy Digital Downloads store to Square while in Test Mode, you will need to first create a free Square Developer account. This will enable you to set up a Sandbox Test Account and keep live transactions separate from test transactions.

Head over to the Square Developer platform and click Start Building.

If you don’t have an existing Square account, create one here. You’ll be able to activate it later when you’re ready to start accepting live payments by following the instructions in the activation email sent to the address associated with your account.

If you already have a Square Seller account, you can sign in to Square Developer using your existing credentials. You may be redirected to the Square Seller Dashboard. For the next steps, you need to log into the Developer Dashboard.

To get started, click on the blue plus (+) button to create your first application.

This will open a pop-up window where you can name this application (it is for your reference only), agree to the Developer Terms of Service, and then click the Next button.

When asked what type of Application you are building, you can click Skip, as this is for your internal use only.

When presented with the choice of who the Application is for, select Myself and click Complete.

You have now successfully created your personal Application that you can use to test Square. Click on the Back Arrow to head back to the Developer Dashboard, where we will authenticate into your Sandbox Test Account, before connecting to Easy Digital Downloads.

Click on the Sandbox test accounts menu item, where you will be presented with your available Sandbox accounts.

Square automatically creates a Default Test Account in the country you created your account in. If you need a Sandbox Test Account with a different currency, you can click the New sandbox test account button. Click on the Square Dashboard link to open the Seller Dashboard for this Sandbox Test Account.

Once the Seller Dashboard is loaded for your Sandbox Test Account, you are ready to connect Easy Digital Downloads in test mode.

Frequently Asked Questions

These are some of the top questions about the Easy Digital Downloads Square integration.

Will I be charged for using Square on my site?

Easy Digital Downloads does not charge you to use Square to sell your downloads. However, Square’s seller fees do apply to transactions made through your store.

To see Square’s current seller fees for remote online transactions, check out its Pricing page.

Does Easy Digital Downloads have a partnership with Square?

Yes, we do! By partnering with Square directly, we can make sure your payments are processed reliably and securely, according to the platform’s best practices.

Does Easy Digital Downloads store users’ payment information?

No, we do not store your users’ payment information.

Instead, payment details are sent straight to Square to protect both you and your users from the risks that come with storing credit card details on your site.

That’s it! Now you can accept credit card payments with Square!

The post Setting up Square Payments first appeared on Easy Digital Downloads.

]]>
Setting Up Square Webhooks https://easydigitaldownloads.com/docs/setting-up-square-webhooks/ Tue, 17 Jun 2025 23:14:18 +0000 https://easydigitaldownloads.com/?post_type=edd_doc&p=1821172 Would you like your Easy Digital Downloads store to receive real-time updates when a payment is completed or refunded through Square? With Square webhooks enabled, your store can stay in sync with Square so payment statuses are always up to date. This guide will show you how to easily connect Square webhooks with Easy Digital

The post Setting Up Square Webhooks first appeared on Easy Digital Downloads.

]]>
Would you like your Easy Digital Downloads store to receive real-time updates when a payment is completed or refunded through Square? With Square webhooks enabled, your store can stay in sync with Square so payment statuses are always up to date.

This guide will show you how to easily connect Square webhooks with Easy Digital Downloads, ensuring your website stays in sync with your Square activities.

Before you get started, be sure to install Easy Digital Downloads on your WordPress site. After that, connect your site to your Square account.

Understanding Webhooks

Webhooks are a way for Square to notify Easy Digital Downloads when an event happens in your account, like a payment being updated or refunded. Once enabled, Easy Digital Downloads listens for these events so your site can reflect changes in payment status automatically.

With Square webhooks set up, you don’t need to manually check or update your orders after a transaction is processed. Whether a payment goes through, is refunded, or partially returned, your Easy Digital Downloads orders, reports, and customer records will stay up to date based on the latest information from Square.

Enabling Webhooks in Easy Digital Downloads

To connect webhooks to your store, open your WordPress admin area and go to Downloads » Settings » Payments and click on the Square section.

Find the Webhooks Status section in your Connection Status. To continue, click Connect Webhooks

You’ll now see a popup asking you to enter a Personal Access Token. To generate this, you’ll need to create an application in the Square Developer Dashboard.

Creating a Square Application

Click the Square Developer Dashboard link in the popup to open the Square Developer portal in a new tab.

Once there, click on the + icon under the Applications to create a new app.

In the window that appears, enter a name for your application (this is for your own reference only), then click Next.

On the next screen, choose any applicable development goals, or click Skip to proceed directly.

Generating and Entering Your Personal Access Token

From the credentials screen, locate the Access token for your application and click Show next it.

Note: If you’re currently using Test Mode in Easy Digital Downloads, be sure to copy the Sandbox Access Token. If Test Mode is OFF, copy the Production Access Token instead.

Copy the Access token. Then, return to the Easy Digital Downloads popup and paste the token into the Personal Access Token field. Once done, click Connect to continue.

If everything is set up correctly, you’ll see a confirmation message that your webhooks were created or updated successfully, the page will then refresh after a short moment.

Frequently Asked Questions

These are answers to some of the top questions we see about setting up Square webhooks in Easy Digital Downloads.

Do I need to set up webhooks for both Test Mode and Live Mode?

Yes, Square provides separate credentials for Sandbox (Test) and Production (Live) environments. Be sure to use the correct access token based on whether Test Mode is enabled in your Easy Digital Downloads settings.

That’s it! Now you know how to set up Square webhooks with Easy Digital Downloads.

The post Setting Up Square Webhooks first appeared on Easy Digital Downloads.

]]>
Customize Checkout Address Fields https://easydigitaldownloads.com/docs/customizing-checkout-address-fields/ Tue, 29 Apr 2025 15:41:56 +0000 https://easydigitaldownloads.com/?post_type=edd_doc&p=1819978 This document explains how to find and customize checkout address fields displayed on your Easy Digital Downloads checkout page. This feature allows you to streamline the checkout process, potentially reducing cart abandonment by removing unnecessary fields. The checkout address fields’ custom controls are built directly into EDD core, requiring no additional add-ons like Checkout Fields

The post Customize Checkout Address Fields first appeared on Easy Digital Downloads.

]]>
This document explains how to find and customize checkout address fields displayed on your Easy Digital Downloads checkout page. This feature allows you to streamline the checkout process, potentially reducing cart abandonment by removing unnecessary fields.

The checkout address fields’ custom controls are built directly into EDD core, requiring no additional add-ons like Checkout Fields Manager or custom checkout fields code.

You must have EDD v3.3.8 or later to use this feature.

Accessing the Checkout Field Settings

Find these settings by going to DownloadsSettingsPayments from your WordPress dashboard.

Then select the Checkout tab.

Easy Digital Downloads Checkout settings in WordPress.

Scroll down to the Checkout Address Fields section.

The settings to customize checkout address fields in Easy Digital Downloads.

Using the Custom Address Fields Settings

The Checkout Address Fields section provides functionality to manage the visibility and order of the fields.

  • Country
  • Address
  • Address 2
  • City
  • State / Province
  • Postal Code
  • Phone

Toggling Field Visibility

Enable or disable individual fields by clicking the toggle switch next to each field name.

Toggles to customize checkout address fields in WordPress.

A blue toggle indicates the field is enabled and will be displayed on the checkout page. A grey toggle indicates the field is disabled.

Reordering Fields

Drag and drop the fields to rearrange their order on the checkout page. Click and hold the hamburger icon (three vertical lines) next to a field name, then drag it to the desired position.

Reordering checkout address fields in Easy Digital Downloads plugin settings.

Required Fields

Note that certain fields, such as Country and potentially State/Province, might be required if tax settings are enabled on your EDD site. These fields will be indicated and cannot be disabled.

Required checkout address fields in Easy Digital Downloads.

Saving and Previewing Changes

After making any changes, click the Save Changes button at the bottom of the page to apply your modifications.

Preview the checkout page to ensure everything looks good on the front end.

A preview of checkout form with custom checkout address fields created with Easy Digital Downloads in WordPress.

The default Checkout page (under Pages) contains and uses the EDD Checkout block to display the checkout form. The [download_checkout] shortcode can also be used.

Other Considerations

  • Tax Requirements: Be mindful of tax regulations in your region and ensure you collect the necessary information.
  • Payment Gateway Compatibility: These checkout field controls are compatible with all EDD-supported payment gateways.
  • User Experience: While removing fields can simplify checkout, ensure you collect enough information to process orders efficiently.

More Resources

The post Customize Checkout Address Fields first appeared on Easy Digital Downloads.

]]>
Email Setup and Configuration https://easydigitaldownloads.com/docs/email-setup-and-configuration/ Thu, 11 Jul 2024 18:49:37 +0000 https://easydigitaldownloads.com/?post_type=edd_doc&p=1806140 Easy Digital Downloads has a settings area where you can customize all of the emails that are sent by your store. You can get to this page by going to your WordPress Dashboard > Downloads > Emails. The Email settings are divided into three sections, Emails, Settings, Email Reports and Logs. Emails not sending? Consult

The post Email Setup and Configuration first appeared on Easy Digital Downloads.

]]>
Easy Digital Downloads has a settings area where you can customize all of the emails that are sent by your store. You can get to this page by going to your WordPress Dashboard > Downloads > Emails.

The Email settings are divided into three sections, Emails, Settings, Email Reports and Logs.

Emails not sending? Consult our FAQ.

Emails

Any email that EDD sends can be managed from this page. Additionally, for any extension that sends emails, the email will appear here as well.

The table shows the following information:
Sender: Reports what plugin/extension is responsible for the email. EDD Core, WordPress, etc
Context: The context of the email is what triggers the email. For example, the Purchase Receipt is generated for a new Order.
Recipient: The recipient shows who the email is sent to. ie Customer, Admin, WordPress User
Subject: What the email subject is set to.
Updated: This is the last date and time the email was updated.
Status: Reports if the email is enabled or not and allows you to quickly enable or disable most emails. A lock icon indicates you cannot change the status. It’s either required or managed by another plugin, ie WordPress core settings.

Available Emails

There are the emails available to Easy Digital Downloads core plugin. Extension specific emails will be listed in the extension’s documentation. These emails can be edited but some do require specific tags to work proplery.

Purchase Receipt
Sent to customers after a successful order.

Admin Sale Notification
Email sent to the admin after a successful order.

Refund Issued
Email sent to customer when a refund is processed.

Admin Refund Notification
Email sent to the WordPress admin when a refund is processed. This is helpful for stores who have employees who are able to process refunds and want to be alerted when one is done.

New User Registration
This email is sent to a new user when their account is registered via EDD.

Admin New User Notification
This email is sent to the store admin when a new user is registered.

User Verification
This email is sent to a user when they need to verify their account. Important: The {verification_url} template tag must remain in this email. Do not delete it.

Password Reset
This email is sent by WordPress when a user requests a password reset from the EDD Login block.
Important: The {password_reset_link} template tag must remain in this email. Do not delete it.

Stripe Early Fraud Warning
Be alerted when an early fraud warning is detected by Stripe’s machine learning. Avoid disputes before they even happen by reviewing flagged orders to verify them.

Editing Emails

Click the email name to open the editor for the ability to edit the Subject, Heading and Message. Each email will show the default email which you can edit and customize for your specific needs. The Insert Tag button presents available tags for that specific email, clicking the tag will insert into the email.

Settings

Template: The default EDD template is used. You can also select plain text if you don’t want to send HTML receipts. Developers can create custom templates if desired.

Logo: Upload or choose a logo to be displayed at the top of sales receipt emails. Displayed on HTML emails only.

From Name: This should be your site or shop name. Defaults to Site Title if empty.

From Email: This will act as the “from” and “reply-to” addresses.

Admin Email Receipts: Leave blank to use the WordPress Admin email or enter the email address(es) that may receive admin notices. One per line.

Improve Email Deliverability: WP Mail SMTP allows you to easily set up WordPress to use a trusted provider to reliably send emails, including sales notifications.

Email Reports

Email Reports allow you to receive a weekly or monthly email of your store’s performance, showing you the Gross Revenue, Net Revenue, New Customers, Average Order amount and Top 5 Products by Revenue.

Email Frequency: Choose Weekly or Monthly.

Email Recipient: Defaults to the WordPress Administrator or select Custom Recipients to input one or more email addresses to send the report to.

Send Report Summaries: Enable to receive email summaries.

Here is an example of the information provided in the email report:

You can preview what the report will look like by clicking the Send Test Email button. The test email will contain sample data.

Logs

Emails sent by EDD will be logged here. This can be helpful in troubleshooting if customers are reporting they are not receiving emails. If it’s logged here, EDD has attempted to send it. If customers are not receiving emails, it could be your webserver is not sending them. See this guide for details.

The post Email Setup and Configuration first appeared on Easy Digital Downloads.

]]>
Adding custom code after an order is completed https://easydigitaldownloads.com/docs/adding-custom-code-after-an-order-is-completed/ Mon, 17 Jun 2024 19:14:29 +0000 https://easydigitaldownloads.com/?post_type=edd_doc&p=1811387 In Easy Digital Downloads 3.2.0 the after order actions were introduced to replace the deprecated after payment actions. This hook provides developers a way to process intensive actions when a payment completes without affecting the speed and performance of the end user completing the purchase. This is a guide on how to add an after

The post Adding custom code after an order is completed first appeared on Easy Digital Downloads.

]]>
In Easy Digital Downloads 3.2.0 the after order actions were introduced to replace the deprecated after payment actions. This hook provides developers a way to process intensive actions when a payment completes without affecting the speed and performance of the end user completing the purchase. This is a guide on how to add an after order action.

Introduction to After Order Actions

If you are looking to perform additional actions when an order is marked as ‘completed’ you are encouraged to use the edd_after_order_actions hook instead of the edd_complete_purchase hook. What is the difference between these two hooks?

  • edd_complete_purchase – Runs during the purchase process after the user clicks the ‘Complete Purchase’ button and before the ‘Purchase Confirmation’ page is loaded. This hook should be used for “mission critical” tasks, as it will impact the perceived time it takes for the user to complete their purchase. Examples of using this hook should be tasks like creating license keys, generating subscriptions, or anything that the user is required to have visible on the receipt page.
  • edd_after_order_actions – Runs ~30 seconds after the purchase is completed, via the WP_Cron system. This hook should be used to perform additional API calls, expensive database queries, and tasks that should be considered non-mission critical for the user to complete their purchase. Great examples of this are adding users to mailing lists, calculating stats for a user, updating caches, etc.

What arguments are passed into the hook?

The edd_after_order_actions hook sends three arguments:

  • The order ID as an integer
  • The EDD\Orders\Order object
  • The EDD_Customer object

What order statuses are included in ‘complete’?

Easy Digital Downloads uses the status of complete to mark an order as completed. If you are integrating or using the Recurring Payments extension, the edd_subscription status is also considered a ‘complete’ order. If you only want to run your action for the initial purchase (and ignore subscription renewals) you will need to check the $order->status for a value of complete before continuing with your integration.

Why does this require WP_Cron?

WP_Cron is a background process that your WordPress site uses to complete tasks without impacting the user’s experience viewing your site. When traffic is generated on your site, before the page is done loading, WordPress determines if there are any background tasks that need to be completed. If there are, it will spin up a background process to handle these pending tasks.

What if my host disables WP_Cron?

While we do our best to detect if WP_Cron is working, there may be a case where we cannot propertly detect this. If your host or server has WP_Cron disabled or modified to run at a pre-determined frequency, you may need to disable this feature manually. There is a filter if you choose not to use after action hooks, in which case, EDD will fallback and perform the actions at the time of completion, and avoid the delayed process.

NOTICE: Because this after order actions system is dependent on WP_Cron, it should not be used for things considered ‘mission critical’. It’s simply a way to offload expensive integrations with APIs and large sets of data that do not directly affect the purchase data.

Key points about after order actions

  • Triggers via WP_Cron
  • Able to be disabled via filter (edd_use_after_payment_actions)
  • By default, it is scheduled for 30 seconds after the purchase, but can be changed via a filter.
  • The order’s database table contains a column for the time the actions were completed.

Is there an example?

We’ve created a ‘template’ for integrating with the edd_after_order_actions hook in our WP Code library. It can be viewed here:

Migrating your code from edd_after_payment_actions

If you previously integrated with the edd_after_payment_actions hook, the good news is that migrating to this new, more efficient, hook is pretty easy.

The primary difference is the change from the second parameter. Instead of sending in the payment as an EDD_Payment object, it will send in an Order object.

The post Adding custom code after an order is completed first appeared on Easy Digital Downloads.

]]>
WordPress Staging Site Support https://easydigitaldownloads.com/docs/wordpress-staging-site-support/ Thu, 30 Nov 2023 21:41:02 +0000 https://easydigitaldownloads.com/?post_type=edd_doc&p=1803478 The Software Licensing extension for Easy Digital Downloads provides your customers with seamless WordPress Plugin and Theme updates. To do this, users must typically activate their license key within the settings of your Plugin or Theme installed on their WordPress-powered site. This can be a challenge when working with a WordPress Staging Site, as a

The post WordPress Staging Site Support first appeared on Easy Digital Downloads.

]]>
The Software Licensing extension for Easy Digital Downloads provides your customers with seamless WordPress Plugin and Theme updates. To do this, users must typically activate their license key within the settings of your Plugin or Theme installed on their WordPress-powered site. This can be a challenge when working with a WordPress Staging Site, as a customer could be concerned that this would count towards their license activation counts, restricting them from activating their license key on their live site.

Staging sites are important to the workflow of any site, and as such, Software Licensing does not count local or staging environments towards a license’s activation count. To help Plugin and Theme creators, we support a number of staging environment configurations.

Hosting Service Staging Environments

Many hosts provide Staging environments, allowing site owners to test updates and new plugins before they add them to their live website. The Software Licensing extension for Easy Digital Downloads recognizes and supports several of the most popular hosting services in the WordPress ecosystem. Below is a list of specifically supported hosting services that provide custom staging environments.

  • WP Engine
  • InstaWP
  • Cloudways
  • Kinsta
  • GoDaddy
  • FlyWheel
  • BlueHost
  • HostGator
  • SiteGround

If your host is not listed here, they may be using a more standard way of creating staging sites, allowing our Standard Detection rules to apply without specific rules.

If you are a hosting service and want to be added to this list, reach out to us through our support team and we will contact you about allowing your customers to activate Plugin & Theme licenses in your staging environments.

Standard Staging Environments

If the hosting provider does not provide a tool to generate a staging environment or is using a more standard URL for their staging environments, EDD supports the following subdomain patterns as WordPress Staging Site URLs.

  • *.staging.example.org
  • *.test.example.org
  • staging-*.example.org
  • dev.example.org

WP Environment Type

The Plugin Updater class included with Software Licensing’s sample plugin and theme supports the wp_get_environment_type()function that was added in WordPress 5.5.0. If the hosting service or custom staging environment sets the WP_ENVIRONMENT_TYPE constant accurately, Software Licensing will handle the detection of a staging environment automatically, regardless of the domain being used.

The post WordPress Staging Site Support first appeared on Easy Digital Downloads.

]]>
edd_debug_log https://easydigitaldownloads.com/docs/edd-debug-log/ Fri, 14 Jul 2023 17:26:14 +0000 https://easydigitaldownloads.com/?post_type=edd_doc&p=1794467 When debug mode is enabled (Downloads > Settings > Misc > General), specific information will be logged to a custom log file on your site. Developers can make use of this to help troubleshoot issues and results at specific points in their code.

The post edd_debug_log first appeared on Easy Digital Downloads.

]]>
When debug mode is enabled (Downloads > Settings > Misc > General), specific information will be logged to a custom log file on your site. Developers can make use of this to help troubleshoot issues and results at specific points in their code.

edd_debug_log( $message = '', $force = false );
  • $message: This must be a string, and it’s exactly what will show in the log file.
  • $force: Use the function with this parameter set to true to force your message to be added to the log file, even if debug mode is not enabled. Use this only for critical messages and warnings.

The post edd_debug_log first appeared on Easy Digital Downloads.

]]>
Easy Digital Downloads Quickstart Guide https://easydigitaldownloads.com/docs/quickstart-guide/ Tue, 14 Mar 2023 20:00:00 +0000 https://edd-site.lndo.site/docs/setting-up-your-first-edd-store/ Are you ready to install the Easy Digital Downloads plugin on your WordPress site? After you’ve purchased a license, the next step is to install the plugin so you can start creating your products and generating sales! In this step-by-step guide, we’ll walk you through how to install and activate the Easy Digital Downloads plugin.

The post Easy Digital Downloads Quickstart Guide first appeared on Easy Digital Downloads.

]]>
Are you ready to install the Easy Digital Downloads plugin on your WordPress site? After you’ve purchased a license, the next step is to install the plugin so you can start creating your products and generating sales!

In this step-by-step guide, we’ll walk you through how to install and activate the Easy Digital Downloads plugin.

Note: This tutorial is intended for brand new installs of Easy Digital Downloads (Pro). If you are upgrading from the free version of Easy Digital Downloads, please see our tutorial on how to upgrade to our paid plugin from EDD Lite for more details.


Downloading the Easy Digital Downloads (Pro) Plugin

To get started, first log in to your Easy Digital Downloads account. Once you’ve logged in, you’ll see your dashboard, and you link to download the Pro version.

This will show you a page with all of your available passes. To download the plugin, click on the Download Easy Digital Downloads (Pro) button next to one of your licenses. This will save a zipped file of the plugin to your computer.

Note: In some cases, this file may unzip as you download it, and instead appear as a regular folder. However, the folder must be zipped to use the WordPress plugin uploader. For more details on how to zip and unzip files, be sure to check out these guides for Windows and Mac operating systems.

For now, you don’t have to download any of the extensions, since you’ll be able to easily install and activate extensions from inside your WordPress dashboard later.

Installing Easy Digital Downloads on Your Site

Once you’ve downloaded your zip file, go ahead and navigate to the site where you’d like to install Easy Digital Downloads. Then, inside the admin dashboard, go to Plugins » Add New and click the Upload Plugin button.

Screenshot showing the "upload plugin" button

From here, you’ll see the option to upload the plugin. Click on the Choose File button and select the Easy Digital Downloads zip file you just downloaded.

Screenshot highlighting the choose file to upload a plugin

After your file is uploaded, click on the Install Now button.

This will begin the installation process for you. Once the plugin is installed, click on the Activate Plugin button to activate Easy Digital Downloads on your site.

After activating the plugin, be sure to activate your EDD (Pro) license key to receive automatic updates and plugin support. Adding your license key will also allow you to easily install and activate EDD extensions from inside your WordPress dashboard.

That’s it! Once installed and activated, you’ll be guided through our Setup Wizard which will have you up and running in a matter of minutes, so you can start selling your products today!

The post Easy Digital Downloads Quickstart Guide first appeared on Easy Digital Downloads.

]]>
Easy Digital Downloads Introduction https://easydigitaldownloads.com/docs/easy-digital-downloads-introduction/ Tue, 14 Mar 2023 18:59:00 +0000 https://edd-site.lndo.site/docs/easy-digital-downloads-introduction/ If you’re already generally familiar with eCommerce in WordPress then this document should help you get up to speed with Easy Digital Downloads quite quickly. Unless otherwise noted, everything in this document deals with core features. Easy Digital Downloads for Digital Media Easy Digital Downloads (EDD) was built from the ground up to sell downloads;

The post Easy Digital Downloads Introduction first appeared on Easy Digital Downloads.

]]>
If you’re already generally familiar with eCommerce in WordPress then this document should help you get up to speed with Easy Digital Downloads quite quickly. Unless otherwise noted, everything in this document deals with core features.

Easy Digital Downloads for Digital Media

Easy Digital Downloads (EDD) was built from the ground up to sell downloads; software, ebooks, music, etc. Options, features, and addons are built specifically to help you sell your digital products.

Easy Digital Downloads for physical products

EDD is designed for selling digital products, but if you wish to sell simple physical products, there is an extension for that. If you are selling advanced physical products, consider using an alternate eCommerce solution

Basic Terminology

To get a grasp on some of the terms used in Easy Digital Downloads, read through their descriptions here:

  • Downloads (or Products) – In various places these terms are used interchangeably. A download is a product. It is the ‘thing’ that is available for sale.
  • Payment  – A payment is typically recorded whenever money is paid (even if the amount is $0). A single payment can contain multiple different downloads (or products)
  • Sale – The term sale is only used in relation to a single product and is recorded when a payment is made that contains that product. For example, if a single payment contained 3 different products, each product has a sale recorded.
  • Customer – A customer profile is created when a payment is completed. Think of this as a place where all of a single person’s payments are listed together. It also holds some of their personal information – like the customer’s email addresses, their name, custom notes, and more.
  • User – Users are a part of WordPress core but Easy Digital Downloads makes use of them in connection to customers. Each customer can have a user attached to it. This is what allows a customer to log in to view their account. Each user has a username and password (whereas customers do not).
  • File Downloads – Each time a file is downloaded by one of your customers, a file download is recorded so you can track how many times a product (or download) is downloaded. This is found in various places including under Dashboard → Downloads → Reports → Logs → File Downloads.

Product Options

Here are some of the capabilities that products have:

  • Product Title
  • Product Description
  • Variable pricing
  • Easy uploading of media right on the product admin page
  • Custom notes that can be added to receipts
  • Single or bundled products
  • Categories
  • Tags
  • Download limits (how many times a buyer may download the item they purchased
  • On the admin page for each item, you can see sales and earnings data

Payment Gateways

EDD has many dozens of payment gateways available, from a variety of sources. Here are just a few of the common ones:

  • Stripe
  • PayPal
  • Authorize.net
  • Braintree

Please browse the links below to see if it supports the gateway you need.

Product Delivery

When a product is purchased the customer is presented with a purchase confirmation page. It contains details of the transaction as well as download link(s) so the customer may immediately download the product.

In addition, two emails are sent, one to the customer with a receipt and download link and one to the store owner with sale details.

Customer Email

This email functions as a receipt and contains BOTH financial details as well as a download link to the product(s) purchased.

Seller Email

This email alerts the store owner to a purchase and includes sale details.

Both of the above emails may be configured via the Downloads Settings area. This allows the store owner to decide how much detail is included in each.

Templates

WordPress has a standard convention for templates in plugins. A plugin may have its own set of templates in its own folder but may look first in the active theme folder for templates. EDD follows this standard and has a templates folder in

/wp-content/plugins/easy-digital-downloads/templates

These templates may be copied to a theme folder and placed in a folder called

/edd_templates

Then those templates get used by the theme rather than the EDD core templates.

Shortcodes

EDD has a number of shortcodes that are well documented.

Discounts

EDD has a built-in system for providing discount codes. They can:

  • be a percentage or flat rate
  • match product-specific requirements before taking effect
  • have an expiration date
  • have a limited number of total uses
  • be limited to one use per customer

Additionally, there are many Discount addons in the EDD store to enhance this functionality.

Reports

EDD offers reports in a number of formats. On the main reports page, there’s a chart showing earnings over time, with options for varying time spans.

Reports can also be exported in a variety of formats:

  • Sales and Earnings in PDF format
  • Sales and Earnings Stats in CSV
  • Payment History in CSV
  • Download History in CSV

There’s also a real-time log page listing:

  • File Downloads
  • Sales
  • Payment Errors
  • API Requests

Importing

EDD settings from another site may be imported, and Sales and Products may be imported with the EDD CSV Manager.

Exporting

As mentioned above, several different kinds of reports may be exported. Additionally, EDD settings, sales, and products may be exported with built-in tools under Downloads → Tools.

Miscellaneous

  • EDD supports discount codes.
  • Default styles can be disabled with a Settings switch, making it easier to use custom styles if you wish
  • EDD has flexible national, international, and local tax settings
  • There’s a TESTING switch, so you can safely process orders without actually having to move money around.
  • There’s a very extensive add-ons library

Easy Digital Downloads Server Requirements:

Click here to see the current server requirements and recommendations.

Note: We recommend you test all updates on a staging site before applying them to your live site.

The post Easy Digital Downloads Introduction first appeared on Easy Digital Downloads.

]]>
How to Upgrade from EDD Lite to Pro https://easydigitaldownloads.com/docs/go-lite-pro/ Tue, 14 Mar 2023 18:58:00 +0000 https://easydigitaldownloads.com/?post_type=edd_doc&p=1787459 Are you ready to upgrade from Easy Digital Downloads to the Pro version? Upgrading to Easy Digital Downloads (Pro) will give you access to more features and powerful extensions. In this tutorial, we’ll show you how to install EDD (Pro). Installing EDD (Pro) Automatically Once you’ve purchased a license, you can upgrade to EDD (Pro)

The post How to Upgrade from EDD Lite to Pro first appeared on Easy Digital Downloads.

]]>
Are you ready to upgrade from Easy Digital Downloads to the Pro version? Upgrading to Easy Digital Downloads (Pro) will give you access to more features and powerful extensions.

In this tutorial, we’ll show you how to install EDD (Pro).

  1. Install EDD (Pro)
  2. Activate Your License Key
  3. Installing EDD (Pro) Manually

Installing EDD (Pro) Automatically

Once you’ve purchased a license, you can upgrade to EDD (Pro) by adding your license to your download settings. This will install EDD (Pro) for you.

Activating Your License Key

Note: Activating your key is the same whether you have the free version of EDD or EDD Pro.

To start this process, you’ll need to log into your WordPress site. Then go to Downloads > Settings. On this screen, you’ll see a field for your license key.

To find your license key, log into your Easy Digital Downloads account in another browser tab or window. Your license key is listed with your pass on the main screen of your account:

Screenshot of a pass on the EDD site.

Copy the license key; paste it into the EDD settings and click the Verify License Key button.

To begin the installation process, you’ll need to click the Connect and Install Easy Digital Downloads (Pro) button.

Screenshow of the upgrade site which shows the explanation for and button to connect and install EDD (Pro).

Next, the pro plugin will be automatically installed for you (this may take a few moments). Once it’s all done, you’ll see a success message.

Note: If the automatic installation fails, your host may have restrictions that prevent it from running. You’ll need to manually install the paid version of the plugin instead.

After you click the OK button, you should be redirected back to the Easy Digital Downloads settings for your WordPress site. The pro version of EDD is all set and ready for you to use!

You should see that your license key has already been verified, and key license data will be displayed.

Updated license field showing expiration.

You can now Install Extensions directly from your WordPress site.

Additionally, you will no longer need to enter a license key for individual extensions covered by your pass; they’ll be covered by the license automatically.

Installing EDD (Pro) Manually

To get started, log into your EDD account. Just click on the Download Easy Digital Downloads (Pro) button next to your active pass. This will save a zipped file of the pro plugin to your computer.

Note: In some cases, this file may unzip as you download it, and instead appear as a regular folder. However, the folder must be zipped to use the WordPress plugin uploader.

For more details on how to zip and unzip files, be sure to check out these guides for Windows and Mac operating systems.

For now, you don’t have to download any extensions, since you’ll be able to easily install and activate extensions from inside your WordPress dashboard later.

Once you’ve downloaded your zip file, go ahead and navigate to the site where you’d like to install EDD (Pro). Then, inside the admin dashboard, go to Plugins > Add New (1) and click the Upload Plugin (2) button.

From here, you’ll see the option to upload the plugin. Click on the Choose File button and select the EDD (Pro) zip file you just downloaded. After your file is uploaded, click on the Install Now button.

This will begin the installation process for you. Once the plugin is installed, click on the Activate Plugin button to activate EDD (Pro) on your site.

After activating the plugin, be sure to activate your EDD (Pro) license key to receive automatic updates and plugin support. Adding your license key will also allow you to easily install and activate EDD extensions from inside your WordPress dashboard.

That’s it! You can now begin using EDD (Pro) on your WordPress site.

The post How to Upgrade from EDD Lite to Pro first appeared on Easy Digital Downloads.

]]>
How Do I Install an Extension https://easydigitaldownloads.com/docs/how-do-i-install-an-extension/ Tue, 14 Mar 2023 18:57:00 +0000 https://edd-site.lndo.site/docs/how-do-i-install-an-extension/ Would you like to access Easy Digital Downloads extensions to extend the functionality of your store? Each EDD pass level comes with its own set of extensions to help you get the most out of your forms. In this tutorial, we’ll show you how to install and activate addons in Easy Digital Downloads. Before getting

The post How Do I Install an Extension first appeared on Easy Digital Downloads.

]]>
Would you like to access Easy Digital Downloads extensions to extend the functionality of your store? Each EDD pass level comes with its own set of extensions to help you get the most out of your forms.

In this tutorial, we’ll show you how to install and activate addons in Easy Digital Downloads.

  1. Accessing the EDD Extensions Page
  2. Installing and Activating Extensions
  3. Frequently Asked Questions

Before getting started, you’ll first need to make sure that Easy Digital Downloads Pro is installed and activated on your WordPress site and that you’ve verified your license.

1. Accessing the Easy Digital Downloads Extensions Page

In your WordPress admin area, navigate to Downloads » Extensions to view the addons available with your license level.

If you don’t see any extensions for your license level, click on the Refresh Extensions button to force a refresh.

To search for a specific addon, you can type its name into the Search Extensions field located in the top-right corner of the page.

2. Installing and Activating Extensions

To install a specific extension to your site, simply click on the Install button.

This will automatically install and activate the extension for you. Any extension that’s installed and ready to use will show Activated.

Click the Gear Icon at the top-right of the extension box to open that extension’s settings.

You may deactivate an extension at any time by clicking on the switch next to Activated status. To reactivate an inactive addon, click on the switch next to the Deactivated status.

Frequently Asked Questions

These are some of the most common questions we see regarding installing and activating extensions in EDD.

How do I install extensions manually?

In some cases, you may see an error in EDD that says, “Could not install the extension.”

To do so, log in to your EDD account and go to the Account Dashboard (tab). On the page, you will have the Download Extensions link in the bottom section after your license details.

Then click Download Now for the extension you want to install.

Upload the downloaded .zip file to WordPress and activate it like you would a normal plugin. For more information on installing WordPress plugins, check out this WPBeginner tutorial on installing WordPress plugins.

That’s it! You can now install and activate your extensions.

Downloading Extension(s)

EDD’s paid extensions are not available via the WordPress.org Plugin Directory. They need to be downloaded from our site after you have made a successful purchase. There are several ways to access extension files:

  • Your email receipt will either have download links or instructions on how to access our site.
  • If you purchased a pass, you can access extensions via your account by following the steps above.
  • If you purchased extensions individually, you can access extensions via your account by going to the File Downloads tab.
After Installing

Once you’ve installed and activated your extension, there are several things you should do.

Activate Your License

If your extension has a license key you’ll want to go to
Downloads > Settings > Licenses and enter the key there. If the extension does not require a key, you can skip this step.

Read the Documentation

Each extension sold by Easy Digital Downloads comes with complete documentation. You can find all our documentation by going to https://easydigitaldownloads.com/docs.

The post How Do I Install an Extension first appeared on Easy Digital Downloads.

]]>
WordPress Blocks for Easy Digital Downloads https://easydigitaldownloads.com/docs/easy-digital-downloads-blocks/ Tue, 14 Mar 2023 18:56:00 +0000 https://easydigitaldownloads.com/?post_type=edd_doc&p=1777623 EDD Blocks are available in WordPress pages when using the block editor. They are intended to be a simple and improved alternative to their equivalent shortcode. Blocks are available to users running EDD 3.1 and WordPress 5.8 or higher. Note: EDD pages that require a shortcode can use the equivalent block in place of the

The post WordPress Blocks for Easy Digital Downloads first appeared on Easy Digital Downloads.

]]>
EDD Blocks are available in WordPress pages when using the block editor. They are intended to be a simple and improved alternative to their equivalent shortcode. Blocks are available to users running EDD 3.1 and WordPress 5.8 or higher.

Note: EDD pages that require a shortcode can use the equivalent block in place of the shortcode. Not all shortcodes have block equivalents.

EDD Buy Button

The EDD Buy Button is a simple block and adds a single purchase button for a specific download (will show price options for a variable download). It can be used anywhere.

EDD Cart (Widget)

The EDD Cart is intended to be used in the WordPress widgets, but can be used anywhere blocks are supported. The block can display as a mini cart (showing just quantity/total) or a detailed cart which resembles the cart on the checkout page.

Block Settings:

Mini Cart will present a cart icon, number of items and total. When disabled, a ful cart will be presented, listing added products and amounts.

Hide When Empty will hide this block if no items have been added to the cart.

Hide on Checkout will hide the block when visiting the checkout page.

Link Cart to Checkout will add a link to your checkout page.

Show Number of Items in Cart will present the number of items added to cart.

Show Cart Total will present the total cost of items in cart.

EDD Checkout

The checkout block is intended to be used on the Checkout page in place of the [download_checkout] shortcode. This has improved design over the shortcode and is aware if the user is logged in.

EDD Confirmation

This block is very similar to the receipt block but should not be used in its place, as it does not include details from subscription information, for example. This is an updated version of [edd_receipt] but only used on the order confirmation page. It cannot be used on the order receipt page (use the EDD Receipt block instead).

EDD Login

The EDD Login block allows you to add a login form to any page.

EDD Order History

The Order History block displays the purchase history which is intended to be used on a customer account page.

EDD User Downloads

The User Downloads block displays a list of files available to the customer for download. This block replaces the [download_history] shortcode. Available block settings:

Show a Search Form: When enabled, a search form will appear at the top of the block. This feature is only available for Easy Digital Downloads (Pro) users.
Show Product Variation: If your product variations have access to the same file(s), you may want to hide this.
Hide Products With No File: When enabled, products with no files will not appear in the list.

EDD Products

The EDD Products block displays your product(s) with rows and columns. It is a replacement for the [downloads] shortcode. There are a number of block settings available to customize how your products are laid out.

EDD Receipt

The receipt block is a detailed receipt and the order is similar to the shortcode, although all markup has been redone for improved responsiveness. It’s intended to be used on the “Receipt Page” (previously “Success Page”).

When viewing the receipt block as a user who is not logged in, you should experience one of two flows:

  • If the purchase does not have a user ID associated (it’s a guest purchase), you can enter the purchaser’s email address to confirm the order and can view all details.
  • If the purchase does have a user ID associated with it then you will get a login form.

EDD Registration

The EDD Registration block presents a WordPress user registration form.

EDD Download Terms (Categories / Tags)

The EDD Terms block displays download categories or tags. Visitors can click the Category / Tag name and view products within that term.

The post WordPress Blocks for Easy Digital Downloads first appeared on Easy Digital Downloads.

]]>
Payment Settings https://easydigitaldownloads.com/docs/payment-settings/ Tue, 14 Mar 2023 14:02:30 +0000 https://easydigitaldownloads.com/?post_type=edd_doc&p=1787540 The General Settings tab, located under Downloads > Settings > Payments, has these default sections; General, Checkout, Refunds, Accounting, PayPal, Invoices, Recurring Payments and Stripe. Additional Payment Gateways will appear if enabled. General Test Mode: While test mode is enabled, no live transactions are processed. Use test mode in conjunction with the sandbox/test account for the payment

The post Payment Settings first appeared on Easy Digital Downloads.

]]>
The General Settings tab, located under Downloads > Settings > Payments, has these default sections; General, Checkout, Refunds, Accounting, PayPal, Invoices, Recurring Payments and Stripe. Additional Payment Gateways will appear if enabled.

General

Test Mode: While test mode is enabled, no live transactions are processed. Use test mode in conjunction with the sandbox/test account for the payment gateways to test.

Active Gateways: Selected gateways will be available to customers on checkout.

Default Gateway: This gateway will be selected automatically on checkout.

Payment Method Icons: You can optionally show card icons on your checkout page.

Checkout

Enforce SSL on Checkout: Enable to redirect all customers to the secure checkout page. You must have an SSL certificate installed to use this option.

Redirect to Checkout: When enabled, once an item has been added to the cart, the customer will be redirected directly to your checkout page. This is useful for stores that sell single items.

Customer Registration: You may allow customers to place orders without a user account.
Setting this to auto will create a user account if one does not exist for a customer.
Dropdown options:
– Allow customers to place orders without an account: Customers will not be required to login or create a user account. If you display the registration fields on checkout, they will be optional, unless the customer is purchasing a subscription.
– Customers must log in or create an account to purchase: When this is selected, you’ll want to use the setting below to show Register and Login forms on checkout.
– Automatically register new user accounts: Registration fields will not appear on checkout and the customer will be automatically registered using their email address as their username. This was previously managed with the Auto Register extension.

Show Register / Login Form: Determine whether to display the registration and login forms on the checkout page for non-logged-in users.

Enable Cart Saving: Cart saving allows shoppers to create a temporary link to their current shopping cart so they can come back to it later, or share it with someone.

Banned Emails: Emails placed in the box above will not be allowed to make purchases. One per line, enter: email addresses, domains (@example.com), or TLDs (.gov).

Refunds

Default Status: Choose Refundable or Non-Refundable. This will be the store default for all products when they are created. It can be changed at a per-product level.

Refund Window: Number of days (after a sale) when refunds can be processed. Default is 30 days. Set to 0 for infinity. It can be changed at a per-product level.

Accounting

Enable SKU Entry: Check this box to allow entry of product SKUs in the Download Settings. SKUs will be shown on the purchase receipt and exported purchase histories.

Sequential Order Numbers: Check to enable sequential order numbers. Note: Enabling does not impact previous orders. Future orders will be sequential.

Sequential Starting Number: The number at which the sequence should begin.

Sequential Number Prefix: A prefix to prepend to all sequential order numbers.

Sequential Number Postfix: A postfix to append to all sequential order numbers.

PayPal

Click here to view PayPal settings.

Invoices

Click here to view Invoice settings.

Recurring Payments

Click here to view Recurring Payment settings.

Stripe

Click here to view Stripe settings.

Checkout Features

No settings exist for these checkout-related features but these are mentioned for documentation purposes.

Geolocation: EDD will attempt to populate the business address (City, State, Zipcode) based on the visitor’s IP address. If a customer is logged in and a primary address exists, the primary address will be used in place of the geolocation. This feature is only available for Easy Digital Downloads (Pro) users.

The post Payment Settings first appeared on Easy Digital Downloads.

]]>
Troubleshooting EDD 3.x Migration Issues https://easydigitaldownloads.com/docs/troubleshooting-30-migration/ Thu, 09 Mar 2023 17:38:58 +0000 https://easydigitaldownloads.com/?post_type=edd_doc&p=1787819 Although most stores will migrate from EDD 2.11 to 3.x without issue, if you migrate your data and discover that some orders appear to be missing, there are tools to help with trouble shooting. Before running any migration, make sure that your store data is backed up. It’s strongly recommended that you test the migration

The post Troubleshooting EDD 3.x Migration Issues first appeared on Easy Digital Downloads.

]]>
Although most stores will migrate from EDD 2.11 to 3.x without issue, if you migrate your data and discover that some orders appear to be missing, there are tools to help with trouble shooting.

Before running any migration, make sure that your store data is backed up. It’s strongly recommended that you test the migration on a local or staging copy of your site before doing it in production.

If you conclude that some orders are missing from the new tables, the first step is to figure out which. You’ll need to be able to look directly at your database tables using PHPMyAdmin or a similar tool. Hopefully you have an idea of what orders might be missing, either by knowing the specific ID or by knowing an approximate date range.

The first step is to look in your wp_posts table for the missing payments (in EDD 2.x, we use payments terminology; in EDD 3.x, they’re now orders). The post_type will be edd_payment and you need to find the ID(s) for the payment(s) which did not successfully migrate.

Once you’ve noted a payment ID, the next step is to look in the wp_edd_orders table for an order with that same ID. If it doesn’t exist, then migrating the missing order is fairly straightforward; if it does exist, you may have a conflict. You’ll want to look carefully at the order and see what the type is. Usually, what will have happened is that a refund record will have been created with the next available ID and that prevented the original payment from being able to migrate. If the order type is refund then this is very manageable, because the ID of the refund doesn’t actually matter.

Migrating Orders with CLI

Once you know the ID for a missing order, you’ll need to run a partial order migration. It’s helpful to start with making sure you know what all of the original payment data is. You can use this CLI command to view it:

wp edd display_legacy_payment_data 1234

Replace 1234 with the original payment ID that you found in the posts table. This will display everything that EDD knows about the original payment. This can be helpful because the data is stored differently in EDD 3.x.

The default order migration command is just this:

wp edd migrate_payments

With no options, it will run through every payment object and migrate it, finishing with marking the order migration complete and then recalculating the sales/earnings for all downloads in the store. Once EDD has marked the order migration complete, you need to add some flags to run another migration; otherwise, EDD will not do it.

This command accepts multiple flags which will change the behavior:

  • --force: This will force the migration to run again, even if it’s already been run. Existing orders will not be overwritten. A confirmation is required.
  • --destroy: This will force the migration to run again, even if it’s already been run. Existing orders/order meta/order items/etc which match a payment ID will be deleted and the payment will be migrated again. A confirmation is required, because this is a destructive action.
    • This option is helpful when refund orders have been inserted into the orders table in the place of an existing payment ID. Refunds will automatically be regenerated with the next available ID in the orders table.
    • If the existing order is not a refund and appears to be a different order entirely from the one you are trying to migrate, an additional confirmation is required, as that’s likely destroying data which will not be able to be recovered.
  • --id: This will run a partial migration on a specific payment ID (the ID in the WP posts table, which may be different from the displayed order number).
    • This flag cannot be used with the start/end flags.
    • It can be combined with force/destroy.
    • The order migration will not be marked complete.
  • --start: This will run a partial migration beginning with (and including) a specific payment ID.
    • This flag can be used with or without the end flag.
    • This flag cannot be used with the id flag.
    • It can be combined with force/destroy.
    • The order migration will not be marked complete.
  • --end: This will run a partial migration ending with (and including) a specific payment ID.
    • This flag can be used with or without the start flag.
    • This flag cannot be used with the id flag.
    • It can be combined with force/destroy.
    • The order migration will not be marked complete.

So if you want to test re-migrating an order, if you have confirmed that (this is most likely) the original payment has been “replaced” in the orders table by a refund, you can run this command:

wp edd migrate_payments --force --destroy --id=1234

Running this command will forcibly delete the order with an ID of 1234. Then it will migrate payment 1234 in its place. If the order 1234 was a refund, it will find the original order for that (let’s say it was order/payment 123), and then delete order 123 and run the migration for payment 123 again, which will regenerate the refund order object. The actual ID for any refund doesn’t mean anything so regenerating refunds is no big deal. Refunds are located by the parent column.

If You Downgraded to EDD 2.11 and Are Running the Migration Again

Because we can’t anticipate every scenario with integrations, EDD does allow stores to downgrade to EDD 2.11 and then come back to 3.x when ready. In these cases, we suggest that you empty the newly created tables and then run the migration as if it were the first time. You will likely need to use the CLI command to run the migration using --force since EDD may have already marked the migration complete.

Before emptying or deleting any database tables, make sure you have a full backup of your database. Practice a migration on a staging site before committing in production.

Here’s a list of tables that are newly created for EDD 3.x:

wp_customer_addresses
wp_customer_email_addresses
wp_adjustments
wp_adjustmentmeta
wp_notes
wp_notemeta
wp_orders
wp_ordermeta
wp_order_items
wp_order_itemmeta
wp_order_adjustments
wp_order_adjustmentmeta
wp_order_addresses
wp_order_transactions
wp_logs
wp_logmeta
wp_logs_api_requests
wp_logs_api_requestmeta
wp_logs_file_downloads
wp_logs_file_downloadmeta

The customers, customermeta, and notifications tables existed in EDD 2.x. Do not empty those. If you use an extension such as Commissions, Recurring Payments, or Software Licensing, those extensions also register custom tables with edd in the name and should not be emptied.

To migrate all store data, use this command (you may need to use the --force flag to allow it to run again):

wp edd v30_migration

The post Troubleshooting EDD 3.x Migration Issues first appeared on Easy Digital Downloads.

]]>
Customize Stripe Universal Payment Elements https://easydigitaldownloads.com/docs/customize-stripe-universal-payment-elements/ Thu, 02 Mar 2023 03:05:33 +0000 https://easydigitaldownloads.com/?post_type=edd_doc&p=1787363 Migrating to Payment Elements If you used our Stripe integration before the introduction of Payment Elements, we’ve given you temporary access to a setting called “Elements Mode” in Downloads > Settings > Payments > Stripe. Upon updating, your store will remain on Card Elements, and give you the ability to switch to Payment Elements only

The post Customize Stripe Universal Payment Elements first appeared on Easy Digital Downloads.

]]>
Migrating to Payment Elements

If you used our Stripe integration before the introduction of Payment Elements, we’ve given you temporary access to a setting called “Elements Mode” in Downloads > Settings > Payments > Stripe. Upon updating, your store will remain on Card Elements, and give you the ability to switch to Payment Elements only after you’ve confirmed your checkout works with it. Here are a couple of common customizations that you may need to change or remove to optimize your Payment Elements experience.

Change the ‘id’ attribute of the Elements target

Change the ‘id’ attribute of the Elements target
The Easy Digital Downloads ‘Card Elements’ integration required that there be a <div> tag with the id ‘edd-stripe-card-element’. It may look like this, in your customizations:

// Card Elements target div
<div id="edd-stripe-card-element" class="edd-stripe-card-element"></div>

The new Payment Elements uses a different ‘id’ attribute, so you need to change this line to:

// Payment Elements target div
<div id="edd-stripe-payment-element"></div>
<p class="edds-field-spacer-shim"></p>

Card Name field is no longer necessary

Thanks to the new Payment Element, the card name field is no longer required. If Stripe’s Payment Element detects that the chosen payment method requires a name, it will ask for one.

Script and styles concatenation plugins

If you were using a plugin or resource to join all Javascript files or CSS files, you will want to ensure that you ‘rebuild’ your scripts, as the Javascript and CSS Styling for the card elements has changed.

Caching plugins or services

Upon changing to the Payment Element, ensure that you flush any caches you may have, including page caching, object caching, and services like Cloudflare, to ensure that the proper Javascript and CSS files are being loaded.

Easy Digital Downloads — Stripe 2.9 adds support for Stripe’s Payment Element, which allow for an improved, more efficient, and more customizable checkout experience. This is available to users using our Stripe Pro Gateway, version 2.9 or greater. New users will automatically use payment elements; existing users who have connected to Stripe will be able to opt in when they are ready, allowing time to test any customizations you’ve made to your EDD Checkout in a local or staging environment. If you have customized your Checkout template, you will want to read more about migrating from the legacy Card Element to the Payment Element.

Filters for the payment elements are all in easy-digital-downloads/includes/gateways/stripe/includes/elements/payment-elements.php in EDD core, so look there for full code and links to specific Stripe documentation.

Register a Custom Font to Use with Stripe’s Payment Elements

You can set Stripe up to use a custom font, even from external font sources such as Google or Adobe Fonts, with two filters:

add_filter( 'edds_stripe_payment_elements_fonts', 'prefix_add_google_font_stripe' );
/**
 * Registers a custom CSS source file for Stripe to use to render custom fonts.
 *
 * @param array $fonts
 * @return array
 */
function prefix_add_google_font_stripe( $fonts ) {
	$fonts[] = array(
		'cssSrc' => 'https://fonts.googleapis.com/css2?family=Gajraj+One',
	);

	return $fonts;
}

add_filter( 'edds_stripe_payment_elements_variables', 'prefix_add_custom_font_stripe_variables' );
/**
 * Add a custom font to the Stripe variables.
 *
 * @param array $variables
 * @return array
 */
function prefix_add_custom_font_stripe_variables( $variables ) {
	$variables['fontFamily'] = 'Gajraj One';

	return $variables;
}

There are many different possible options to add to the variables to customize every aspect of the Stripe payment form. For example, the form labels can be floating in the form inputs, instead of above them, with this small filter:

add_filter( 'edds_stripe_payment_elements_label_style', 'prefix_modify_stripe_label_style' );
/**
 * Changes the Stripe label style to floating.
 *
 * @return string
 */
function prefix_modify_stripe_label_style() {
	return 'floating';
}

The post Customize Stripe Universal Payment Elements first appeared on Easy Digital Downloads.

]]>
Database Table Structures https://easydigitaldownloads.com/docs/database-table-structures/ Tue, 31 Jan 2023 19:03:42 +0000 https://easydigitaldownloads.com/?post_type=edd_doc&p=1785784 Easy Digital Downloads (3.0+) and it’s extensions take advantage of custom database tables to ensure that we can provide a scalable solution that offers complex reporting features. Below is a list of our custom database tables that we use and their schema. While we attempt to maintain this list, there may be slight differences as

The post Database Table Structures first appeared on Easy Digital Downloads.

]]>
Easy Digital Downloads (3.0+) and it’s extensions take advantage of custom database tables to ensure that we can provide a scalable solution that offers complex reporting features. Below is a list of our custom database tables that we use and their schema. While we attempt to maintain this list, there may be slight differences as we find improvements, and the most recent database table schema can always be found in EDD core’s codebase on GitHub.

All example tables here are prefixed with the standard wp_ table prefix. Your table prefix may be different.

Our ‘meta’ tables follow the standard format of the standard WordPress Meta table format, and consist of an ‘id’ column that is Auto Incremented, an ‘object ID’ column (the column name may differ depending on the object type), a meta key, and a meta value. The meta tables are registered with the WordPress Meta API for the object types.

Easy Digital Downloads Core


Order Data

These tables hold the transactional order data including the order overview, transaction IDs from the gateway, items ordered, any physical address information related to the order, and adjustments made to the order (IE: Taxes, discounts, fees)

wp_edd_orders

This table is the primary storage for an order record.

wp_edd_ordermeta

Holds any meta data about the order, so that developers can extend EDD.

wp_edd_order_transactions

This table contains a record of any transaction IDs from the payment gateway for safe keeping. Since an order can have multiple transaction IDs or have no Transaction ID at all, they are stored separate of the orders themselves.

wp_edd_order_items

This is the ‘cart details’ of an order, containing a list of downloads that were purchased.

wp_edd_order_itemmeta

If a developer needs to add specific items to the order item, it can be done here. Previously this would have been the ‘options’ array on the order item.

wp_edd_order_adjustments

Adjustments are anything non-product related that affect the contents. This means (but is not limited to) discounts used, taxes collected, or any fees associated with the order.

wp_edd_order_adjustmentmeta

Allowing developers to extend adjustments, this table contains the meta for the individual order adjustments.

wp_edd_order_addresses

As a customer may use different addresses for each order, we maintain a list of physical addresses used on each order, to aid in reporting. This can also be extended to add supplemental addresses (like shipping addresses) for extensions like ‘Simple Shipping’.


Notes

EDD uses a ‘notes’ concept to be able to store a thread of information about a specific object. For example, orders or customers. Notes are similar to WordPress comments, however, since notes are inherently not a public data set, we created a custom table for them, instead of including them as a custom comment type, in order to aid in front end performance.

wp_edd_notes

Many objects in EDD have notes, like customers and orders. This table holds the note information.

wp_edd_notemeta

If additional details need to be stored on a note, the meta table can be used.


Logs

As an eCommerce platform, we understand that keeping logs of events on your store is important. Logs can help you resolve customer issues, detect fraud, and provide evidence for things like disputes and customer support.

wp_edd_logs

This is the generic logging database table, which can be used to log any information necessary that does not have a specific table.

wp_edd_logmeta

Logs can contain meta to provide additional informaiton.

wp_edd_logs_file_downloads

This is the record of each file download that happens.

wp_edd_logs_file_downloadmeta

Any additional file download information can be saved in this meta table.

wp_edd_logs_api_reqeusts

This table holds a record of any API requests that have been made to the EDD REST API.

wp_edd_logs_api_requestsmeta

If any additional information is needed, it can be stored as meta.


Customers

EDD treats customers separate of WordPress users, as a store can allow guest purchases. The customer is our canonical reference point for who orders belong to.

wp_edd_customers

This table contains the main customer record.

wp_edd_customermeta

Any additional information about a customer that does not have a column can be saved as meta.

wp_edd_customer_email_addresses

As a customer may use different email addresses for subsequent purchases, we maintain a list of email addressers associated with each customer.

wp_edd_customer_addresses

As a customer may supply different physical addresses for each purchase, we also maintain a list of all physical addresses a customer uses and associate them with their customer ID.


Adjustments

In EDD, we treat any non-product modification to an order as an ‘adjustment’. This currently includes (but is not limited to, in the future) discounts codes (coupons) and tax rates.

wp_edd_adjustments

The primary table for adjustments.

wp_edd_adjustmentmeta

If any additional data is needed to be stored, meta can be used by developers.

The post Database Table Structures first appeared on Easy Digital Downloads.

]]>
Migrating to Easy Digital Downloads from Gumroad https://easydigitaldownloads.com/docs/migrating-to-easy-digital-downloads-from-gumroad/ Wed, 21 Dec 2022 21:51:26 +0000 https://easydigitaldownloads.com/?post_type=edd_doc&p=1783052 If you are looking to migrate your existing Gumroad products to WordPress, Easy Digital Downloads is a powerful and self-hosted way to continue selling your digital products without hosting it on someone else’s platform. In this article, we’re show you where to find common features from the Gumroad platform within Easy Digital Downloads so that

The post Migrating to Easy Digital Downloads from Gumroad first appeared on Easy Digital Downloads.

]]>
If you are looking to migrate your existing Gumroad products to WordPress, Easy Digital Downloads is a powerful and self-hosted way to continue selling your digital products without hosting it on someone else’s platform.

In this article, we’re show you where to find common features from the Gumroad platform within Easy Digital Downloads so that you can easily start selling your products yourself.

Gumroad Product Types

Easy Digital Downloads is perfect for selling all forms of digital products and services. Many of the custom product types offered on Gumroad can be created as a ‘Download’ by going to the Downloads section and clicking ‘Add New’.

Some of the product types that are available in Gumroad require features only available with the Pro version of Easy Digital Downloads.

Membership

The membership product type is equivalent to a Subscription in Easy Digital Downloads and requires the Recurring Payments feature. Additionally with the Content Restriction feature can be used to restrict your site content based on a user’s purchase history.

Both Recurring Payments and Content Restriction are available in the Extended Pass.

Physical Good

While Easy Digital Downloads is designed to sell digital products, we do recognize that you may want to offer a limited number of physical products. For that we have our Simple Shipping feature, which allows you to offer flat rate domestic and international shipping for these products.

Simple Shipping is available in the Professional Pass.

Creating your product

Nearly all of the features in Gumroad have a one-to-one matching feature in Easy Digital Downloads when creating your product. Below is a visual guide of where to insert specific Gumroad product settings into your Easy Digital Download product.

Discount codes

Easy Digital Downloads offers stand-alone discount code management. Discount codes are not tied to a single product and have advanced features to allow you to offer your customers discounts on all products, specific products, and even exclude products. They can also be set with features like:

  • Starting and Expiration dates.
  • Percentage or Flat Rate
  • Included and Excluded products
  • Single user per customer
  • Max uses
  • Maximum discount amount
  • Custom name (to make it easier to manage your discounts)

To create your discounts in Easy Digital Downloads, you can head to Downloads > Discounts > Add New. You can also read our full documentation on discount codes.

Accepting Payments

Easy Digital Downloads has partnered with Stripe and PayPal to offer you multiple ways to accept payments including Credit Cards, PayPal, Apple Pay, Google Pay, PayPal Credit, and many other available options. Once installed head to Downloads > Settings > Payments, and you can take payments with Stripe and PayPal with our one-click connection.

Additional Features

While we’ve covered the basic settings needed to create your products in Easy Digital Downloads, there are additional features that Easy Digital Downloads also offers. Below we’ve outlined these features, with the Easy Digital Downloads equivalent.

Gumroad FeatureEasy Digital Downloads Feature
Limit product salesPurchase Limit
Allow customers to choose quantityCart Item Quantities
Generate unique license keysSoftware Licensing
VersionsVariable Pricing
Allow customers to pay what they wantCustom Prices

Easy Digital Downloads is a fully self-hosted eCommerce Platform that you can add to your WordPress powered site. Self-hosted means that all your data is yours, and is stored on your server. Either way, if you already have a WordPress site or are ready to get started with a new WordPress site, head over to our getting started page, and you can start selling today.

The post Migrating to Easy Digital Downloads from Gumroad first appeared on Easy Digital Downloads.

]]>
Checkout Fields Manager – Conditional Logic https://easydigitaldownloads.com/docs/checkout-fields-manager-conditional-logic/ Wed, 17 Aug 2022 14:31:00 +0000 https://easydigitaldownloads.com/?post_type=edd_doc&p=1774622 Specific fields can be shown or hidden based on conditional logic rules either tied to the cart conditions or the user. Please review the Checkout Fields Manager Setup Documentation if you are configuring Checkout Fields Manager for the first time. Available conditional logic options: Field visibility You can choose to have the field show or

The post Checkout Fields Manager – Conditional Logic first appeared on Easy Digital Downloads.

]]>
Specific fields can be shown or hidden based on conditional logic rules either tied to the cart conditions or the user. Please review the Checkout Fields Manager Setup Documentation if you are configuring Checkout Fields Manager for the first time.

Available conditional logic options:

Field visibility

You can choose to have the field show or hide based on the conditions configured. Your options are:

  • Show the field
  • Hide the field

Condition requirements

Define the required conditions for your field’s visibility to be affected. Choose either:

  • Any – If any of the conditions are met.
  • All – All of the conditions defined need to be me.

Condition options

With the provided criteria you can configure Conditional Fields to show or hide based on the following conditions:

  • Number of items in cart
  • Cart subtotal (this is before discounts and taxes)
  • Cart total (this is after discounts but does not include taxes)
  • Downloads in cart or Downloads not in the cart
  • User is logged in or User is not logged in
  • Based on User Role where you then select the role for the condition.

Fields that support conditional logic

  • Action Hook
  • Checkbox
  • Country
  • Date
  • Email (does not include the required ‘User Email’ field)
  • File Upload
  • Hidden
  • HTML
  • Radio
  • Repeat
  • Section Break
  • Select
  • Terms
  • Text
  • Text Area
  • URL

Setup:

1. Add a new or expand an existing field that supports conditional logic.

2. To configure conditional logic for the field, check “Enable Conditional Logic” setting. When checked, additional options will appear.

3. Edit the Conditional Logic settings to determine what conditions will show or hide the field. Specify the conditional logic settings and rule(s). Add multiple rules for more specific conditions to apply to the fields logic.

conditional logic

The post Checkout Fields Manager – Conditional Logic first appeared on Easy Digital Downloads.

]]>
Do I need an SSL Certificate? https://easydigitaldownloads.com/docs/do-i-need-an-ssl-certificate/ Mon, 25 Jul 2022 22:35:48 +0000 https://easydigitaldownloads.com/?post_type=edd_doc&p=1773134 The short answer is yes. Web site encryption should be a required part of every eCommerce transaction for a wide variety of reasons, both technological and social. Let’s take a look at several. First, what is SSL? SSL is an encryption system that encrypts all the information between your customer and your web server. This

The post Do I need an SSL Certificate? first appeared on Easy Digital Downloads.

]]>
The short answer is yes. Web site encryption should be a required part of every eCommerce transaction for a wide variety of reasons, both technological and social. Let’s take a look at several.

First, what is SSL?

SSL is an encryption system that encrypts all the information between your customer and your web server. This makes it much safer for people to send sensitive information (like credit card info) to your server.

How do I know if I have it or not?

When SSL is working properly you’ll see a lock in your browser’s address bar:

Why do I need it?

  1. As mentioned above, it encrypts all the information between your end user and your server. Having someone get their identity stolen while using your site isn’t worth the headache.
  2. It’s required by some payment processors. See this article on WP Beginner.
  3. People won’t trust your site without it. People have been well trained to look for the lock in their browser, and won’t buy without it, even if you manage to find a way to not need it technologically.

What if I use PayPal, and people don’t pay on my site?

With the exception of PayPal Express, you do still need SSL. Full documentation regarding PayPal and SSL here.

Do I need SSL even while testing?

Yes.

The post Do I need an SSL Certificate? first appeared on Easy Digital Downloads.

]]>
Multi Currency https://easydigitaldownloads.com/docs/multi-currency/ Mon, 11 Jul 2022 21:33:38 +0000 https://beta.easydigitaldownloads.com/?post_type=edd_doc&p=1766029 1. Installation Once installed and activated, Multi Currency will be ready to be configured. Upgrading from Aelia Currency Switcher? If you are currently running the Aelia Currency Switcher plugin, we have made it easy to transition to our system. Our Multi Currency extension will migrate all of your Aelia currency settings. Important: You will need to

The post Multi Currency first appeared on Easy Digital Downloads.

]]>
1. Installation

Once installed and activated, Multi Currency will be ready to be configured.

Upgrading from Aelia Currency Switcher?

If you are currently running the Aelia Currency Switcher plugin, we have made it easy to transition to our system.

Our Multi Currency extension will migrate all of your Aelia currency settings.

Important: You will need to have the Multi Currency extension active before running the EDD 3.0 database migration. Additionally, the currency switcher widget will need to be manually changed to the new Multi Currency widget.

2. Settings

The settings for this plugin can be found under Downloads > Settings > Payments > Multi Currency.

Once you open the settings page the first thing you need to do is obtain an API key for the Exchange Rates provider. By default, the extension comes with an integration for openexchangerates.org.

Once you create an account with them please navigate to their Dashboard > App IDs page and in the Name field enter a name that will remind you what the key is for and click the Generate New App ID button.

With the App ID now generated you can copy that key from the page and return back to your EDD Multi Currency settings page.

At the bottom of that page, you can now paste the App ID that you copied from openexchangerates.org

If you wish for the extension to automatically update the rates daily so that you can always have the most accurate rates you can also check the Auto Update Exchange Rates box and then click Save Changes.

If you decide you don’t want to automatically update the rates you will have to open the Multi Currency settings page manually and click the Update Now button to get the latest rates.

Now it’s time to add another currency or more to your Easy Digital Downloads store. At the top of the page, we will be using the Add New Currency table to add a new currency.

In the Currency field select the currency that you wish to add and in the Gateways field select the payment gateways to which this currency applies. For this field, you will select all the active payment gateways that you use on the website.

Once the new Currency is added you can click the Update Now button at the bottom of the page and it will automatically update the exchange rate for all your added currencies.

If you wish to manually set your exchange rates you need to check the box Set the exchange rate manually for the Currency that you wish to manage.

Add in your Exchange Rate and Rate Markup values and then click the Update button.

Once the rate has been updated in the Exchange Rate field your store is ready to use it!

3. Displaying the Currency Switcher

The extension comes with a widget that you can add to your website so that customers can easily switch between different currencies.

To set this up, you’ll first need to go to the Dashboard > Appearance > Widgets page. Select the location where you wish the Currency options to show and search for the EDD Currency Selector widget.

Depending on where you are adding the widget the way it looks on your front-end of the website might be different. In the example below the Widget was added to the Sidebar and we currently have USD, EUR and GBP added.

Clicking on the different currencies will automatically reload the page with all the prices adjusted based on the exchange rates.

You can also create your currency change buttons/links manually. The way to do it is by setting the URL of the link/button to your website and passing the currency parameter.

https://yourstoreurl/?currency=EUR will load with prices changed to EUR
https://yourstoreurl/?currency=GBP will load with prices changed to GBP

You can use the examples above to change to any other currency that you have added to the Multi Currency extension beforehand.

This extension will convert the entire store the the currency that the customer chooses and that will be the currency that will be passed to the Payment Gateway for processing. You payment gateway account must be able to take payments in that currency.

When used with Recurring Payments the currency, amount and the exchange rate is recorded on the order. When a renewal payment comes in it will be displayed in the same currency as the initial order.

In viewing the reports, a store owner can view reports by individual currency (so in the amounts charged for each currency) or a combined/aggregate report for all orders in all currencies, converted to the store’s default currency. The reports would use the exchange rate stored with the order.

The post Multi Currency first appeared on Easy Digital Downloads.

]]>
eCommerce Analytics Tracking https://easydigitaldownloads.com/docs/ecommerce-analytics-tracking/ Mon, 11 Jul 2022 21:25:49 +0000 https://beta.easydigitaldownloads.com/?post_type=edd_doc&p=1766026 Google Analytics offers a powerful suite of tracking tools for eCommerce data that allows store owners to see revenue, sales funnels, and much more for their eCommerce store inside of their Google Analytics account. Enabling eCommerce tracking with Easy Digital Downloads can be done by installing MonsterInsights.  Once enabled, eCommerce data from Easy Digital Downloads

The post eCommerce Analytics Tracking first appeared on Easy Digital Downloads.

]]>
Google Analytics offers a powerful suite of tracking tools for eCommerce data that allows store owners to see revenue, sales funnels, and much more for their eCommerce store inside of their Google Analytics account.

Enabling eCommerce tracking with Easy Digital Downloads can be done by installing MonsterInsights

Once enabled, eCommerce data from Easy Digital Downloads will be sent into your Google Analytics account.

The post eCommerce Analytics Tracking first appeared on Easy Digital Downloads.

]]>
FAQs https://easydigitaldownloads.com/docs/faqs/ Fri, 08 Jul 2022 20:42:58 +0000 https://beta.easydigitaldownloads.com/?post_type=edd_doc&p=1765550 Oftentimes the receipt is the only place your customer keeps a link to the product they’ve downloaded. If they lose that receipt, or if it never gets through on the initial send, you’ll probably hear from them asking for a new copy. This document explains how to easily resend that to them. Under Downloads >

The post FAQs first appeared on Easy Digital Downloads.

]]>
Oftentimes the receipt is the only place your customer keeps a link to the product they’ve downloaded. If they lose that receipt, or if it never gets through on the initial send, you’ll probably hear from them asking for a new copy. This document explains how to easily resend that to them.

Under Downloads > Orders, on the list of orders, you may hover over a specific entry and get a link to resend the receipt.

Additionally, if you View Order Details, on the Edit page for a single order inside the
Order Details > Email section, you’ll find a button labeled Resend Receipt.

Additional Options

How do I filter products by category, tag, price, or other fields?

Easy Digital Downloads does not by default include filtering options for categories, tags, prices, or other product fields. There is, however, a great plugin called FacetWP that allows you to easily add this kind of filters to the [downloads] shortcode. See FacetWP’s video walkthrough for an example of how this can be done.

How can I resend the purchase receipt?

Oftentimes the receipt is the only place your customer keeps a link to the product they’ve downloaded. If they lose that receipt, or if it never gets through on the initial send, you’ll probably hear from them asking for a new copy. This document explains how to easily resend that to them.

Under Downloads > Orders, on the list of orders, you may hover over a specific entry and get a link to resend the receipt.

Additionally, if you View Order Details, on the Edit page for a single order inside the Order Details > Email section, you’ll find a button labeled Resend Receipt.

Additional Options

If your goal is to get the proper download link to a customer then you may want to create a page with the [purchase_history] shortcode on it. If your customer has an account on your site they will be able to log in and see all their purchased items and download them whenever they like, assuming your EDD settings allow them access.

How can I change the number of products shown on an archive page?

There are two different ways to accomplish this.

Change It Everywhere

If you’d like to make a global setting that affects ALL archive pages then you can use the “show at most” setting under WordPress’ Settings > Reading page.

This affects all archives on your entire site, including EDD Product archives, Blog archives, and any custom post archive you may have.

Change It In One Place

EDD provides a shortcode called [downloads] which renders a product archive and accepts a number for how many you’d like to show. Here’s a simple example:

[downloads number="15" columns="3"]

In-depth documentation on [downloads] is available here.

Can I add a custom field value to the Add Cart button?

At this time it’s not possible to add a custom field to the Add Cart button, neither on the single page nor the archive page.

Can Customers View Past Purchases?

Yes, you can create a customer account page by using the [purchase_history] shortcode that will display a list of a customer’s purchases when they are logged into their account. See our doc on how to setup the customer account page for more information.

Product Pages Show 404 Error.

To get rid of the 404 error when viewing a download, you need to re save your permalink structure. Go to Settings → Permalinks and click “Save Changes”. If re saving the permalink structure does not resolve the 404 errors, try deactivating all other plugins and switching to one of the default WordPress themes to determine if there is a conflict.

Are download files protected?

Yes, all files attached to Download products are protected from theft. When a file is uploaded to a Download product, it is automatically placed in a special folder on your server that is protected via a . htaccess file. This prevents a web browser from simply visiting the folder that holds your files and viewing them all.

How does the download work?

Easy Digital Downloads knows where the file is, and has permission to access it. The download link the customer receives goes to a special URL that does things like determine if the file is allowed to be accessed at all, fetch the file and send it to the browser, etc.

What about if it’s hosted someplace like Dropbox, or Amazon?

Easy Digital Downloads knows how to keep these files safe as well, using the same method as above. Setup information for Dropbox and Amazon.

What if my server isn’t using Apache?

Files are only protected by default on servers that use Apache. If your server is running something else you will need to take a look at protecting them through another means. Here are some articles to help with different server configurations known to need custom tweaking:

What about images and audio files?

Image files and Audio files (MP3/OGG) are 2 exceptions to the “protected” rule. They are left unprotected so that your visitors can actually see the images you upload – like your download’s featured image, or hear the preview audio you upload for an audio product. Because of this, it’s important to note that if you happen to be selling images or audio files, image files and audio files will not be protected even though they are in the protected directory. To fix this, we recommend that your actual deliverable files are compressed into a .zip file before uploading to your website. To read more about that, click here.

What is causing Your purchase session could not be retrieved error?

This can occur for a number of reasons but confirm that your Order Confirmation page is set and has the correct Block or shortcode. If you are using PayPal Standard, switch to PayPal. Otherwise, something else is interfering, such as another plugin, theme or caching. You can test this by disabling all plugins except EDD and see if the error still appears when making a test purchase.

Your checkout page is using the legacy shortcode.

We have blocks for many of our shortcodes, which have improved features. If possible, we recommend switching to the equivalent block but it’s not required and the shortcode still works if you can’t switch.

Error 101: Error 102: You don’t have permission to download this file

This is likely due to another plugin interfering with EDD. Please try deactivating all plugins except Easy Digital Downloads and the required extensions. Note, this could be caused by 3rd EDD extensions as well, make sure to disable those as well.

After downloading a purchased file, the file is corrupted or the zip file is empty

First, download the source file, as an admin and confirm the file is not corrupted and works as expected. If the file is corrupted or empty after downloading via EDD, it’s likely something external to EDD is interfering with the download process, likely another plugin or caching.

The post FAQs first appeared on Easy Digital Downloads.

]]>
Configuration for Lighttpd fastcgi-php.conf https://easydigitaldownloads.com/docs/configuration-for-lighttpd-fastcgi-php-conf/ Mon, 24 Jan 2022 20:00:19 +0000 https://edd-site.lndo.site/docs/configuration-for-lighttpd-fastcgi-php-conf/ When using Lighttpd as the server technology, it is necessary to ensure that your fastcgi-php.conf file is configured correctly, otherwise, you may experience problems with file downloads. In your fastcgi-php.conf file, ensure you have allow-x-send-file enabled, like so: "allow-x-send-file" => "enable" If you do not enable allow-x-send-file, you may get corrupted file downloads, as detailed in this support ticket.

The post Configuration for Lighttpd fastcgi-php.conf first appeared on Easy Digital Downloads.

]]>
When using Lighttpd as the server technology, it is necessary to ensure that your fastcgi-php.conf file is configured correctly, otherwise, you may experience problems with file downloads.

In your fastcgi-php.conf file, ensure you have allow-x-send-file enabled, like so:

"allow-x-send-file" => "enable"

If you do not enable allow-x-send-file, you may get corrupted file downloads, as detailed in this support ticket.

The post Configuration for Lighttpd fastcgi-php.conf first appeared on Easy Digital Downloads.

]]>
wp_ajax_nopriv_edd_remove_from_cart https://easydigitaldownloads.com/docs/wp_ajax_nopriv_edd_remove_from_cart/ Mon, 24 Jan 2022 20:00:11 +0000 https://edd-site.lndo.site/docs/wp_ajax_nopriv_edd_remove_from_cart/ This is the action that runs when a remove from cart request is processed via ajax from non-logg-in users.

The post wp_ajax_nopriv_edd_remove_from_cart first appeared on Easy Digital Downloads.

]]>
This is the action that runs when a remove from cart request is processed via ajax from non-logg-in users.

The post wp_ajax_nopriv_edd_remove_from_cart first appeared on Easy Digital Downloads.

]]>
edd_checkout_table_body_first https://easydigitaldownloads.com/docs/edd_checkout_table_body_first/ Mon, 24 Jan 2022 20:00:10 +0000 https://edd-site.lndo.site/docs/edd_checkout_table_body_first/ Runs just before the first cell in the checkout cart table body. Used for adding new columns to the checkout table.

The post edd_checkout_table_body_first first appeared on Easy Digital Downloads.

]]>
Runs just before the first cell in the checkout cart table body. Used for adding new columns to the checkout table.

The post edd_checkout_table_body_first first appeared on Easy Digital Downloads.

]]>
wp_ajax_edd_remove_from_cart https://easydigitaldownloads.com/docs/wp_ajax_edd_remove_from_cart/ Mon, 24 Jan 2022 20:00:09 +0000 https://edd-site.lndo.site/docs/wp_ajax_edd_remove_from_cart/ This is the action that runs when a remove from cart request is processed via ajax.

The post wp_ajax_edd_remove_from_cart first appeared on Easy Digital Downloads.

]]>
This is the action that runs when a remove from cart request is processed via ajax.

The post wp_ajax_edd_remove_from_cart first appeared on Easy Digital Downloads.

]]>
edd_cc_form_address_fields https://easydigitaldownloads.com/docs/edd_cc_form_address_fields/ Mon, 24 Jan 2022 20:00:08 +0000 https://edd-site.lndo.site/docs/edd_cc_form_address_fields/ This action runs just have the default credit card input fields and is used for loading the billing address fields. Not necessarily used by add-on gateways.

The post edd_cc_form_address_fields first appeared on Easy Digital Downloads.

]]>
This action runs just have the default credit card input fields and is used for loading the billing address fields. Not necessarily used by add-on gateways.

The post edd_cc_form_address_fields first appeared on Easy Digital Downloads.

]]>
wp_ajax_nopriv_edd_get_download_title https://easydigitaldownloads.com/docs/wp_ajax_nopriv_edd_get_download_title/ Mon, 24 Jan 2022 20:00:07 +0000 https://edd-site.lndo.site/docs/wp_ajax_nopriv_edd_get_download_title/ This action runs when the title of a downloadable product is requested by a non-logged-in user.

The post wp_ajax_nopriv_edd_get_download_title first appeared on Easy Digital Downloads.

]]>
This action runs when the title of a downloadable product is requested by a non-logged-in user.

The post wp_ajax_nopriv_edd_get_download_title first appeared on Easy Digital Downloads.

]]>
edd_pre_delete_discount https://easydigitaldownloads.com/docs/edd_pre_delete_discount/ Mon, 24 Jan 2022 20:00:06 +0000 https://edd-site.lndo.site/docs/edd_pre_delete_discount/ This action just before a discount code is deleted. It receives one parameters: `$discount_id`. do_action( 'edd_pre_delete_discount', $discount_id );

The post edd_pre_delete_discount first appeared on Easy Digital Downloads.

]]>
This action just before a discount code is deleted. It receives one parameters: `$discount_id`.

do_action( 'edd_pre_delete_discount', $discount_id );

The post edd_pre_delete_discount first appeared on Easy Digital Downloads.

]]>
edd_pre_delete_payment_note https://easydigitaldownloads.com/docs/edd_pre_delete_payment_note/ Mon, 24 Jan 2022 20:00:04 +0000 https://edd-site.lndo.site/docs/edd_pre_delete_payment_note/ This action runs just before a payment note is deleted. do_action( 'edd_pre_delete_payment_note', $note_id, $payment_id );

The post edd_pre_delete_payment_note first appeared on Easy Digital Downloads.

]]>
This action runs just before a payment note is deleted.

do_action( 'edd_pre_delete_payment_note', $note_id, $payment_id );

The post edd_pre_delete_payment_note first appeared on Easy Digital Downloads.

]]>
edd_before_cc_expiration https://easydigitaldownloads.com/docs/edd_before_cc_expiration/ Mon, 24 Jan 2022 20:00:02 +0000 https://edd-site.lndo.site/docs/edd_before_cc_expiration/ Runs just before the expiration fields are outputted for the default credit card form.

The post edd_before_cc_expiration first appeared on Easy Digital Downloads.

]]>
Runs just before the expiration fields are outputted for the default credit card form.

The post edd_before_cc_expiration first appeared on Easy Digital Downloads.

]]>
edd_pre_update_discount_status https://easydigitaldownloads.com/docs/edd_pre_update_discount_status/ Mon, 24 Jan 2022 20:00:01 +0000 https://edd-site.lndo.site/docs/edd_pre_update_discount_status/ This action just before the status of a discount code is changed. do_action( 'edd_pre_update_discount_status', $discount_id, $new_status, $old_status );

The post edd_pre_update_discount_status first appeared on Easy Digital Downloads.

]]>
This action just before the status of a discount code is changed.

do_action( 'edd_pre_update_discount_status', $discount_id, $new_status, $old_status );

The post edd_pre_update_discount_status first appeared on Easy Digital Downloads.

]]>
edd_checkout_table_footer_last https://easydigitaldownloads.com/docs/edd_checkout_table_footer_last/ Mon, 24 Jan 2022 20:00:00 +0000 https://edd-site.lndo.site/docs/edd_checkout_table_footer_last/ Runs just after the last cell in the checkout cart table footer. Designed for adding new columns to the checkout cart.

The post edd_checkout_table_footer_last first appeared on Easy Digital Downloads.

]]>
Runs just after the last cell in the checkout cart table footer. Designed for adding new columns to the checkout cart.

The post edd_checkout_table_footer_last first appeared on Easy Digital Downloads.

]]>
edd_checkout_table_body_last https://easydigitaldownloads.com/docs/edd_checkout_table_body_last/ Mon, 24 Jan 2022 19:59:58 +0000 https://edd-site.lndo.site/docs/edd_checkout_table_body_last/ Runs just after the last cell in the checkout cart table body. Designed for adding new columns to the checkout cart.

The post edd_checkout_table_body_last first appeared on Easy Digital Downloads.

]]>
Runs just after the last cell in the checkout cart table body. Designed for adding new columns to the checkout cart.

The post edd_checkout_table_body_last first appeared on Easy Digital Downloads.

]]>
edd_post_remove_cart_discount https://easydigitaldownloads.com/docs/edd_post_remove_cart_discount/ Mon, 24 Jan 2022 19:59:57 +0000 https://edd-site.lndo.site/docs/edd_post_remove_cart_discount/ This action just after a discount is removed from the shopping cart. do_action( 'edd_post_remove_cart_discount', $discount_id );

The post edd_post_remove_cart_discount first appeared on Easy Digital Downloads.

]]>
This action just after a discount is removed from the shopping cart.

do_action( 'edd_post_remove_cart_discount', $discount_id );

The post edd_post_remove_cart_discount first appeared on Easy Digital Downloads.

]]>
edd_api_output_before https://easydigitaldownloads.com/docs/edd_api_output_before/ Mon, 24 Jan 2022 19:59:56 +0000 https://edd-site.lndo.site/docs/edd_api_output_before/ This action runs just before the json/xml is printed to the screen when performing an EDD_API request. do_action( 'edd_api_output_before', $data, $api_object, $format );

The post edd_api_output_before first appeared on Easy Digital Downloads.

]]>
This action runs just before the json/xml is printed to the screen when performing an EDD_API request.

do_action( 'edd_api_output_before', $data, $api_object, $format );

The post edd_api_output_before first appeared on Easy Digital Downloads.

]]>
edd_after_price_options_list https://easydigitaldownloads.com/docs/edd_after_price_options_list/ Mon, 24 Jan 2022 19:59:54 +0000 https://edd-site.lndo.site/docs/edd_after_price_options_list/ This action runs at the end of the price options (inside of the UL tag) list for variable-price enabled Downloads. do_action( 'edd_after_price_options_list', $download_id, $prices, $type );

The post edd_after_price_options_list first appeared on Easy Digital Downloads.

]]>
This action runs at the end of the price options (inside of the UL tag) list for variable-price enabled Downloads.

do_action( 'edd_after_price_options_list', $download_id, $prices, $type );

The post edd_after_price_options_list first appeared on Easy Digital Downloads.

]]>
edd_after_price_options https://easydigitaldownloads.com/docs/edd_after_price_options/ Mon, 24 Jan 2022 19:59:52 +0000 https://edd-site.lndo.site/docs/edd_after_price_options/ This action runs after the closing DIV tag for the price options list for variable-price enabled Downloads. do_action( 'edd_after_price_options', $download_id );

The post edd_after_price_options first appeared on Easy Digital Downloads.

]]>
This action runs after the closing DIV tag for the price options list for variable-price enabled Downloads.

do_action( 'edd_after_price_options', $download_id );

The post edd_after_price_options first appeared on Easy Digital Downloads.

]]>
wp_ajax_nopriv_edd_apply_discount https://easydigitaldownloads.com/docs/wp_ajax_nopriv_edd_apply_discount/ Mon, 24 Jan 2022 19:59:51 +0000 https://edd-site.lndo.site/docs/wp_ajax_nopriv_edd_apply_discount/ This is the action that is run when the “Apply Discount” link is clicked from the checkout page by a non-logged-in-user.

The post wp_ajax_nopriv_edd_apply_discount first appeared on Easy Digital Downloads.

]]>
This is the action that is run when the “Apply Discount” link is clicked from the checkout page by a non-logged-in-user.

The post wp_ajax_nopriv_edd_apply_discount first appeared on Easy Digital Downloads.

]]>
edd_post_delete_payment_note https://easydigitaldownloads.com/docs/edd_post_delete_payment_note/ Mon, 24 Jan 2022 19:59:50 +0000 https://edd-site.lndo.site/docs/edd_post_delete_payment_note/ This action runs just after a payment note is deleted. do_action( 'edd_post_delete_payment_note', $note_id, $payment_id );

The post edd_post_delete_payment_note first appeared on Easy Digital Downloads.

]]>
This action runs just after a payment note is deleted.

do_action( 'edd_post_delete_payment_note', $note_id, $payment_id );

The post edd_post_delete_payment_note first appeared on Easy Digital Downloads.

]]>
edd_pre_update_discount https://easydigitaldownloads.com/docs/edd_pre_update_discount/ Mon, 24 Jan 2022 19:59:49 +0000 https://edd-site.lndo.site/docs/edd_pre_update_discount/ This action runs just before a discount code is updated. It receives two parameters, `$discount_details` and `$discount_id`. `$discount_details` is an array containing all fields for the discount, such as name, amount, type, etc. do_action( 'edd_pre_update_discount', $discount_details, $discount_id );

The post edd_pre_update_discount first appeared on Easy Digital Downloads.

]]>
This action runs just before a discount code is updated. It receives two parameters, `$discount_details` and `$discount_id`.

`$discount_details` is an array containing all fields for the discount, such as name, amount, type, etc.

do_action( 'edd_pre_update_discount', $discount_details, $discount_id );

The post edd_pre_update_discount first appeared on Easy Digital Downloads.

]]>
edd_post_update_discount_status https://easydigitaldownloads.com/docs/edd_post_update_discount_status/ Mon, 24 Jan 2022 19:59:48 +0000 https://edd-site.lndo.site/docs/edd_post_update_discount_status/ This action just after the status of a discount code is changed. do_action( 'edd_post_update_discount_status', $discount_id, $new_status, $old_status );

The post edd_post_update_discount_status first appeared on Easy Digital Downloads.

]]>
This action just after the status of a discount code is changed.

do_action( 'edd_post_update_discount_status', $discount_id, $new_status, $old_status );

The post edd_post_update_discount_status first appeared on Easy Digital Downloads.

]]>
edd_payment_deleted https://easydigitaldownloads.com/docs/edd_payment_deleted/ Mon, 24 Jan 2022 19:59:46 +0000 https://edd-site.lndo.site/docs/edd_payment_deleted/ This action runs just after a payment has been deleted. do_action( 'edd_payment_deleted', $payment_id );

The post edd_payment_deleted first appeared on Easy Digital Downloads.

]]>
This action runs just after a payment has been deleted.

do_action( 'edd_payment_deleted', $payment_id );

The post edd_payment_deleted first appeared on Easy Digital Downloads.

]]>
edd_payment_mode_before_gateways https://easydigitaldownloads.com/docs/edd_payment_mode_before_gateways/ Mon, 24 Jan 2022 19:59:45 +0000 https://edd-site.lndo.site/docs/edd_payment_mode_before_gateways/ Runs just before the payment mode select drop down. Only runs if at least two payment gateways are enabled.

The post edd_payment_mode_before_gateways first appeared on Easy Digital Downloads.

]]>
Runs just before the payment mode select drop down. Only runs if at least two payment gateways are enabled.

The post edd_payment_mode_before_gateways first appeared on Easy Digital Downloads.

]]>
edd_email_body_footer https://easydigitaldownloads.com/docs/edd_email_body_footer/ Mon, 24 Jan 2022 19:59:44 +0000 https://edd-site.lndo.site/docs/edd_email_body_footer/ This action runs at the bottom of the HTML email receipt sent to customers. The tag outputs just above the tag. do_action( 'edd_email_body_footer' );

The post edd_email_body_footer first appeared on Easy Digital Downloads.

]]>
This action runs at the bottom of the HTML email receipt sent to customers. The tag outputs just above the tag.

do_action( 'edd_email_body_footer' );

The post edd_email_body_footer first appeared on Easy Digital Downloads.

]]>
edd_payment_delete https://easydigitaldownloads.com/docs/edd_payment_delete/ Mon, 24 Jan 2022 19:59:43 +0000 https://edd-site.lndo.site/docs/edd_payment_delete/ This action runs just before a payment is deleted. do_action( 'edd_payment_delete', $payment_id );

The post edd_payment_delete first appeared on Easy Digital Downloads.

]]>
This action runs just before a payment is deleted.

do_action( 'edd_payment_delete', $payment_id );

The post edd_payment_delete first appeared on Easy Digital Downloads.

]]>
edd_admin_sale_notice https://easydigitaldownloads.com/docs/edd_admin_sale_notice/ Mon, 24 Jan 2022 19:59:41 +0000 https://edd-site.lndo.site/docs/edd_admin_sale_notice/ This action runs when the admin new sale alert is sent out. do_action( 'edd_admin_sale_notice', $payment_id, $payment_data );

The post edd_admin_sale_notice first appeared on Easy Digital Downloads.

]]>
This action runs when the admin new sale alert is sent out.

do_action( 'edd_admin_sale_notice', $payment_id, $payment_data );

The post edd_admin_sale_notice first appeared on Easy Digital Downloads.

]]>
edd_post_update_discount https://easydigitaldownloads.com/docs/edd_post_update_discount/ Mon, 24 Jan 2022 19:59:40 +0000 https://edd-site.lndo.site/docs/edd_post_update_discount/ This action runs after a discount code is updated. It receives two parameters, $discount_details and $id. $discount_details is an array containing all fields for the discount, such as name, amount, type, etc. do_action( 'edd_post_update_discount', $discount_details, $id );

The post edd_post_update_discount first appeared on Easy Digital Downloads.

]]>
This action runs after a discount code is updated. It receives two parameters, $discount_details and $id.

$discount_details is an array containing all fields for the discount, such as name, amount, type, etc.

do_action( 'edd_post_update_discount', $discount_details, $id );

The post edd_post_update_discount first appeared on Easy Digital Downloads.

]]>
edd_payment_mode_after_gateways https://easydigitaldownloads.com/docs/edd_payment_mode_after_gateways/ Mon, 24 Jan 2022 19:59:39 +0000 https://edd-site.lndo.site/docs/edd_payment_mode_after_gateways/ Runs just after the payment mode drop down. Only runs if at least two payment gateways are enabled.

The post edd_payment_mode_after_gateways first appeared on Easy Digital Downloads.

]]>
Runs just after the payment mode drop down. Only runs if at least two payment gateways are enabled.

The post edd_payment_mode_after_gateways first appeared on Easy Digital Downloads.

]]>
edd_update_edited_purchase https://easydigitaldownloads.com/docs/edd_update_edited_purchase/ Mon, 24 Jan 2022 19:59:38 +0000 https://edd-site.lndo.site/docs/edd_update_edited_purchase/ This action runs when a payment is edited from the admin screen. do_action( 'edd_update_edited_purchase', $payment_id );

The post edd_update_edited_purchase first appeared on Easy Digital Downloads.

]]>
This action runs when a payment is edited from the admin screen.

do_action( 'edd_update_edited_purchase', $payment_id );

The post edd_update_edited_purchase first appeared on Easy Digital Downloads.

]]>
edd_pre_update_log https://easydigitaldownloads.com/docs/edd_pre_update_log/ Mon, 24 Jan 2022 19:59:37 +0000 https://edd-site.lndo.site/docs/edd_pre_update_log/ This action runs just before a log entry is updated. do_action( 'edd_pre_update_log', $log_id, $log_data, $log_meta );

The post edd_pre_update_log first appeared on Easy Digital Downloads.

]]>
This action runs just before a log entry is updated.

do_action( 'edd_pre_update_log', $log_id, $log_data, $log_meta );

The post edd_pre_update_log first appeared on Easy Digital Downloads.

]]>
edd_pre_remove_cart_discount https://easydigitaldownloads.com/docs/edd_pre_remove_cart_discount/ Mon, 24 Jan 2022 19:59:36 +0000 https://edd-site.lndo.site/docs/edd_pre_remove_cart_discount/ This action just before a discount is removed from the shopping cart. do_action( 'edd_pre_remove_cart_discount', $discount_id );

The post edd_pre_remove_cart_discount first appeared on Easy Digital Downloads.

]]>
This action just before a discount is removed from the shopping cart.

do_action( 'edd_pre_remove_cart_discount', $discount_id );

The post edd_pre_remove_cart_discount first appeared on Easy Digital Downloads.

]]>
edd_pre_insert_log https://easydigitaldownloads.com/docs/edd_pre_insert_log/ Mon, 24 Jan 2022 19:59:35 +0000 https://edd-site.lndo.site/docs/edd_pre_insert_log/ This action runs just before a log entry is recorded. do_action( 'edd_pre_insert_log', $log_data, $log_meta );

The post edd_pre_insert_log first appeared on Easy Digital Downloads.

]]>
This action runs just before a log entry is recorded.

do_action( 'edd_pre_insert_log', $log_data, $log_meta );

The post edd_pre_insert_log first appeared on Easy Digital Downloads.

]]>
edd_checkout_table_header_last https://easydigitaldownloads.com/docs/edd_checkout_table_header_last/ Mon, 24 Jan 2022 19:59:34 +0000 https://edd-site.lndo.site/docs/edd_checkout_table_header_last/ Runs at the end of the checkout cart table header cells. Designed for adding new checkout table columns at the end of the table.

The post edd_checkout_table_header_last first appeared on Easy Digital Downloads.

]]>
Runs at the end of the checkout cart table header cells. Designed for adding new checkout table columns at the end of the table.

The post edd_checkout_table_header_last first appeared on Easy Digital Downloads.

]]>
edd_before_price_options https://easydigitaldownloads.com/docs/edd_before_price_options/ Mon, 24 Jan 2022 19:59:33 +0000 https://edd-site.lndo.site/docs/edd_before_price_options/ This action runs just after the price options are outputted for variable-price enabled Downloads. do_action( 'edd_before_price_options', $download_id );

The post edd_before_price_options first appeared on Easy Digital Downloads.

]]>
This action runs just after the price options are outputted for variable-price enabled Downloads.

do_action( 'edd_before_price_options', $download_id );

The post edd_before_price_options first appeared on Easy Digital Downloads.

]]>
edd_post_delete_discount https://easydigitaldownloads.com/docs/edd_post_delete_discount/ Mon, 24 Jan 2022 19:59:32 +0000 https://edd-site.lndo.site/docs/edd_post_delete_discount/ This action just after a discount code is deleted. It receives one parameters: `$discount_id`. do_action( 'edd_post_delete_discount', $discount_id );

The post edd_post_delete_discount first appeared on Easy Digital Downloads.

]]>
This action just after a discount code is deleted. It receives one parameters: `$discount_id`.

do_action( 'edd_post_delete_discount', $discount_id );

The post edd_post_delete_discount first appeared on Easy Digital Downloads.

]]>
edd_payment_mode_bottom https://easydigitaldownloads.com/docs/edd_payment_mode_bottom/ Mon, 24 Jan 2022 19:59:31 +0000 https://edd-site.lndo.site/docs/edd_payment_mode_bottom/ Runs just after the payment mode selection form. Only runs if at least two payment gateways are enabled.

The post edd_payment_mode_bottom first appeared on Easy Digital Downloads.

]]>
Runs just after the payment mode selection form. Only runs if at least two payment gateways are enabled.

The post edd_payment_mode_bottom first appeared on Easy Digital Downloads.

]]>
edd_checkout_table_footer_first https://easydigitaldownloads.com/docs/edd_checkout_table_footer_first/ Mon, 24 Jan 2022 19:59:30 +0000 https://edd-site.lndo.site/docs/edd_checkout_table_footer_first/ Runs just before the first cell of the checkout cart table footer. Designed for adding new columns to the checkout cart.

The post edd_checkout_table_footer_first first appeared on Easy Digital Downloads.

]]>
Runs just before the first cell of the checkout cart table footer. Designed for adding new columns to the checkout cart.

The post edd_checkout_table_footer_first first appeared on Easy Digital Downloads.

]]>
edd_cc_form https://easydigitaldownloads.com/docs/edd_cc_form/ Mon, 24 Jan 2022 19:59:29 +0000 https://edd-site.lndo.site/docs/edd_cc_form/ Loads the default credit card checkout fields. This action is overwritten by the “edd_{gateway ID}_cc_form” action (if registered).

The post edd_cc_form first appeared on Easy Digital Downloads.

]]>
Loads the default credit card checkout fields. This action is overwritten by the “edd_{gateway ID}_cc_form” action (if registered).

The post edd_cc_form first appeared on Easy Digital Downloads.

]]>
edd_checkout_login_fields_before https://easydigitaldownloads.com/docs/edd_checkout_login_fields_before/ Mon, 24 Jan 2022 19:59:28 +0000 https://edd-site.lndo.site/docs/edd_checkout_login_fields_before/ This action runs at the top of the checkout login fields and can be used for adding additional fields to the login form.

The post edd_checkout_login_fields_before first appeared on Easy Digital Downloads.

]]>
This action runs at the top of the checkout login fields and can be used for adding additional fields to the login form.

The post edd_checkout_login_fields_before first appeared on Easy Digital Downloads.

]]>
wp_ajax_nopriv_edd_add_to_cart https://easydigitaldownloads.com/docs/wp_ajax_nopriv_edd_add_to_cart/ Mon, 24 Jan 2022 19:59:27 +0000 https://edd-site.lndo.site/docs/wp_ajax_nopriv_edd_add_to_cart/ This is the action that is run when an item is added to the cart by a non-logged-in user.

The post wp_ajax_nopriv_edd_add_to_cart first appeared on Easy Digital Downloads.

]]>
This is the action that is run when an item is added to the cart by a non-logged-in user.

The post wp_ajax_nopriv_edd_add_to_cart first appeared on Easy Digital Downloads.

]]>
edd_after_download_content https://easydigitaldownloads.com/docs/edd_after_download_content/ Mon, 24 Jan 2022 19:59:26 +0000 https://edd-site.lndo.site/docs/edd_after_download_content/ This action runs just after the content for a single download is displayed. Usually this happens in single.php or single-download.php. This action is primarily for adding extra content to the bottom of download content, most likely in scenarios where you are unable to modify the template files, or do not have a single-download.php. The download

The post edd_after_download_content first appeared on Easy Digital Downloads.

]]>
This action runs just after the content for a single download is displayed. Usually this happens in single.php or single-download.php.

This action is primarily for adding extra content to the bottom of download content, most likely in scenarios where you are unable to modify the template files, or do not have a single-download.php.

The download ID is passed as a parameter.

The post edd_after_download_content first appeared on Easy Digital Downloads.

]]>
wp_ajax_nopriv_checkout_register https://easydigitaldownloads.com/docs/wp_ajax_nopriv_checkout_register/ Mon, 24 Jan 2022 19:59:25 +0000 https://edd-site.lndo.site/docs/wp_ajax_nopriv_checkout_register/ This action runs when the checkout registration fields are requested via ajax. Only runs for non-logged-in users.

The post wp_ajax_nopriv_checkout_register first appeared on Easy Digital Downloads.

]]>
This action runs when the checkout registration fields are requested via ajax. Only runs for non-logged-in users.

The post wp_ajax_nopriv_checkout_register first appeared on Easy Digital Downloads.

]]>
wp_ajax_nopriv_checkout_login https://easydigitaldownloads.com/docs/wp_ajax_nopriv_checkout_login/ Mon, 24 Jan 2022 19:59:24 +0000 https://edd-site.lndo.site/docs/wp_ajax_nopriv_checkout_login/ This is the action that is run when the checkout login fields are requested via ajax. Is only used for non-logged-in users.

The post wp_ajax_nopriv_checkout_login first appeared on Easy Digital Downloads.

]]>
This is the action that is run when the checkout login fields are requested via ajax. Is only used for non-logged-in users.

The post wp_ajax_nopriv_checkout_login first appeared on Easy Digital Downloads.

]]>
edd_post_insert_log https://easydigitaldownloads.com/docs/edd_post_insert_log/ Mon, 24 Jan 2022 19:59:23 +0000 https://edd-site.lndo.site/docs/edd_post_insert_log/ This action runs just after a log entry is recorded. do_action( 'edd_post_insert_log', $log_id, $log_data, $log_meta );

The post edd_post_insert_log first appeared on Easy Digital Downloads.

]]>
This action runs just after a log entry is recorded.

do_action( 'edd_post_insert_log', $log_id, $log_data, $log_meta );

The post edd_post_insert_log first appeared on Easy Digital Downloads.

]]>
edd_email_body_header https://easydigitaldownloads.com/docs/edd_email_body_header/ Mon, 24 Jan 2022 19:59:22 +0000 https://edd-site.lndo.site/docs/edd_email_body_header/ This action runs at the top of the HTML email receipt sent to customers. The tag outputs just below the tag. do_action( 'edd_email_body_header' );

The post edd_email_body_header first appeared on Easy Digital Downloads.

]]>
This action runs at the top of the HTML email receipt sent to customers. The tag outputs just below the tag.

do_action( 'edd_email_body_header' );

The post edd_email_body_header first appeared on Easy Digital Downloads.

]]>
edd_post_update_log https://easydigitaldownloads.com/docs/edd_post_update_log/ Mon, 24 Jan 2022 19:59:21 +0000 https://edd-site.lndo.site/docs/edd_post_update_log/ This action runs just after a log entry is updated. do_action( 'edd_post_update_log', $log_id, $log_data, $log_meta );

The post edd_post_update_log first appeared on Easy Digital Downloads.

]]>
This action runs just after a log entry is updated.

do_action( 'edd_post_update_log', $log_id, $log_data, $log_meta );

The post edd_post_update_log first appeared on Easy Digital Downloads.

]]>
edd_render_receipt_in_browser_after https://easydigitaldownloads.com/docs/edd_render_receipt_in_browser_after/ Mon, 24 Jan 2022 19:59:19 +0000 https://edd-site.lndo.site/docs/edd_render_receipt_in_browser_after/ This action runs at the bottom of the in-browser purchase receipt. do_action( 'edd_render_receipt_in_browser_after' );

The post edd_render_receipt_in_browser_after first appeared on Easy Digital Downloads.

]]>
This action runs at the bottom of the in-browser purchase receipt.

do_action( 'edd_render_receipt_in_browser_after' );

The post edd_render_receipt_in_browser_after first appeared on Easy Digital Downloads.

]]>
edd_purchase_form_login_fields https://easydigitaldownloads.com/docs/edd_purchase_form_login_fields/ Mon, 24 Jan 2022 19:59:17 +0000 https://edd-site.lndo.site/docs/edd_purchase_form_login_fields/ This action runs at the bottom of the checkout login fields and can be used for adding additional fields to the login form. This action has been deprecated in version 1.0.8.6. Please use edd_checkout_login_fields_after instead.

The post edd_purchase_form_login_fields first appeared on Easy Digital Downloads.

]]>
This action runs at the bottom of the checkout login fields and can be used for adding additional fields to the login form.

This action has been deprecated in version 1.0.8.6. Please use edd_checkout_login_fields_after instead.

The post edd_purchase_form_login_fields first appeared on Easy Digital Downloads.

]]>
edd_before_cc_fields https://easydigitaldownloads.com/docs/edd_before_cc_fields/ Mon, 24 Jan 2022 19:59:16 +0000 https://edd-site.lndo.site/docs/edd_before_cc_fields/ This action runs just before the “edd_cc_fields” fieldset, which contains the default credit card fields.

The post edd_before_cc_fields first appeared on Easy Digital Downloads.

]]>
This action runs just before the “edd_cc_fields” fieldset, which contains the default credit card fields.

The post edd_before_cc_fields first appeared on Easy Digital Downloads.

]]>
edd_after_cart https://easydigitaldownloads.com/docs/edd_after_cart/ Mon, 24 Jan 2022 19:59:15 +0000 https://edd-site.lndo.site/docs/edd_after_cart/ Runs after the shopping cart HTML for the widget, shortcode, and template tag shopping cart. Does not run on the checkout cart.

The post edd_after_cart first appeared on Easy Digital Downloads.

]]>
Runs after the shopping cart HTML for the widget, shortcode, and template tag shopping cart. Does not run on the checkout cart.

The post edd_after_cart first appeared on Easy Digital Downloads.

]]>
edd_purchase_form_top https://easydigitaldownloads.com/docs/edd_purchase_form_top/ Mon, 24 Jan 2022 19:59:14 +0000 https://edd-site.lndo.site/docs/edd_purchase_form_top/ Runs just after the purchase form HTML tag is opened and before any of the input fields.

The post edd_purchase_form_top first appeared on Easy Digital Downloads.

]]>
Runs just after the purchase form HTML tag is opened and before any of the input fields.

The post edd_purchase_form_top first appeared on Easy Digital Downloads.

]]>
edd_checkout_login_fields_after https://easydigitaldownloads.com/docs/edd_checkout_login_fields_after/ Mon, 24 Jan 2022 19:59:12 +0000 https://edd-site.lndo.site/docs/edd_checkout_login_fields_after/ This action runs at the bottom of the checkout login fields and can be used for adding additional fields to the login form.

The post edd_checkout_login_fields_after first appeared on Easy Digital Downloads.

]]>
This action runs at the bottom of the checkout login fields and can be used for adding additional fields to the login form.

The post edd_checkout_login_fields_after first appeared on Easy Digital Downloads.

]]>
edd_process_verified_download https://easydigitaldownloads.com/docs/edd_process_verified_download/ Mon, 24 Jan 2022 19:59:11 +0000 https://edd-site.lndo.site/docs/edd_process_verified_download/ This action runs during the file download process, just after the purchase has been verified but before any headers are sent. do_action( 'edd_process_verified_download', $download_id, $email );

The post edd_process_verified_download first appeared on Easy Digital Downloads.

]]>
This action runs during the file download process, just after the purchase has been verified but before any headers are sent.

do_action( 'edd_process_verified_download', $download_id, $email );

The post edd_process_verified_download first appeared on Easy Digital Downloads.

]]>
edd_checkout_table_header_first https://easydigitaldownloads.com/docs/edd_checkout_table_header_first/ Mon, 24 Jan 2022 19:59:09 +0000 https://edd-site.lndo.site/docs/edd_checkout_table_header_first/ Runs just before the first header cell in the checkout cart. This hooks is primarily for adding new columns to the checkout cart.

The post edd_checkout_table_header_first first appeared on Easy Digital Downloads.

]]>
Runs just before the first header cell in the checkout cart. This hooks is primarily for adding new columns to the checkout cart.

The post edd_checkout_table_header_first first appeared on Easy Digital Downloads.

]]>
edd_{payment gateway ID}_cc_form https://easydigitaldownloads.com/docs/edd_payment-gateway-id_cc_form/ Mon, 24 Jan 2022 19:59:08 +0000 https://edd-site.lndo.site/docs/edd_payment-gateway-id_cc_form/ Runs when a payment mode is selected and is used for loading gateway-specific checkout fields. If the action does not exist, then the default “edd_cc_form” action is run, which loads the default credit card fields.

The post edd_{payment gateway ID}_cc_form first appeared on Easy Digital Downloads.

]]>
Runs when a payment mode is selected and is used for loading gateway-specific checkout fields. If the action does not exist, then the default “edd_cc_form” action is run, which loads the default credit card fields.

The post edd_{payment gateway ID}_cc_form first appeared on Easy Digital Downloads.

]]>
edd_before_payment_status_change https://easydigitaldownloads.com/docs/edd_before_payment_status_change/ Mon, 24 Jan 2022 19:59:06 +0000 https://edd-site.lndo.site/docs/edd_before_payment_status_change/ This action runs just before a payment status is updated. do_action( 'edd_before_payment_status_change', $payment_id, $new_status, $old_status );

The post edd_before_payment_status_change first appeared on Easy Digital Downloads.

]]>
This action runs just before a payment status is updated.

do_action( 'edd_before_payment_status_change', $payment_id, $new_status, $old_status );

The post edd_before_payment_status_change first appeared on Easy Digital Downloads.

]]>
edd_post_insert_discount https://easydigitaldownloads.com/docs/edd_post_insert_discount/ Mon, 24 Jan 2022 19:59:05 +0000 https://edd-site.lndo.site/docs/edd_post_insert_discount/ This action runs after a discount code is created. It receives two parameters: `$discount_details` and `$discount_id`. $discount_details is an array containing all fields for the discount, such as name, type, amount, etc. do_action( 'edd_post_insert_discount', $discount_details, $discount_id );

The post edd_post_insert_discount first appeared on Easy Digital Downloads.

]]>
This action runs after a discount code is created. It receives two parameters: `$discount_details` and `$discount_id`.

$discount_details is an array containing all fields for the discount, such as name, type, amount, etc.

do_action( 'edd_post_insert_discount', $discount_details, $discount_id );

The post edd_post_insert_discount first appeared on Easy Digital Downloads.

]]>
edd_purchase_form_before_submit https://easydigitaldownloads.com/docs/edd_purchase_form_before_submit/ Mon, 24 Jan 2022 19:59:03 +0000 https://edd-site.lndo.site/docs/edd_purchase_form_before_submit/ This action runs at the top of the “edd_purchase_submit” fieldset and just before the purchase submit button.

The post edd_purchase_form_before_submit first appeared on Easy Digital Downloads.

]]>
This action runs at the top of the “edd_purchase_submit” fieldset and just before the purchase submit button.

The post edd_purchase_form_before_submit first appeared on Easy Digital Downloads.

]]>
edd_after_checkout_cart https://easydigitaldownloads.com/docs/edd_after_checkout_cart/ Mon, 24 Jan 2022 19:59:02 +0000 https://edd-site.lndo.site/docs/edd_after_checkout_cart/ Runs after the checkout cart table.

The post edd_after_checkout_cart first appeared on Easy Digital Downloads.

]]>
Runs after the checkout cart table.

The post edd_after_checkout_cart first appeared on Easy Digital Downloads.

]]>
edd_remove https://easydigitaldownloads.com/docs/edd_remove/ Mon, 24 Jan 2022 19:59:00 +0000 https://edd-site.lndo.site/docs/edd_remove/ This action runs when an item is removed from the cart. Does not run when using ajax to remove items.

The post edd_remove first appeared on Easy Digital Downloads.

]]>
This action runs when an item is removed from the cart. Does not run when using ajax to remove items.

The post edd_remove first appeared on Easy Digital Downloads.

]]>
edd_purchase_form_bottom https://easydigitaldownloads.com/docs/edd_purchase_form_bottom/ Mon, 24 Jan 2022 19:58:59 +0000 https://edd-site.lndo.site/docs/edd_purchase_form_bottom/ This action runs at the bottom of the purchase form, just before the closing tag.

The post edd_purchase_form_bottom first appeared on Easy Digital Downloads.

]]>
This action runs at the bottom of the purchase form, just before the closing

tag.

The post edd_purchase_form_bottom first appeared on Easy Digital Downloads.

]]>
wp_ajax_edd_get_download_title https://easydigitaldownloads.com/docs/wp_ajax_edd_get_download_title/ Mon, 24 Jan 2022 19:58:58 +0000 https://edd-site.lndo.site/docs/wp_ajax_edd_get_download_title/ This action runs when the title of a downloadable product is requested via ajax.

The post wp_ajax_edd_get_download_title first appeared on Easy Digital Downloads.

]]>
This action runs when the title of a downloadable product is requested via ajax.

The post wp_ajax_edd_get_download_title first appeared on Easy Digital Downloads.

]]>
edd_email_default_content_type https://easydigitaldownloads.com/docs/edd_email_default_content_type/ Mon, 24 Jan 2022 19:58:57 +0000 https://edd-site.lndo.site/docs/edd_email_default_content_type/ The edd_email_default_content_type filter is applied to the content-type header for all emails sent through Easy Digital Downloads. It receives two parameters: $content_type – The default content type to be used if one is not specified. Defaults to text/html $emails_object – The current instance of the EDD_Emails class

The post edd_email_default_content_type first appeared on Easy Digital Downloads.

]]>
The edd_email_default_content_type filter is applied to the content-type header for all emails sent through Easy Digital Downloads. It receives two parameters:

  • $content_type – The default content type to be used if one is not specified. Defaults to text/html
  • $emails_object – The current instance of the EDD_Emails class

The post edd_email_default_content_type first appeared on Easy Digital Downloads.

]]>
edd_email_content_type https://easydigitaldownloads.com/docs/edd_email_content_type/ Mon, 24 Jan 2022 19:58:56 +0000 https://edd-site.lndo.site/docs/edd_email_content_type/ The edd_email_content_type filter is applied to the content-type header for all emails sent through Easy Digital Downloads. It receives two parameters: $content_type – The content type to be used if one is not specified. Defaults to text/html $emails_object – The current instance of the EDD_Emails class

The post edd_email_content_type first appeared on Easy Digital Downloads.

]]>
The edd_email_content_type filter is applied to the content-type header for all emails sent through Easy Digital Downloads. It receives two parameters:

  • $content_type – The content type to be used if one is not specified. Defaults to text/html
  • $emails_object – The current instance of the EDD_Emails class

The post edd_email_content_type first appeared on Easy Digital Downloads.

]]>
wp_ajax_edd_apply_discount https://easydigitaldownloads.com/docs/wp_ajax_edd_apply_discount/ Mon, 24 Jan 2022 19:58:55 +0000 https://edd-site.lndo.site/docs/wp_ajax_edd_apply_discount/ This is the action that is run when the “Apply Discount” link is clicked from the checkout page by a logged-in-user.

The post wp_ajax_edd_apply_discount first appeared on Easy Digital Downloads.

]]>
This is the action that is run when the “Apply Discount” link is clicked from the checkout page by a logged-in-user.

The post wp_ajax_edd_apply_discount first appeared on Easy Digital Downloads.

]]>
edd_email_from_address https://easydigitaldownloads.com/docs/edd_email_from_address/ Mon, 24 Jan 2022 19:58:54 +0000 https://edd-site.lndo.site/docs/edd_email_from_address/ The edd_email_from_address filter is applied to the “From Address” for all emails sent through Easy Digital Downloads. It receives two parameters: $from_address – The email address to be used as the From Address $emails_object – The current instance of the EDD_Emails class

The post edd_email_from_address first appeared on Easy Digital Downloads.

]]>
The edd_email_from_address filter is applied to the “From Address” for all emails sent through Easy Digital Downloads. It receives two parameters:

  • $from_address – The email address to be used as the From Address
  • $emails_object – The current instance of the EDD_Emails class

The post edd_email_from_address first appeared on Easy Digital Downloads.

]]>
edd_before_purchase_form https://easydigitaldownloads.com/docs/edd_before_purchase_form/ Mon, 24 Jan 2022 19:58:52 +0000 https://edd-site.lndo.site/docs/edd_before_purchase_form/ Runs just before the purchase form (the form users enter all of the personal information into).

The post edd_before_purchase_form first appeared on Easy Digital Downloads.

]]>
Runs just before the purchase form (the form users enter all of the personal information into).

The post edd_before_purchase_form first appeared on Easy Digital Downloads.

]]>
edd_before_checkout_cart https://easydigitaldownloads.com/docs/edd_before_checkout_cart/ Mon, 24 Jan 2022 19:58:51 +0000 https://edd-site.lndo.site/docs/edd_before_checkout_cart/ Runs just before the cart table begins on the checkout page.

The post edd_before_checkout_cart first appeared on Easy Digital Downloads.

]]>
Runs just before the cart table begins on the checkout page.

The post edd_before_checkout_cart first appeared on Easy Digital Downloads.

]]>
edd_before_download_content https://easydigitaldownloads.com/docs/edd_before_download_content/ Mon, 24 Jan 2022 19:58:50 +0000 https://edd-site.lndo.site/docs/edd_before_download_content/ Runs just before the content for a single download is displayed. Usually this happens in single.php or single-download.php. This action is primarily for adding extra content to the top of download content, most likely in scenarios where you are unable to modify the template files, or do not have a single-download.php. The download ID is

The post edd_before_download_content first appeared on Easy Digital Downloads.

]]>
Runs just before the content for a single download is displayed. Usually this happens in single.php or single-download.php.

This action is primarily for adding extra content to the top of download content, most likely in scenarios where you are unable to modify the template files, or do not have a single-download.php.

The download ID is passed as a parameter.

The post edd_before_download_content first appeared on Easy Digital Downloads.

]]>
EDD_DISABLE_REWRITE https://easydigitaldownloads.com/docs/edd_disable_rewrite/ Mon, 24 Jan 2022 19:58:49 +0000 https://edd-site.lndo.site/docs/edd_disable_rewrite/ This constant allows you to disable the “pretty URLs” for the downloads post type. Some sites, particularly those notusing the downloads post type archive, may want to remove the rewrite structure of the custom post type entirely. This constant allows you to do that. To disable the rewrite, place this in your functions.php or any custom

The post EDD_DISABLE_REWRITE first appeared on Easy Digital Downloads.

]]>
This constant allows you to disable the “pretty URLs” for the downloads post type. Some sites, particularly those notusing the downloads post type archive, may want to remove the rewrite structure of the custom post type entirely. This constant allows you to do that.

To disable the rewrite, place this in your functions.php or any custom plugin:

define('EDD_DISABLE_REWRITE', true);

Note: you will want to resave your permalink structure after doing this.

The post EDD_DISABLE_REWRITE first appeared on Easy Digital Downloads.

]]>
edd_purchase_form_register_fields https://easydigitaldownloads.com/docs/edd_purchase_form_register_fields/ Mon, 24 Jan 2022 19:58:48 +0000 https://edd-site.lndo.site/docs/edd_purchase_form_register_fields/ This action runs at the bottom of the checkout registration fields and can be used for adding additional fields to the registration form.

The post edd_purchase_form_register_fields first appeared on Easy Digital Downloads.

]]>
This action runs at the bottom of the checkout registration fields and can be used for adding additional fields to the registration form.

The post edd_purchase_form_register_fields first appeared on Easy Digital Downloads.

]]>
edd_purchase_form_user_info https://easydigitaldownloads.com/docs/edd_purchase_form_user_info/ Mon, 24 Jan 2022 19:58:47 +0000 https://edd-site.lndo.site/docs/edd_purchase_form_user_info/ Runs at the bottom of the “edd_checkout_user_info” fieldset. This is the set of fields for entering email, first and last names.

The post edd_purchase_form_user_info first appeared on Easy Digital Downloads.

]]>
Runs at the bottom of the “edd_checkout_user_info” fieldset. This is the set of fields for entering email, first and last names.

The post edd_purchase_form_user_info first appeared on Easy Digital Downloads.

]]>
edd_before_cart https://easydigitaldownloads.com/docs/edd_before_cart/ Mon, 24 Jan 2022 19:58:46 +0000 https://edd-site.lndo.site/docs/edd_before_cart/ Runs just before the shopping cart HTML. Included in the widget, short code, and template tag shopping cart. Does not run on the checkout page.

The post edd_before_cart first appeared on Easy Digital Downloads.

]]>
Runs just before the shopping cart HTML. Included in the widget, short code, and template tag shopping cart. Does not run on the checkout page.

The post edd_before_cart first appeared on Easy Digital Downloads.

]]>
EDD_READ_FILE_MODE https://easydigitaldownloads.com/docs/edd_read_file_mode/ Mon, 24 Jan 2022 19:58:45 +0000 https://edd-site.lndo.site/docs/edd_read_file_mode/ When downloads are delivered to the user, the files are read using the PHP readfile() function, but because some hosts do not allow files to be ready via URL, this will occasionally fail. The EDD_READ_FILE_MODE constant is available for these scenarios. Note, this is only valid for plugin versions before 1.1.5 If a host does

The post EDD_READ_FILE_MODE first appeared on Easy Digital Downloads.

]]>
When downloads are delivered to the user, the files are read using the PHP readfile() function, but because some hosts do not allow files to be ready via URL, this will occasionally fail. The EDD_READ_FILE_MODE constant is available for these scenarios.

Note, this is only valid for plugin versions before 1.1.5

If a host does not allow readfile() to access files via URL, then define this in functions.php or any custom plugin:

define('EDD_READ_FILE_MODE', 'header');

When this constant is defined to “header”, Easy Digital Downloads will use header(“location:” . $file_url) for directing the user to download the file. This is not as secure so should only be used when readfile() does not work.

The post EDD_READ_FILE_MODE first appeared on Easy Digital Downloads.

]]>
edd_email_from_name https://easydigitaldownloads.com/docs/edd_email_from_name/ Mon, 24 Jan 2022 19:58:44 +0000 https://edd-site.lndo.site/docs/edd_email_from_name/ The edd_email_from_name filter is applied to the “From Name” for all emails sent through Easy Digital Downloads. It receives two parameters: $from_name – The From Name to be used $emails_object – The current instance of the EDD_Emails class

The post edd_email_from_name first appeared on Easy Digital Downloads.

]]>
The edd_email_from_name filter is applied to the “From Name” for all emails sent through Easy Digital Downloads. It receives two parameters:

  • $from_name – The From Name to be used
  • $emails_object – The current instance of the EDD_Emails class

The post edd_email_from_name first appeared on Easy Digital Downloads.

]]>
edd_email_heading https://easydigitaldownloads.com/docs/edd_email_heading/ Mon, 24 Jan 2022 19:58:43 +0000 https://edd-site.lndo.site/docs/edd_email_heading/ The edd_email_heading filter allows you to set the heading text applied to all emails sent through Easy Digital Downloads.

The post edd_email_heading first appeared on Easy Digital Downloads.

]]>
The edd_email_heading filter allows you to set the heading text applied to all emails sent through Easy Digital Downloads.

The post edd_email_heading first appeared on Easy Digital Downloads.

]]>
edd_pre_insert_discount https://easydigitaldownloads.com/docs/edd_pre_insert_discount/ Mon, 24 Jan 2022 19:58:42 +0000 https://edd-site.lndo.site/docs/edd_pre_insert_discount/ This action runs just before a discount code is created. It receives one parameter: $discount_details. $discount_details is an array containing all fields for the discount, such as name, type, amount, etc. do_action( 'edd_pre_insert_discount', $discount_details );

The post edd_pre_insert_discount first appeared on Easy Digital Downloads.

]]>
This action runs just before a discount code is created. It receives one parameter: $discount_details.

$discount_details is an array containing all fields for the discount, such as name, type, amount, etc.

do_action( 'edd_pre_insert_discount', $discount_details );

The post edd_pre_insert_discount first appeared on Easy Digital Downloads.

]]>
edd_protected_directory_htaccess_rules https://easydigitaldownloads.com/docs/edd_protected_directory_htaccess_rules/ Mon, 24 Jan 2022 19:58:41 +0000 https://edd-site.lndo.site/docs/edd_protected_directory_htaccess_rules/ The edd_protected_directory_htaccess_rules filter allows you to change the rules placed in EDD’s .htaccess file for protecting file downloads. Full tutorial on using this filter.

The post edd_protected_directory_htaccess_rules first appeared on Easy Digital Downloads.

]]>
The edd_protected_directory_htaccess_rules filter allows you to change the rules placed in EDD’s .htaccess file for protecting file downloads.

Full tutorial on using this filter.

The post edd_protected_directory_htaccess_rules first appeared on Easy Digital Downloads.

]]>
edd_email_attachments https://easydigitaldownloads.com/docs/edd_email_attachments/ Mon, 24 Jan 2022 19:58:40 +0000 https://edd-site.lndo.site/docs/edd_email_attachments/ The edd_email_attachments filter allows you to add / remove file attachments for emails sent through Easy Digital Downloads. It receives two parameters: $attachments – The attachments already attached to the email (none by default) $emails_object – The current instance of the EDD_Emails class

The post edd_email_attachments first appeared on Easy Digital Downloads.

]]>
The edd_email_attachments filter allows you to add / remove file attachments for emails sent through Easy Digital Downloads. It receives two parameters:

  • $attachments – The attachments already attached to the email (none by default)
  • $emails_object – The current instance of the EDD_Emails class

The post edd_email_attachments first appeared on Easy Digital Downloads.

]]>
EDD Export Class https://easydigitaldownloads.com/docs/edd_export-class/ Mon, 24 Jan 2022 19:58:39 +0000 https://edd-site.lndo.site/docs/edd_export-class/ Overview The Easy Digital Downloads Export system provides a robust framework for creating custom data exports. This documentation covers the base Exporter class and how to implement custom exporters. Requirements Base Export Class The Exporter class is located in the EDD\Admin\Exports\Exporters namespace and serves as the foundation for all EDD export functionality. Required Methods When

The post EDD Export Class first appeared on Easy Digital Downloads.

]]>
Overview

The Easy Digital Downloads Export system provides a robust framework for creating custom data exports. This documentation covers the base Exporter class and how to implement custom exporters.

Requirements

  • WordPress 6.2+
  • Easy Digital Downloads 3.3.8+
  • PHP 7.4+

Base Export Class

The Exporter class is located in the EDD\Admin\Exports\Exporters namespace and serves as the foundation for all EDD export functionality.

Required Methods

When extending the Exporter class, you must implement these abstract methods:

abstract protected function get_export_type(): string;
abstract protected function get_data(): array;
abstract protected function get_data_headers(): array;
abstract protected function get_total(): int;
abstract public function set_properties( $request ): void;

Creating a Custom Exporter

1. Basic Structure

Create a class that extends the Exporter class:

<?php

/**
 * Custom Exporter class.
 */
class CustomExporter extends EDD\Admin\Exports\Exporters\Exporter {

	/**
	 * Get the export type.
	 *
	 * @return string The export type.
	 */
	protected function get_export_type(): string {
		return 'custom_export';
	}

	/**
	 * Set the properties.
	 *
	 * @param array $request The request.
	 * @return void
	 */
	public function set_properties( $request ): void {
		$this->start = isset( $request['custom-export-start'] )
			? sanitize_text_field( $request['custom-export-start'] )
			: '';
		$this->end   = isset( $request['custom-export-end'] )
			? sanitize_text_field( $request['custom-export-end'] )
			: '';
	}

	/**
	 * Get the data headers.
	 *
	 * @return array The data headers.
	 */
	protected function get_data_headers(): array {
		return array(
			'id'     => __( 'ID', 'your-text-domain' ),
			'status' => __( 'Status', 'your-text-domain' ),
		);
	}

	protected function get_data(): array {
		$data = array();
		$args = array_merge(
			array(
				'number' => $this->per_step,
				'offset' => ( $this->step * $this->per_step ) - $this->per_step,
			),
			$this->get_base_args()
		);

		// Your data retrieval logic here
		$items = edd_get_orders( $args );

		foreach ( $items as $item ) {
			$data[] = array(
				'id'     => $item->id,
				'status' => $item->status,
			);
		}

		return $data;
	}

	/**
	 * Get the total.
	 *
	 * @return int The total.
	 */
	protected function get_total(): int {
		return edd_count_orders( $this->get_base_args() );
	}

	/**
	 * Get the base args.
	 *
	 * @return array The base args.
	 */
	private function get_base_args(): array {
		$args = array();
		if ( ! empty( $this->start ) || ! empty( $this->end ) ) {
			$args['date_query'] = $this->get_date_query();
		}
		return $args;
	}
}

2. Registering Your Exporter

Create a class to handle the registration and form display:

/**
 * Register the custom exporter.
 *
 * @param \EDD\Admin\Exports\Registry $registry The registry instance.
 * @return void
 */
function custom_register_export( \EDD\Admin\Exports\Registry $registry ) {
	$registry->register_exporter(
		'custom_export',
		array(
			'label'       => __( 'Custom Export', 'your-text-domain' ),
			'description' => __( 'Export custom data.', 'your-text-domain' ),
			'class'       => CustomExporter::class,
			'class_path'  => __DIR__ . '/class-custom-export.php', // Change to your export class path.
			'button'      => __( 'Export Data', 'your-text-domain' ),
		)
	);
}
add_action( 'edd_export_init', 'custom_register_export' );

/**
 * Display the custom export form.
 *
 * @param string $exporter_id The exporter ID.
 * @return void
 */
function custom_export_form( $exporter_id ) {
	if ( 'custom_export' !== $exporter_id ) {
		return;
	}

	$from_to = new \EDD\HTML\FromTo(
		array(
			'legend' => __( 'Custom Export Date', 'your-text-domain' ),
			'id'     => 'order-export',
		)
	);
	$from_to->output();
	?>
		<label for="edd_export_custom_status" class="screen-reader-text"><?php esc_html_e( 'Select Status', 'your-text-domain' ); ?></label>
		<?php
		$statuses = array();
		foreach ( edd_get_payment_statuses() as $status ) {
			if ( 'publish' === $status ) {
				continue;
			}
			$statuses[ $status ] = edd_get_payment_status_label( $status );
		}
		$select = new \EDD\HTML\Select(
			array(
				'id'               => 'edd_export_custom_status',
				'name'             => 'status',
				'show_option_all'  => __( 'All Statuses', 'your-text-domain' ),
				'show_option_none' => false,
				'selected'         => false,
				'options'          => $statuses,
			)
		);
		$select->output();
}
add_action( 'edd_export_form', 'custom_export_form' );

With the new export registry, once you have your export class set up along with your form, EDD will handle the export process automatically.

Sources:

The post EDD Export Class first appeared on Easy Digital Downloads.

]]>
EDD_Graph https://easydigitaldownloads.com/docs/edd_graph/ Mon, 24 Jan 2022 19:58:38 +0000 https://edd-site.lndo.site/docs/edd_graph/ The EDD_Graph class, introduced in EDD version 1.9, is used for easily building graphs of data. For example, the earnings / sales reports graphs seen in Downloads → Reports are created using EDD_Graph. The class can be used by extensions to quickly graph any data set. A simple example looks like this: $data = array(

The post EDD_Graph first appeared on Easy Digital Downloads.

]]>
The EDD_Graph class, introduced in EDD version 1.9, is used for easily building graphs of data. For example, the earnings / sales reports graphs seen in Downloads → Reports are created using EDD_Graph. The class can be used by extensions to quickly graph any data set.


A simple example looks like this:

$data = array(
	'Your Graph Label Here' => array(
		array( 1, 5 ),
		array( 3, 8 ),
		array( 10, 2 )
	),
	'Second Label Here' => array(
		array( 1, 7 ),
		array( 4, 5 ),
		array( 12, 8 )
	)
);
$graph = new EDD_Graph( $data );
$graph->display();

Each inner array represents a data point on the graph and should be structured like this:

array( 'value on x axis', 'value on y axis' )

Graphs can contain one one or more lines. To add multiple lines, simply add additional inner arrays, as shown in the example above.

Along with the data points, EDD_Grap allows you to control various options of the graph by using the set() method. For example:

// Example with options set to other than default:
$data = array(
    'Line Label' => array(
        array( 1, 5 ),
        array( 3, 8 ),
        array( 10, 2 )
    ),
    'Second Line Label' => array(
        array( 1, 7 ),
        array( 4, 5 ),
        array( 12, 8 )
    )
);
$graph = new EDD_Graph( $data );
$graph->set( 'bgcolor', '#000' );
$graph->set( 'color', '#fff' );
$graph->display();

The available options are:

  • y_mode
  • x_mode
  • y_decimals
  • x_decimals
  • y_position
  • time_format
  • ticksize_unit
  • ticksize_num
  • multiple_y_axes
  • bgcolor
  • bordercolor
  • color
  • borderwidth
  • bars
  • lines
  • points

See the Flot API reference for the possible values each of these can receive.

Note, if you want to display a graph on the front end, you will need to include includes/admin/reporting/class-edd-graph.php first.

The post EDD_Graph first appeared on Easy Digital Downloads.

]]>
edd_purchase_form_required_fields https://easydigitaldownloads.com/docs/edd_purchase_form_required_fields/ Mon, 24 Jan 2022 19:58:37 +0000 https://edd-site.lndo.site/docs/edd_purchase_form_required_fields/ The edd_purchase_form_required_fields filter is used to change which fields during checkout are required. For an example, see this doc.

The post edd_purchase_form_required_fields first appeared on Easy Digital Downloads.

]]>
The
edd_purchase_form_required_fields filter is used to change which fields during checkout are required. For an example, see this doc.

The post edd_purchase_form_required_fields first appeared on Easy Digital Downloads.

]]>
EDD_PLUGIN_DIR https://easydigitaldownloads.com/docs/edd_plugin_dir/ Mon, 24 Jan 2022 19:58:36 +0000 https://edd-site.lndo.site/docs/edd_plugin_dir/ This constant refers to the directory path of Easy Digital Download’s plugin folder. The path does not include a trailing slash.

The post EDD_PLUGIN_DIR first appeared on Easy Digital Downloads.

]]>
This constant refers to the directory path of Easy Digital Download’s plugin folder. The path does not include a trailing slash.

The post EDD_PLUGIN_DIR first appeared on Easy Digital Downloads.

]]>
edd_after_price_option https://easydigitaldownloads.com/docs/edd_after_price_option/ Mon, 24 Jan 2022 19:58:35 +0000 https://edd-site.lndo.site/docs/edd_after_price_option/ This action runs just after a price option is printed for variable-price enabled Downloads. do_action( 'edd_after_price_option', $price_id, $price_data, $download_id );

The post edd_after_price_option first appeared on Easy Digital Downloads.

]]>
This action runs just after a price option is printed for variable-price enabled Downloads.

do_action( 'edd_after_price_option', $price_id, $price_data, $download_id );

The post edd_after_price_option first appeared on Easy Digital Downloads.

]]>
edd_payment_mode_top https://easydigitaldownloads.com/docs/edd_payment_mode_top/ Mon, 24 Jan 2022 19:58:34 +0000 https://edd-site.lndo.site/docs/edd_payment_mode_top/ Runs just before the payment mode selection form. Only runs if there are at least two payment gateways enabled.

The post edd_payment_mode_top first appeared on Easy Digital Downloads.

]]>
Runs just before the payment mode selection form. Only runs if there are at least two payment gateways enabled.

The post edd_payment_mode_top first appeared on Easy Digital Downloads.

]]>
edd_get_download_earnings_stats() https://easydigitaldownloads.com/docs/edd_get_download_earnings_stats/ Mon, 24 Jan 2022 19:58:33 +0000 https://edd-site.lndo.site/docs/edd_get_download_earnings_stats/ This function will retrieve the total amount a particular download has earned in sales. $earnings = edd_get_download_earnings_stats( $download_id );

The post edd_get_download_earnings_stats() first appeared on Easy Digital Downloads.

]]>
This function will retrieve the total amount a particular download has earned in sales.

$earnings = edd_get_download_earnings_stats( $download_id );

The post edd_get_download_earnings_stats() first appeared on Easy Digital Downloads.

]]>
edd_update_discount https://easydigitaldownloads.com/docs/edd_update_discount/ Mon, 24 Jan 2022 19:58:32 +0000 https://edd-site.lndo.site/docs/edd_update_discount/ This filter is applied to the discount data just before a discount is created. apply_filters( 'edd_insert_discount', $discount_details); $discount_details is an array of all fields for the discount.

The post edd_update_discount first appeared on Easy Digital Downloads.

]]>
This filter is applied to the discount data just before a discount is created.

apply_filters( 'edd_insert_discount', $discount_details);

$discount_details is an array of all fields for the discount.

The post edd_update_discount first appeared on Easy Digital Downloads.

]]>
edd_checkout_form_top https://easydigitaldownloads.com/docs/edd_checkout_form_top/ Mon, 24 Jan 2022 19:58:31 +0000 https://edd-site.lndo.site/docs/edd_checkout_form_top/ This action runs just after the div#edd_checkout_form_wrap opens.

The post edd_checkout_form_top first appeared on Easy Digital Downloads.

]]>
This action runs just after the
div#edd_checkout_form_wrap opens.

The post edd_checkout_form_top first appeared on Easy Digital Downloads.

]]>
edd_email_template_tags filter https://easydigitaldownloads.com/docs/edd_email_template_tags-filter/ Mon, 24 Jan 2022 19:58:30 +0000 https://edd-site.lndo.site/docs/edd_email_template_tags-filter/ This filter allows you to add additional template tags to the email purchase receipts. The filter takes two parameters: $message – an HTML string of the email contents $payment_data – an array of meta data for the payment You can add custom template tags like this: function custom_edd_email_tags($message, $payment_data) { $message = str_replace('{your_custom_tag}', 'replace the

The post edd_email_template_tags filter first appeared on Easy Digital Downloads.

]]>
This filter allows you to add additional template tags to the email purchase receipts.

The filter takes two parameters:

  • $message – an HTML string of the email contents
  • $payment_data – an array of meta data for the payment

You can add custom template tags like this:

function custom_edd_email_tags($message, $payment_data) {
	$message = str_replace('{your_custom_tag}', 'replace the tag with this', $message);
	return $message;
}
add_filter('edd_email_template_tags', 'custom_edd_email_tags', 10, 2);

The post edd_email_template_tags filter first appeared on Easy Digital Downloads.

]]>
edd_has_variable_prices() https://easydigitaldownloads.com/docs/edd_has_variable_prices/ Mon, 24 Jan 2022 19:58:29 +0000 https://edd-site.lndo.site/docs/edd_has_variable_prices/ This function will check whether a download has variable prices enabled. If the specified ID has variable prices, the function will return true, otherwise it will return false. Example: if( edd_has_variable_prices( $download_id ) ) { // download has variable prices enabled } else { // variable prices are not enabled }

The post edd_has_variable_prices() first appeared on Easy Digital Downloads.

]]>
This function will check whether a download has variable prices enabled. If the specified ID has variable prices, the function will return true, otherwise it will return false.

Example:

if( edd_has_variable_prices( $download_id ) ) {
	// download has variable prices enabled
} else {
	// variable prices are not enabled
}

The post edd_has_variable_prices() first appeared on Easy Digital Downloads.

]]>
edd_cart_empty https://easydigitaldownloads.com/docs/edd_cart_empty/ Mon, 24 Jan 2022 19:58:27 +0000 https://edd-site.lndo.site/docs/edd_cart_empty/ This action runs on the checkout page if the cart is empty.

The post edd_cart_empty first appeared on Easy Digital Downloads.

]]>
This action runs on the checkout page if the cart is empty.

The post edd_cart_empty first appeared on Easy Digital Downloads.

]]>
edd_purchase_link_top https://easydigitaldownloads.com/docs/edd_purchase_link_top/ Mon, 24 Jan 2022 19:58:26 +0000 https://edd-site.lndo.site/docs/edd_purchase_link_top/ This action runs just before the purchase link is outputted, both for the `[purchase_link]` short code and the `edd_get_purchase_link()` function. do_action( 'edd_purchase_link_top', $download_id, $show_price );

The post edd_purchase_link_top first appeared on Easy Digital Downloads.

]]>
This action runs just before the purchase link is outputted, both for the `[purchase_link]` short code and the `edd_get_purchase_link()` function.

do_action( 'edd_purchase_link_top', $download_id, $show_price );

The post edd_purchase_link_top first appeared on Easy Digital Downloads.

]]>
EDD_PLUGIN_FILE https://easydigitaldownloads.com/docs/edd_plugin_file/ Mon, 24 Jan 2022 19:58:25 +0000 https://edd-site.lndo.site/docs/edd_plugin_file/ This constant refers to the file name of Easy Digital Download’s main plugin file: easy-digital-downloads.php

The post EDD_PLUGIN_FILE first appeared on Easy Digital Downloads.

]]>
This constant refers to the file name of Easy Digital Download’s main plugin file: easy-digital-downloads.php

The post EDD_PLUGIN_FILE first appeared on Easy Digital Downloads.

]]>
edd_is_ajax_enabled() https://easydigitaldownloads.com/docs/edd_is_ajax_enabled/ Mon, 24 Jan 2022 19:58:24 +0000 https://edd-site.lndo.site/docs/edd_is_ajax_enabled/ This function can be used to check if ajax is enabled for Easy Digital Downloads. If you are integrating EDD into your theme, this may be very useful. $is_ajaxed = edd_is_ajax_enabled(); // (boolean) "false" if not enabled // (boolean) "true" if is enabled

The post edd_is_ajax_enabled() first appeared on Easy Digital Downloads.

]]>
This function can be used to check if ajax is enabled for Easy Digital Downloads. If you are integrating EDD into your theme, this may be very useful.

$is_ajaxed = edd_is_ajax_enabled();
// (boolean) "false" if not enabled
// (boolean) "true" if is enabled

The post edd_is_ajax_enabled() first appeared on Easy Digital Downloads.

]]>
EDD_MENU_POSITION https://easydigitaldownloads.com/docs/edd_menu_position/ Mon, 24 Jan 2022 19:58:23 +0000 https://edd-site.lndo.site/docs/edd_menu_position/ This constant lets you change the menu position of the download post type in the WordPress dashboard menu. The default position is 15, but if you want to change it, place this in your functions.php or any custom plugin: define('EDD_MENU_POSITION', 25); 25 is the new position of the menu. Any valid number from this page can

The post EDD_MENU_POSITION first appeared on Easy Digital Downloads.

]]>
This constant lets you change the menu position of the download post type in the WordPress dashboard menu.

The default position is 15, but if you want to change it, place this in your functions.php or any custom plugin:

define('EDD_MENU_POSITION', 25);

25 is the new position of the menu. Any valid number from this page can be used.

Note: this constant has been removed from v1.0.8.5 and later. The issue does not exist past 1.0.8.4, so this constant is not needed.

The post EDD_MENU_POSITION first appeared on Easy Digital Downloads.

]]>
edd_after_cc_fields https://easydigitaldownloads.com/docs/edd_after_cc_fields/ Mon, 24 Jan 2022 19:58:22 +0000 https://edd-site.lndo.site/docs/edd_after_cc_fields/ This action runs at the bottoms of the credit card fields section for the default credit card form. Not necessarily used by add-on gateways.

The post edd_after_cc_fields first appeared on Easy Digital Downloads.

]]>
This action runs at the bottoms of the credit card fields section for the default credit card form. Not necessarily used by add-on gateways.

The post edd_after_cc_fields first appeared on Easy Digital Downloads.

]]>
edd_set_payment_transaction_id https://easydigitaldownloads.com/docs/edd_set_payment_transaction_id-2/ Mon, 24 Jan 2022 19:58:21 +0000 https://edd-site.lndo.site/docs/edd_set_payment_transaction_id-2/ The edd_set_payment_transaction_id filter is applied to the transaction ID before it is set by the edd_set_payment_transaction_id() function. The filter receives two parameters: $transaction_id $payment_id

The post edd_set_payment_transaction_id first appeared on Easy Digital Downloads.

]]>
The
edd_set_payment_transaction_id filter is applied to the transaction ID before it is set by the edd_set_payment_transaction_id() function. The filter receives two parameters:

  • $transaction_id
  • $payment_id

The post edd_set_payment_transaction_id first appeared on Easy Digital Downloads.

]]>
EDD REST API – Discounts https://easydigitaldownloads.com/docs/edd-rest-api-discounts/ Mon, 24 Jan 2022 19:58:20 +0000 https://edd-site.lndo.site/docs/edd-rest-api-discounts/ The EDD REST API provides the /discounts/ endpoint, which allows you to retrieve information about your the discounts that exist in your store. A basic discounts query looks like this: http://example.com/edd-api/discounts/?key=c281cf0a95be875d9eeb284fb004c938&token=5f9432f3ffa5945755ebc66179810d70 A sample discounts response looks like this: { "discounts": [ { "ID": 158, "name": "Taco Tuesday", "code": "TACOTUESDAY", "amount": 5, "min_price": 0, "type": "flat",

The post EDD REST API – Discounts first appeared on Easy Digital Downloads.

]]>
The
EDD REST API provides the /discounts/ endpoint, which allows you to retrieve information about your the discounts that exist in your store. A basic discounts query looks like this:

http://example.com/edd-api/discounts/?key=c281cf0a95be875d9eeb284fb004c938&token=5f9432f3ffa5945755ebc66179810d70

A sample discounts response looks like this:

{
    "discounts": [
        {
            "ID": 158,
            "name": "Taco Tuesday",
            "code": "TACOTUESDAY",
            "amount": 5,
            "min_price": 0,
            "type": "flat",
            "uses": 0,
            "max_uses": 0,
            "start_date": "",
            "exp_date": "",
            "status": "inactive",
            "product_requirements": [
                114
            ],
            "requirement_condition": "all",
            "global_discount": false,
            "single_use": false
        },
        {
            "ID": 157,
            "name": "10% Off",
            "code": "10PERCENT",
            "amount": 10,
            "min_price": 0,
            "type": "percent",
            "uses": 0,
            "max_uses": 0,
            "start_date": "",
            "exp_date": "",
            "status": "active",
            "product_requirements": {
                "1": 68
            },
            "requirement_condition": "all",
            "global_discount": false,
            "single_use": false
        }
    ],
    "request_speed": 0.039878129959106
}

The post EDD REST API – Discounts first appeared on Easy Digital Downloads.

]]>
edd_get_price_option_name() https://easydigitaldownloads.com/docs/edd_get_price_option_name/ Mon, 24 Jan 2022 19:58:19 +0000 https://edd-site.lndo.site/docs/edd_get_price_option_name/ This function can be used for getting the name of a specified price from a specific download. $price_name = edd_get_price_option_name( $download_id, $price_id ); // $price_name will be something like "Regular License"

The post edd_get_price_option_name() first appeared on Easy Digital Downloads.

]]>
This function can be used for getting the name of a specified price from a specific download.

$price_name = edd_get_price_option_name( $download_id, $price_id );
// $price_name will be something like "Regular License"

The post edd_get_price_option_name() first appeared on Easy Digital Downloads.

]]>
edd_email_message https://easydigitaldownloads.com/docs/edd_email_message/ Mon, 24 Jan 2022 19:58:18 +0000 https://edd-site.lndo.site/docs/edd_email_message/ The  edd_email_message filter is applied to the main message text for all emails sent through Easy Digital Downloads. It receives two parameters: $message – The email body text $emails_object – The current instance of the EDD_Emails class

The post edd_email_message first appeared on Easy Digital Downloads.

]]>
The 
edd_email_message filter is applied to the main message text for all emails sent through Easy Digital Downloads. It receives two parameters:

  • $message – The email body text
  • $emails_object – The current instance of the EDD_Emails class

The post edd_email_message first appeared on Easy Digital Downloads.

]]>
edd_api_output_{format} https://easydigitaldownloads.com/docs/edd_api_output_format/ Mon, 24 Jan 2022 19:58:16 +0000 https://edd-site.lndo.site/docs/edd_api_output_format/ This action runs when printing the response data to the screen for a custom data format when performing an EDD_APIrequest. do_action( 'edd_api_output_{format}', $data, $api_object );

The post edd_api_output_{format} first appeared on Easy Digital Downloads.

]]>
This action runs when printing the response data to the screen for a custom data format when performing an EDD_APIrequest.

do_action( 'edd_api_output_{format}', $data, $api_object );

The post edd_api_output_{format} first appeared on Easy Digital Downloads.

]]>
edd_get_payment_transaction_id https://easydigitaldownloads.com/docs/edd_get_payment_transaction_id-2/ Mon, 24 Jan 2022 19:58:15 +0000 https://edd-site.lndo.site/docs/edd_get_payment_transaction_id-2/ The edd_get_payment_transaction_id filter is applied to the transaction ID that is returned by the edd_get_payment_transaction_id() function. The filter receives two parameters: $transaction_id $payment_id

The post edd_get_payment_transaction_id first appeared on Easy Digital Downloads.

]]>
The edd_get_payment_transaction_id filter is applied to the transaction ID that is returned by the edd_get_payment_transaction_id() function. The filter receives two parameters:

  • $transaction_id
  • $payment_id

The post edd_get_payment_transaction_id first appeared on Easy Digital Downloads.

]]>
edd_get_download_sales_stats() https://easydigitaldownloads.com/docs/edd_get_download_sales_stats/ Mon, 24 Jan 2022 19:58:14 +0000 https://edd-site.lndo.site/docs/edd_get_download_sales_stats/ This function will retrieve the total number of sales for a particular download. $sales = edd_get_download_sales_stats( $download_id );

The post edd_get_download_sales_stats() first appeared on Easy Digital Downloads.

]]>
This function will retrieve the total number of sales for a particular download.

$sales = edd_get_download_sales_stats( $download_id );

The post edd_get_download_sales_stats() first appeared on Easy Digital Downloads.

]]>
EDD_Payment_Stats https://easydigitaldownloads.com/docs/edd_payment_stats/ Mon, 24 Jan 2022 19:58:13 +0000 https://edd-site.lndo.site/docs/edd_payment_stats/ The  EDD_Payment_Stats class is designed to provide a simple way to retrieve earnings and sales stats for the entire store, or specific products, for designated time periods, such as this week, last month, today, last year, etc. To use  EDD_Payment_Stats, you must instantiate a new instance of the class: $stats = new EDD_Payment_Stats; Once the

The post EDD_Payment_Stats first appeared on Easy Digital Downloads.

]]>
The 
EDD_Payment_Stats class is designed to provide a simple way to retrieve earnings and sales stats for the entire store, or specific products, for designated time periods, such as this week, last month, today, last year, etc.

To use 
EDD_Payment_Stats, you must instantiate a new instance of the class:

$stats = new EDD_Payment_Stats;

Once the class is instantiated, you can use any of the following member functions:

// Retrieve earnings
$stats->get_earnings( $download_id = 0, $start_date = false, $end_date = false );
// Retrieve sales
$stats->get_sales( $download_id = 0, $start_date = false, $end_date = false );
// Retrieve a list of the best selling Download products
$stats->get_best_selling( $number = 10 );

For both 
get_sales() and get_earnings(), the following parameters can be passed:

$download_id – The ID number of the product to retrieve stats for. If 0 or any other empty value is passed, stats will be retrieved for the whole store.

$start_date – The beginning date to retrieve stats for. If you want to retrieve stats for one of the pre-defined periods, simply pass the period, such as “today” or “yesterday”. This parameter can be a date string, a timestamp, or a date formatted in any standard format.

$end_date – The end date to retrieve stats for. If you want to retrieve stats for one of the pre-defined periods, leave this blank. This parameter can be a date string, a timestamp, or a date formatted in any standard format.

Stats can be retrieved for any pre-defined time period. These options include:

  • today
  • yesterday
  • this_week
  • last_week
  • this_month
  • last_month
  • this_quarter
  • last_quarter
  • this_year
  • last_year

Examples

// Store-wide sales for this month:
echo $stats->get_sales( 0, 'this_month' );

Returns an integer, the sum of sales in the given time span
// Store-wide earnings for August 2, 2013
echo $stats->get_earnings( 0, 'August 2, 2013' );

Returns an integer if earnings are a whole number, a float rounded to 2 if a 
fractional number, like 42.73
// Sales for download ID 44 from July 2 to August 5, 2013
echo $stats->get_sales( 44, 'July 2, 2013', 'August 5, 2013' );
// Earnings for download ID 52 for December 5, 2012
echo $stats->get_earnings( 52, '12-05-2012' )
$best_selling = $stats->get_best_selling( '10' );

Returns an array of the 10 best selling products, like this:

Array
(
    [0] => stdClass Object
        (
            [download_id] => 68
            [sales] => 3
        )

    [1] => stdClass Object
        (
            [download_id] => 120
            [sales] => 2
        )
)

The post EDD_Payment_Stats first appeared on Easy Digital Downloads.

]]>
edd_render_receipt_in_browser_before https://easydigitaldownloads.com/docs/edd_render_receipt_in_browser_before/ Mon, 24 Jan 2022 19:58:12 +0000 https://edd-site.lndo.site/docs/edd_render_receipt_in_browser_before/ This action runs at the top of the in-browser purchase receipt. do_action( 'edd_render_receipt_in_browser_before' );

The post edd_render_receipt_in_browser_before first appeared on Easy Digital Downloads.

]]>
This action runs at the top of the in-browser purchase receipt.

do_action( 'edd_render_receipt_in_browser_before' );

The post edd_render_receipt_in_browser_before first appeared on Easy Digital Downloads.

]]>
edd_email_template_{template name} https://easydigitaldownloads.com/docs/edd_email_template_template-name/ Mon, 24 Jan 2022 19:58:11 +0000 https://edd-site.lndo.site/docs/edd_email_template_template-name/ This action runs in the body section of the emailed purchase receipt. It is used to rendering the HTML structure of each purchase receipt template. do_action( 'edd_email_template_' . $template_name );

The post edd_email_template_{template name} first appeared on Easy Digital Downloads.

]]>
This action runs in the body section of the emailed purchase receipt. It is used to rendering the HTML structure of each purchase receipt template.

do_action( 'edd_email_template_' . $template_name );

The post edd_email_template_{template name} first appeared on Easy Digital Downloads.

]]>
edd_is_test_mode() https://easydigitaldownloads.com/docs/edd_is_test_mode/ Mon, 24 Jan 2022 19:58:10 +0000 https://edd-site.lndo.site/docs/edd_is_test_mode/ This function can be used to check if test mode is enabled for Easy Digital Downloads. $test_mode = edd_is_test_mode(); // (boolean) "false" if not enabled // (boolean) "true" if is enabled

The post edd_is_test_mode() first appeared on Easy Digital Downloads.

]]>
This function can be used to check if test mode is enabled for Easy Digital Downloads.

$test_mode = edd_is_test_mode();
// (boolean) "false" if not enabled
// (boolean) "true" if is enabled

The post edd_is_test_mode() first appeared on Easy Digital Downloads.

]]>
edd_update_option https://easydigitaldownloads.com/docs/edd_update_option/ Mon, 24 Jan 2022 19:58:08 +0000 https://edd-site.lndo.site/docs/edd_update_option/ Options specific to Easy Digital Downloads are stored in an array in a single WordPress option. For this reason it’s best to use edd_update_option() to change those options. edd_update_option() safely filters and updates an existing option. Input edd_update_option() takes two input variables. The first is the key name of the option desired.  The second is

The post edd_update_option first appeared on Easy Digital Downloads.

]]>
Options specific to Easy Digital Downloads are stored in an array in a single WordPress option. For this reason it’s best to use
edd_update_option() to change those options. edd_update_option() safely filters and updates an existing option.

Input

edd_update_option() takes two input variables. The first is the key name of the option desired.  The second is the value that should be stored in the option. The second value defaults to false. Example:

edd_update_option( $key = '', $value = false )

Usage

Here’s an example, updating the position of the currency indicator.  By default it’s set to ‘before’, this example will set it to ‘after’.

edd_update_option( 'currency_position', 'after' );

Output

This function returns true if the option is updated, otherwise false.

The post edd_update_option first appeared on Easy Digital Downloads.

]]>
EDD_PLUGIN_URL https://easydigitaldownloads.com/docs/edd_plugin_url/ Mon, 24 Jan 2022 19:58:07 +0000 https://edd-site.lndo.site/docs/edd_plugin_url/ This constant contains the URL to the Easy Digital Downloads plugin folder. The URL will look something like this: http://yoursite.com/wp-content/plugins/easy-digital-downloads/.

The post EDD_PLUGIN_URL first appeared on Easy Digital Downloads.

]]>
This constant contains the URL to the Easy Digital Downloads plugin folder. The URL will look something like this: http://yoursite.com/wp-content/plugins/easy-digital-downloads/.

The post EDD_PLUGIN_URL first appeared on Easy Digital Downloads.

]]>
edd_empty_cart_message https://easydigitaldownloads.com/docs/edd_empty_cart_message/ Mon, 24 Jan 2022 19:58:06 +0000 https://edd-site.lndo.site/docs/edd_empty_cart_message/ This filter is used when displaying the “your cart is empty” message and can be used to modify the message that is displayed. The sample below shows an example of how you could modify it: function my_custom_empty_cart_message($message) { return '' . $message . ' Please buy something.'; } add_filter('edd_empty_cart_message', 'my_custom_empty_cart_message'); This will add paragraph tags

The post edd_empty_cart_message first appeared on Easy Digital Downloads.

]]>
This filter is used when displaying the “your cart is empty” message and can be used to modify the message that is displayed. The sample below shows an example of how you could modify it:

function my_custom_empty_cart_message($message) {
	return '

' . $message . ' Please buy something.

'; } add_filter('edd_empty_cart_message', 'my_custom_empty_cart_message');

This will add paragraph tags around the message, and include the words “Please buy something”.

You can customize the “your cart is empty” message or even load specific content on the cart page when it is empty. You can do this without touching any PHP code with the
free Additional Shortcodes extension. Click here to learn more and download or read more about it on this article.

The post edd_empty_cart_message first appeared on Easy Digital Downloads.

]]>
edd_purchase_link_end https://easydigitaldownloads.com/docs/edd_purchase_link_end/ Mon, 24 Jan 2022 19:58:04 +0000 https://edd-site.lndo.site/docs/edd_purchase_link_end/ This action runs just after the purchase link is outputted, both for the `[purchase_link]` short code and the `edd_get_purchase_link()` function. do_action( 'edd_purchase_link_end', $download_id );

The post edd_purchase_link_end first appeared on Easy Digital Downloads.

]]>
This action runs just after the purchase link is outputted, both for the `[purchase_link]` short code and the `edd_get_purchase_link()` function.

do_action( 'edd_purchase_link_end', $download_id );

The post edd_purchase_link_end first appeared on Easy Digital Downloads.

]]>
edd_purchase_form_after_submit https://easydigitaldownloads.com/docs/edd_purchase_form_after_submit/ Mon, 24 Jan 2022 19:58:03 +0000 https://edd-site.lndo.site/docs/edd_purchase_form_after_submit/ This action runs at the end of the “edd_purchase_submit” fieldset and just after the purchase submit button.

The post edd_purchase_form_after_submit first appeared on Easy Digital Downloads.

]]>
This action runs at the end of the “edd_purchase_submit” fieldset and just after the purchase submit button.

The post edd_purchase_form_after_submit first appeared on Easy Digital Downloads.

]]>
edd_after_purchase_form https://easydigitaldownloads.com/docs/edd_after_purchase_form/ Mon, 24 Jan 2022 19:58:02 +0000 https://edd-site.lndo.site/docs/edd_after_purchase_form/ This action runs just after the purchase form, after the closing tag.

The post edd_after_purchase_form first appeared on Easy Digital Downloads.

]]>
This action runs just after the purchase form, after the closing

tag.

The post edd_after_purchase_form first appeared on Easy Digital Downloads.

]]>
edd_sale_notification https://easydigitaldownloads.com/docs/edd_sale_notification/ Mon, 24 Jan 2022 19:58:01 +0000 https://edd-site.lndo.site/docs/edd_sale_notification/ This filter can be used to customize the email that is sent to site admins when a download purchase is made. The filter accepts three parameters: $admin_message – an HTML string containing the contents of the email $payment_id – the numerical ID of the purchase $payment_data – an array of meta data for the payment

The post edd_sale_notification first appeared on Easy Digital Downloads.

]]>
This filter can be used to customize the email that is sent to site admins when a download purchase is made.

The filter accepts three parameters:

  • $admin_message – an HTML string containing the contents of the email
  • $payment_id – the numerical ID of the purchase
  • $payment_data – an array of meta data for the payment

The post edd_sale_notification first appeared on Easy Digital Downloads.

]]>
edd_email_template https://easydigitaldownloads.com/docs/edd_email_template/ Mon, 24 Jan 2022 19:58:00 +0000 https://edd-site.lndo.site/docs/edd_email_template/ The edd_email_template filter allows you to force a specific email template to be used for all emails sent through Easy Digital Downloads. function pw_edd_change_email_template() { add_filter( 'edd_email_template', 'pw_edd_set_email_template' ); } add_action( 'edd_email_send_before', 'pw_edd_change_email_template' ); function pw_edd_set_email_template( $template_name ) { return 'blue'; }

The post edd_email_template first appeared on Easy Digital Downloads.

]]>
The edd_email_template filter allows you to force a specific email template to be used for all emails sent through Easy Digital Downloads.

function pw_edd_change_email_template() {
	add_filter( 'edd_email_template', 'pw_edd_set_email_template' );
}
add_action( 'edd_email_send_before', 'pw_edd_change_email_template' );
function pw_edd_set_email_template( $template_name ) {
	return 'blue';
}

The post edd_email_template first appeared on Easy Digital Downloads.

]]>
edd_cart_item https://easydigitaldownloads.com/docs/edd_cart_item/ Mon, 24 Jan 2022 19:57:59 +0000 https://edd-site.lndo.site/docs/edd_cart_item/ The HTML for each item in the shopping cart (except on the checkout page) is passed through this filter. The filter includes one parameter, $item, which is a string containing the HTML code for the cart item. Each cart item is wrapped in tags.  

The post edd_cart_item first appeared on Easy Digital Downloads.

]]>
The HTML for each item in the shopping cart (except on the checkout page) is passed through this filter. The filter includes one parameter, $item, which is a string containing the HTML code for the cart item. Each cart item is wrapped in

  • tags.

     

The post edd_cart_item first appeared on Easy Digital Downloads.

]]>
edd_add_email_tag() https://easydigitaldownloads.com/docs/edd_add_email_tag/ Mon, 24 Jan 2022 19:57:57 +0000 https://edd-site.lndo.site/docs/edd_add_email_tag/ The edd_add_email_tag() function allows you to register custom email tags for purchase receipts and admin sale notifications and takes three parameters: Here’s an example snippet that you can use and extend as needed: https://library.wpcode.com/snippet/j578kp2g/

The post edd_add_email_tag() first appeared on Easy Digital Downloads.

]]>
The edd_add_email_tag() function allows you to register custom email tags for purchase receipts and admin sale notifications and takes three parameters:

  • $tag – The tag to register, such as “admin_email”. In the email settings, tags are wrapped with {} but not when they are registered.
  • $description – A description of what the tag displays.
  • $func – The call back function to render the tag’s output.

Here’s an example snippet that you can use and extend as needed: https://library.wpcode.com/snippet/j578kp2g/

The post edd_add_email_tag() first appeared on Easy Digital Downloads.

]]>
edd_email_purchase_receipt() https://easydigitaldownloads.com/docs/edd_email_purchase_receipt/ Mon, 24 Jan 2022 19:57:56 +0000 https://edd-site.lndo.site/docs/edd_email_purchase_receipt/ This function can be used for resending the email purchase receipt for any purchase. If you ever want to resend the purchase receipt, but need to use your own methods (instead of the built-in option in Downloads > Payment History), you can simply trigger this function: edd_email_purchase_receipt( $payment_id, false ); The first parameter if the

The post edd_email_purchase_receipt() first appeared on Easy Digital Downloads.

]]>
This function can be used for resending the email purchase receipt for any purchase.

If you ever want to resend the purchase receipt, but need to use your own methods (instead of the built-in option in Downloads > Payment History), you can simply trigger this function:

edd_email_purchase_receipt( $payment_id, false );

The first parameter if the ID of the purchase to resend the email for, and the second parameter is whether or not to send a notice to the admin as well (probably should leave this as false.

The post edd_email_purchase_receipt() first appeared on Easy Digital Downloads.

]]>
edd_api_output_after https://easydigitaldownloads.com/docs/edd_api_output_after/ Mon, 24 Jan 2022 19:57:55 +0000 https://edd-site.lndo.site/docs/edd_api_output_after/ This action runs just after the json/xml is printed to the screen when performing an EDD_API request. do_action( 'edd_api_output_after', $data, $api_object, $format );

The post edd_api_output_after first appeared on Easy Digital Downloads.

]]>
This action runs just after the json/xml is printed to the screen when performing an EDD_API request.

do_action( 'edd_api_output_after', $data, $api_object, $format );

The post edd_api_output_after first appeared on Easy Digital Downloads.

]]>
edd_complete_download_purchase https://easydigitaldownloads.com/docs/edd_complete_download_purchase/ Mon, 24 Jan 2022 19:57:54 +0000 https://edd-site.lndo.site/docs/edd_complete_download_purchase/ This action runs once for each download product that is purchased. It runs only once the payment is marked as complete. Since EDD v1.6 do_action( 'edd_complete_download_purchase', $download_id, $payment_id, $download_type );

The post edd_complete_download_purchase first appeared on Easy Digital Downloads.

]]>
This action runs once for each download product that is purchased. It runs only once the payment is marked as complete.

Since EDD v1.6

do_action( 'edd_complete_download_purchase', $download_id, $payment_id, $download_type );

The post edd_complete_download_purchase first appeared on Easy Digital Downloads.

]]>
edd_set_payment_transaction_id() https://easydigitaldownloads.com/docs/edd_set_payment_transaction_id/ Mon, 24 Jan 2022 19:57:53 +0000 https://edd-site.lndo.site/docs/edd_set_payment_transaction_id/ The  edd_set_payment_transaction_id() function is used to set the transaction ID related to a specific purchase. The function takes two parameters, one for the payment ID and one for the transaction ID: edd_set_payment_transaction_id( $payment_id, $transaction_id ); The transaction ID is passed through a filter called  edd_set_payment_transaction_id, which receives two parameters: $transaction_id $payment_id Transaction ID tracking was implemented in EDD v2.1.

The post edd_set_payment_transaction_id() first appeared on Easy Digital Downloads.

]]>
The 
edd_set_payment_transaction_id() function is used to set the transaction ID related to a specific purchase.

The function takes two parameters, one for the payment ID and one for the transaction ID:

edd_set_payment_transaction_id( $payment_id, $transaction_id );

The transaction ID is passed through a filter called 
edd_set_payment_transaction_id, which receives two parameters:

  • $transaction_id
  • $payment_id

Transaction ID tracking was implemented in EDD v2.1.

The post edd_set_payment_transaction_id() first appeared on Easy Digital Downloads.

]]>
EDD_Emails https://easydigitaldownloads.com/docs/edd_emails/ Mon, 24 Jan 2022 19:57:52 +0000 https://edd-site.lndo.site/docs/edd_emails/ Introduced in Easy Digital Downloads version 2.1, the EDD_Emails class handles the construction and sending of purchase receipts and admin sale notifications. It is also used by extensions to send custom emails in the standard HTML template. To send an email using the EDD_Emails, class, call the send() method from the main EDD() instance, like this: EDD()->emails->send( $to, $subject, $message

The post EDD_Emails first appeared on Easy Digital Downloads.

]]>
Introduced in Easy Digital Downloads version 2.1, the EDD_Emails class handles the construction and sending of purchase receipts and admin sale notifications. It is also used by extensions to send custom emails in the standard HTML template.

To send an email using the EDD_Emails, class, call the send() method from the main EDD() instance, like this:

EDD()->emails->send( $to, $subject, $message );

If you want to send attachments along with the email, pass the file paths as a string or array as a fourth parameter:

EDD()->emails->send( $to, $subject, $message, $attachments );

All emails sent through this class will have the template selected in Downloads > Settings > Emails applied. By default, it looks like this:

Screenshot from 2014-09-03 10:36:07

Class properties:

  • $from_address
  • $from_name
  • $content_type
  • $headers
  • $html
  • $template
  • $heading

Methods:

  • public: __set( $key, $value )
  • public: get_from_name()
  • public: get_from_address()
  • public: get_content_type()
  • public: get_headers()
  • public: get_templates()
  • public: get_template()
  • public: get_heading()
  • public: parse_tags()
  • public: build_email()
  • public: send()
  • public: send_before()
  • public: send_after()
  • public: text_to_html()

Filters:

  • edd_email_from_name
  • edd_email_from_address
  • edd_email_content_type
  • edd_email_headers
  • edd_email_templates
  • edd_email_template
  • edd_email_heading
  • edd_email_message
  • edd_email_attachments

Actions:

  • edd_email_header
  • edd_email_template_{template name}
  • edd_email_body
  • edd_email_footer
  • edd_email_send_before
  • edd_email_send_after

The post EDD_Emails first appeared on Easy Digital Downloads.

]]>
wp_ajax_edd_add_to_cart https://easydigitaldownloads.com/docs/wp_ajax_edd_add_to_cart/ Mon, 24 Jan 2022 19:57:51 +0000 https://edd-site.lndo.site/docs/wp_ajax_edd_add_to_cart/ This is the action that is run when an item is added to the cart by a logged-in user.

The post wp_ajax_edd_add_to_cart first appeared on Easy Digital Downloads.

]]>
This is the action that is run when an item is added to the cart by a logged-in user.

The post wp_ajax_edd_add_to_cart first appeared on Easy Digital Downloads.

]]>
EDD_DISABLE_ARCHIVE https://easydigitaldownloads.com/docs/edd_disable_archive/ Mon, 24 Jan 2022 19:57:50 +0000 https://edd-site.lndo.site/docs/edd_disable_archive/ This is a constant used when registering the download post type. By defining this constant, and setting it to true you can disable the post type archive for downloads. This is useful for sites where downloads are displayed manually, via short codes or template tags, rather than via default post type archives. To disable the post type archives, place

The post EDD_DISABLE_ARCHIVE first appeared on Easy Digital Downloads.

]]>
This is a constant used when registering the download post type. By defining this constant, and setting it to true you can disable the post type archive for downloads. This is useful for sites where downloads are displayed manually, via short codes or template tags, rather than via default post type archives.

To disable the post type archives, place this in your theme’s functions.php, or any custom plugin:

define('EDD_DISABLE_ARCHIVE', true);
// disable download post type archive

The post EDD_DISABLE_ARCHIVE first appeared on Easy Digital Downloads.

]]>
EDD REST API – Stats https://easydigitaldownloads.com/docs/edd-rest-api-stats/ Mon, 24 Jan 2022 19:57:49 +0000 https://edd-site.lndo.site/docs/edd-rest-api-stats/ The EDD REST API can return a great deal of statistical information about your store using the /stats/ endpoint. The stats query is used for retrieving earnings/sales stats from your store. It can be used to retrieve total earnings for the current month, last year, a specific date rage, etc, as well as the same

The post EDD REST API – Stats first appeared on Easy Digital Downloads.

]]>
The
EDD REST API can return a great deal of statistical information about your store using the /stats/ endpoint. The stats query is used for retrieving earnings/sales stats from your store. It can be used to retrieve total earnings for the current month, last year, a specific date rage, etc, as well as the same options for sales. It can also be used for retrieving earnings / sales stats for any or all products.

The stats endpoint is:

http://example.com/edd-api/stats/?key=c281cf0a95be875d9eeb284fb004c938&token=5f9432f3ffa5945755ebc66179810d70&type=

Note that the
stats query requires a type parameter to be passed. There are two type options:

  • sales – For retrieving sale stats.
  • earnings – For retrieving earning stats.

Both
sales and earnings query types include additional parameters for date and product options:

  • date – The date to retrieve earnings or sales for. This has three accepted values:
    • today – Will retrieve stats for the current day.
    • yesterday – Will retrieve stats for the previous day.
    • range – Will retrieve stats for a date range.
      • startdate – Format: YYYYMMDD. Example: 20120224 = 2012/02/24
      • enddate – Format: YYYYMMDD. Example: 20120531 = 2012/02/24
  • product – used to retrieve sale or earnings stats for a specific product, or all products. This option has two accepted values:
    • # – The product ID to retrieve stats for.
    • all – Retrieve stats for all products. This option does not support paging.

Note: the product and date options cannot be combined. You may only use one or the other.

A basic earnings stats query looks like this:

http://example.com/edd-api/stats/?key=c281cf0a95be875d9eeb284fb004c938&token=5f9432f3ffa5945755ebc66179810d70&type=earnings

And the response is:

{
    "earnings": {
        "current_month": 20,
        "last_month": 311.96,
        "totals": 1302.2764
    }
}

A basic sales stats query looks like this:

http://yoursite.com/edd-api/stats/?key=c281cf0a95be875d9eeb284fb004c938&token=5f9432f3ffa5945755ebc66179810d70&type=sales

And the response is:

{
    "sales": {
        "current_month": 1,
        "last_month": 18,
        "totals": 71
    }
}

If passing a date of
today or yesterday, the query looks like this:

http://yoursite.com/edd-api/stats/?key=c281cf0a95be875d9eeb284fb004c938&token=5f9432f3ffa5945755ebc66179810d70&type=sales&date=today

And the response:

{
    "sales": {
        "today": 1
    }
}

If passing a date range, the query will be:

http://yoursite.com/edd-api/stats/?key=c281cf0a95be875d9eeb284fb004c938&token=5f9432f3ffa5945755ebc66179810d70&type=sales&date=range&startdate=20130201&enddate=20130210

And the response:

{
    "totals": 12,
    "sales": {
        "20130201": 0,
        "20130202": 0,
        "20130203": 0,
        "20130204": 0,
        "20130205": 0,
        "20130206": 1,
        "20130207": 0,
        "20130208": 0,
        "20130209": 11,
        "20130210": 0
    }
}

Each item in the
sales object represents the day and the value is the amount.

If passing the
product parameter, like so

http://yoursite.com/edd-api/stats/?key=c281cf0a95be875d9eeb284fb004c938&token=5f9432f3ffa5945755ebc66179810d70&type=sales&product=all

the response will be:

{
    "sales": [
        {
            "test-2": "6"
        },
        {
            "simple-notices-pro": "48"
        },
        {
            "love-it-pro": "13"
        },
        {
            "test-product-2-2": "0"
        },
        {
            "test-product-1-2": "0"
        }
    ]
}

Or for an individual product:

http://yoursite.com/edd-api/stats/?key=c281cf0a95be875d9eeb284fb004c938&token=5f9432f3ffa5945755ebc66179810d70&type=sales&product=16

Response:

{
    "sales": [
        {
            "simple-notices-pro": "48"
        }
    ]
}

The post EDD REST API – Stats first appeared on Easy Digital Downloads.

]]>
edd_insert_payment https://easydigitaldownloads.com/docs/edd_insert_payment/ Mon, 24 Jan 2022 19:57:48 +0000 https://edd-site.lndo.site/docs/edd_insert_payment/ This actions runs just after a payment is inserted into the database. do_action( 'edd_insert_payment', $payment_id, $payment_data ); $payment_id is the ID number of the payment that has just been created. $payment_data is an array of data associated with the payment, such as price, user email, user id, purchase key, cart items, and other pieces of

The post edd_insert_payment first appeared on Easy Digital Downloads.

]]>
This actions runs just after a payment is inserted into the database.

do_action( 'edd_insert_payment', $payment_id, $payment_data );

$payment_id is the ID number of the payment that has just been created.

$payment_data is an array of data associated with the payment, such as price, user email, user id, purchase key, cart items, and other pieces of payment meta.

Note, payments are usually created with a status of “pending”, so this action is not reliable to use if you wish to perform a function when purchases are marked as complete. Use 
edd_update_payment_status instead.

The post edd_insert_payment first appeared on Easy Digital Downloads.

]]>
edd_format_amount() https://easydigitaldownloads.com/docs/edd_format_amount/ Mon, 24 Jan 2022 19:57:47 +0000 https://edd-site.lndo.site/docs/edd_format_amount/ This function can be used for format a given price. It will return the result formatted to the correct number of decimals. echo edd_format_amount( 9.5 ); You could combine it with edd_get_download_price() to return the formatted price for any download: echo edd_format_amount( edd_get_download_price( $download_id ) ); If you wish to include a currency symbol you

The post edd_format_amount() first appeared on Easy Digital Downloads.

]]>
This function can be used for format a given price. It will return the result formatted to the correct number of decimals.

echo edd_format_amount( 9.5 );

You could combine it with edd_get_download_price() to return the formatted price for any download:

echo edd_format_amount( edd_get_download_price( $download_id ) );

If you wish to include a currency symbol you can filter the output with edd_currency_filter.

echo edd_currency_filter( edd_format_amount( edd_get_download_price( $download_id ) ) );

The post edd_format_amount() first appeared on Easy Digital Downloads.

]]>
Adding HTML before or after Download product content https://easydigitaldownloads.com/docs/adding-html-before-or-after-download-product-content/ Mon, 24 Jan 2022 19:57:46 +0000 https://edd-site.lndo.site/docs/adding-html-before-or-after-download-product-content/ You can easily append custom HTML before or after the Download product content by using the  edd_before_download_content and/or edd_after_download_content hooks. For example, to add content before the main product content, you can use something like this: function pw_edd_before_download_content( $download_id ) { echo 'This is content added before the main product content.'; } add_action( 'edd_before_download_content', 'pw_edd_before_download_content' );

The post Adding HTML before or after Download product content first appeared on Easy Digital Downloads.

]]>
You can easily append custom HTML before or after the Download product content by using the 
edd_before_download_content and/or edd_after_download_content hooks.

For example, to add content before the main product content, you can use something like this:

function pw_edd_before_download_content( $download_id ) {
	echo 'This is content added before the main product content.';
}
add_action( 'edd_before_download_content', 'pw_edd_before_download_content' );

The post Adding HTML before or after Download product content first appeared on Easy Digital Downloads.

]]>
edd_get_variable_prices() https://easydigitaldownloads.com/docs/edd_get_variable_prices/ Mon, 24 Jan 2022 19:57:44 +0000 https://edd-site.lndo.site/docs/edd_get_variable_prices/ This function will return an array of all of the variable prices set for the provided download ID. $prices = edd_get_variable_prices( $download_id ); if( $prices ) { foreach( $prices as $price_id => $price ) { // $price['name'] is the name of the price // $price['amount'] is the amount of the price } }

The post edd_get_variable_prices() first appeared on Easy Digital Downloads.

]]>
This function will return an array of all of the variable prices set for the provided download ID.

$prices = edd_get_variable_prices( $download_id );
if( $prices ) {
	foreach( $prices as $price_id => $price ) {
		// $price['name'] is the name of the price
		// $price['amount'] is the amount of the price
	}
}

The post edd_get_variable_prices() first appeared on Easy Digital Downloads.

]]>
EDD REST API – Customers https://easydigitaldownloads.com/docs/edd-rest-api-customers/ Mon, 24 Jan 2022 19:57:43 +0000 https://edd-site.lndo.site/docs/edd-rest-api-customers/ The EDD REST API provides an endpoint called /customers/. The customers endpoint allows for you to query the database and retrieve a list of customers that have purchased items from your shop. A basic customers query looks like this: http://yoursite.com/edd-api/customers/?key=c281cf0a95be875d9eeb284fb004c938&token=5f9432f3ffa5945755ebc66179810d70&number=25 For each customer returned, the following information is returned for each customer: id – The

The post EDD REST API – Customers first appeared on Easy Digital Downloads.

]]>
The
EDD REST API provides an endpoint called /customers/. The customers endpoint allows for you to query the database and retrieve a list of customers that have purchased items from your shop. A basic customers query looks like this:

http://yoursite.com/edd-api/customers/?key=c281cf0a95be875d9eeb284fb004c938&token=5f9432f3ffa5945755ebc66179810d70&number=25

For each customer returned, the following information is returned for each customer:

  • id – The WordPress user ID. If the customer purchased as a guest, this will return as -1.
  • username – The WordPress user login name. If the customer purchased as a guest, this will return as nothing.
  • display_name – The WordPress user display name. If the customer purchased as a guest, this will return as nothing.
  • first_name – The customer first name.
  • last_name – The customer last name.
  • email – The customer’s email address.
  • total_purchases – The total number of purchases the customer has made.
  • total_spent – The total amount the customer has spent.
  • total_downloads – The total number of files the customer has downloaded.

Along with the data returned for each customer is a
stats object that shows the total number of customers in the database.

A customers query response looks like this:

{
    "customers": [
        {
            "info": {
                "id": -1,
                "username": "Guest",
                "display_name": "Guest",
                "first_name": "Guest",
                "last_name": "Guest",
                "email": "johnson@test.com"
            },
            "stats": {
                "total_purchases": 2,
                "total_spent": "20",
                "total_downloads": 0
            }
        },
        {
            "info": {
                "id": -1,
                "username": "Guest",
                "display_name": "Guest",
                "first_name": "Guest",
                "last_name": "Guest",
                "email": "asda@test.com"
            },
            "stats": {
                "total_purchases": 0,
                "total_spent": "0",
                "total_downloads": 0
            }
        }
    ]
}

If you wish to retrieve the info for a specific customer, you can add the
&customer={identifier} parameter, like this:

http://yoursite.com/edd-api/customers/?key=c281cf0a95be875d9eeb284fb004c938&token=5f9432f3ffa5945755ebc66179810d70&customer=1

or

http://yoursite.com/edd-api/customers/?key=c281cf0a95be875d9eeb284fb004c938&token=5f9432f3ffa5945755ebc66179810d70&customer=email@domain.com

The response for a single customer will be like this:

{
    "customers": [
        {
            "info": {
                "id": 1,
                "username": "pippin",
                "display_name": "Pippin Williamson",
                "first_name": "Pippin",
                "last_name": "Williamson",
                "email": "pippin@pippinsplugins.com"
            },
            "stats": {
                "total_purchases": 61,
                "total_spent": 1139.68,
                "total_downloads": 31
            }
        }
    ]
}

The post EDD REST API – Customers first appeared on Easy Digital Downloads.

]]>
EDD REST API – Versioning https://easydigitaldownloads.com/docs/edd-rest-api-versioning/ Mon, 24 Jan 2022 19:57:42 +0000 https://edd-site.lndo.site/docs/edd-rest-api-versioning/ Since v1.5, Easy Digital Downloads includes a complete RESTful API that allows store data to be retrieved remotely in either a jSON or XML format. The API includes methods for retrieving info about store products, store customers, store sales, and store earnings. EDD 2.4 introduces API Versioning to allow for adding new functionality while not

The post EDD REST API – Versioning first appeared on Easy Digital Downloads.

]]>
Since v1.5, Easy Digital Downloads includes a complete RESTful API that allows store data to be retrieved remotely in either a jSON or XML format. The API includes methods for retrieving info about store products, store customers, store sales, and store earnings.

EDD 2.4 introduces API Versioning to allow for adding new functionality while not breaking past functionality for those that need it.

There are two methods of specifying an API version.
First is adding /v{number}/ to your API URL like this:
Second is adding a constant to your wp-config.php file like this:
define( 'EDD_API_VERSION', 'v2' );
If neither of these methods is used the latest version of the API is always delivered simply by going to /edd-api/sales with the proper token and API key.

The post EDD REST API – Versioning first appeared on Easy Digital Downloads.

]]>
Managing Easy Digital Downloads Email Tags https://easydigitaldownloads.com/docs/managing-easy-digital-downloads-email-tags/ Mon, 24 Jan 2022 19:57:41 +0000 https://edd-site.lndo.site/docs/managing-easy-digital-downloads-email-tags/ Easy Digital Downloads uses template tags to allow you to insert data into your emails.  These are simply functions that output data for rendering in the email.  These are the default template tags: EDD has built-in functions to help you create new tags, remove existing tags, and test to see if a given tag exists.

The post Managing Easy Digital Downloads Email Tags first appeared on Easy Digital Downloads.

]]>
Easy Digital Downloads uses template tags to allow you to insert data into your emails.  These are simply functions that output data for rendering in the email.  These are the default template tags:

  • {download_list} – A list of downloads with clickable links for each download purchased
    Note: The Sale Notification email will not include clickable links, as those are only intended for the customer’s email receipt.
  • {file_urls} – A plain-text list of download URLs for each download purchased
  • {name} – The buyer’s first name
  • {fullname} – The buyer’s full name, first and last
  • {username} – The buyer’s user name on the site, if they registered an account
  • {user_email} – The buyer’s email address
  • {billing_address} – The buyer’s billing address
  • {date} – The date of the purchase
  • {subtotal} – The price of the purchase before taxes
  • {tax} – The taxed amount of the purchase
  • {price} – The total price of the purchase
  • {payment_id} – The unique ID number for this purchase
  • {receipt_id} – The unique ID number for this purchase receipt
  • {payment_method} – The method of payment used for this purchase
  • {sitename} – Your site name
  • {receipt_link} – Adds a link so users can view their receipt directly on your website if they are unable to view it in the browser correctly.
  • {discount_codes} – Adds a list of any discount codes applied to this purchase
  • {ip_address} – The buyer’s IP Address

EDD has built-in functions to help you create new tags, remove existing tags, and test to see if a given tag exists.

Adding a New Tag

Here’s an example snippet that you can use and extend as needed: https://library.wpcode.com/snippet/j578kp2g/

Removing a Tag

If you’re removing a tag you created, simply remove all the code you wrote to make it.  Once the transient expires then it’ll be gone.  If you want to remove a core tag, you can use something like the example below:

function edd_my_remove_tags() {
edd_remove_email_tag( 'name' );
}
add_action( 'edd_add_email_tags', 'edd_my_remove_tags', 99 );

In the example above, ‘name’ is the name of the tag.  We still hook into edd_add_email_tags even though we’re removing it. Note the priority of 99. WordPress default action-hook priority is 10. By overriding that and setting it to 99, we are telling it to run after any other hooked function with a priority less than 99. If the email tag you are trying to remove happens to get added in a function with a priority higher than 99, you’ll have to increase the priority to make sure it is greater than that number – and thus runs “after” the tag is added. Essentially, you can’t remove a tag that has not been added yet.

Looking for a Tag

If you want to see if a tag exists then you can do something like this:

if ( edd_email_tag_exists( 'name' ) ) {
	echo "Yep!";
}

edd_email_tag_exists() returns boolean.

The post Managing Easy Digital Downloads Email Tags first appeared on Easy Digital Downloads.

]]>
edd_get_option https://easydigitaldownloads.com/docs/edd_get_option/ Mon, 24 Jan 2022 19:57:40 +0000 https://edd-site.lndo.site/docs/edd_get_option/ Options specific to Easy Digital Downloads are stored in an array in a single WordPress option. For this reason it’s best to use edd_get_option() to get those options. edd_get_option() safely finds the desired option and returns it.  Additionally, it applies a filter to the output. Input edd_get_option() takes two input variables. The first is the

The post edd_get_option first appeared on Easy Digital Downloads.

]]>
Options specific to Easy Digital Downloads are stored in an array in a single WordPress option. For this reason it’s best to use
edd_get_option() to get those options. edd_get_option() safely finds the desired option and returns it.  Additionally, it applies a filter to the output.

Input

edd_get_option() takes two input variables. The first is the key name of the option desired.  The second is a default value if the key is not found in the option array. The second value defaults to false.

Usage

Here’s an example, looking for the position of the currency indicator.  If it’s not found, $position will get a value of ‘before’.

$position = edd_get_option( 'currency_position', 'before' );

Output

The output of this function will be whatever was stored in the option, OR the default. The return function applies a filter that looks like this:

return apply_filters( 'edd_get_option_' . $key, $value, $key, $default );

Using the example from the Usage section then the filter would be named
edd_get_option_currency_position.

The post edd_get_option first appeared on Easy Digital Downloads.

]]>
Add fields to variable price options https://easydigitaldownloads.com/docs/add-fields-to-variable-price-options/ Mon, 24 Jan 2022 19:57:39 +0000 https://edd-site.lndo.site/docs/add-fields-to-variable-price-options/ Starting with Easy Digital Downloads 2.8, developers can use the new  edd_download_price_option_row action to output their variable price options. Here is an example of how to integrate with the new advanced variable price options user interface:

The post Add fields to variable price options first appeared on Easy Digital Downloads.

]]>
Starting with Easy Digital Downloads 2.8, developers can use the new 
edd_download_price_option_row action to output their variable price options. Here is an example of how to integrate with the new advanced variable price options user interface:

The post Add fields to variable price options first appeared on Easy Digital Downloads.

]]>
edd_purchase_receipt https://easydigitaldownloads.com/docs/edd_purchase_receipt/ Mon, 24 Jan 2022 19:57:38 +0000 https://edd-site.lndo.site/docs/edd_purchase_receipt/ This filter can be used to modify the purchase receipt email that is sent to users after purchasing downloads. The filter accepts three parameters: $message – an HTML string containing the contents of the email $payment_id – the numerical ID of the purchase $payment_data – an array of the payment meta data An example of

The post edd_purchase_receipt first appeared on Easy Digital Downloads.

]]>
This filter can be used to modify the purchase receipt email that is sent to users after purchasing downloads.

The filter accepts three parameters:

  • $message – an HTML string containing the contents of the email
  • $payment_id – the numerical ID of the purchase
  • $payment_data – an array of the payment meta data

An example of how you can append additional information to the purchase receipt is below:

function add_to_purchase_receipt($message, $payment_id, $purchase_data) {
	// add custom text to the end of the receipt
	$message .= "nnThis is custom text added to the end of the purchase receipt";
	return $message;
}
add_filter('edd_purchase_receipt', 'add_to_purchase_receipt', 10, 3);

The post edd_purchase_receipt first appeared on Easy Digital Downloads.

]]>
EDD_Fees Class https://easydigitaldownloads.com/docs/edd_fees-class/ Mon, 24 Jan 2022 19:57:37 +0000 https://edd-site.lndo.site/docs/edd_fees-class/ The  EDD_Fees class can be used to add arbitrary fees to the shopping cart, both positive and negative (discount) fees. For example, you could add a special 10% off fee automatically for all registered users that have a certain user role, or add a “handling” fee for all products inside of a certain category. The

The post EDD_Fees Class first appeared on Easy Digital Downloads.

]]>
The  EDD_Fees class can be used to add arbitrary fees to the shopping cart, both positive and negative (discount) fees. For example, you could add a special 10% off fee automatically for all registered users that have a certain user role, or add a “handling” fee for all products inside of a certain category. The options are limitless.

This class is only available in EDD v1.5+

Fees are stored as session variables, which means once they’re set for a user they’ll persist until either the user checks out or they’re removed by some code based on a decision or setting.

Types of fees

Fees can have two types:

fee
This is just what it sounds like, an additional cost or discount added to the subtotal of purchases.
item
This is a fee that is not associated with anything else, think of it like a temporary product made up on the spot. Currently used for Wallet deposits for example.

Note: negative fees always set no_tax to true.

add_fee()

Adding an expense or giving a discount are both considered adding fees, despite the fact that one of them is removing money.

Adding a fee is done with code similar to this:

function pw_set_admin_discount() {
    // check to see the customer is a site admin
    if( current_user_can( 'manage_options' ) ) {
	// find 20% of the total
        $amount = edd_get_cart_subtotal() * 0.20;

	// flip the 20% from a positive number to a negative number
        $amount = $amount * -1;

	// Add the fee, sending the amount, the reason printed to the front end, and the handle
        EDD()->fees->add_fee( $amount, 'You are an admin special!', 'admin_special' );
    }
}
// run this code on site init
add_action( 'init', 'pw_set_admin_discount' );

This example automatically adds a 20% discount if the current user is an admin.

Here’s another example that adds a handling fee:

function pw_add_handling_fee() {
	// Add a $10 handling fee no matter what
	EDD()->fees->add_fee( '10', 'Handling Fee', 'handling_fee' );
}
add_action( 'init', 'pw_add_handling_fee' );

The first parameter is the fee amount, the second parameter is the label (as shown on the checkout/purchase history screens), and the third parameter is the fee ID.

Here’s a screenshot of both of the above examples being applied at the same time:

The above examples were for simply adding arbitrary fees, but add_fees() can also take the following arguments:

$args = array(
	'price_id'    => $price_id,
	'amount'      => $amount,
	'label'       => $label,
	'id'          => $id,
	'type'        => $type,
	'no_tax'      => false,
	'download_id' => 0
);

remove_fee()

To remove a fee, simply pass the fee ID (third parameter above) to the remove_fee() method:

function pw_remove_handling_fee() {
	EDD()->fees->remove_fee( 'handling_fee' );
}
add_action( 'init', 'pw_remove_handling_fee', 9999 );

Other Methods

In addition to simply adding and removing fees there are a number of methods for working with fees on the back end.

has_fees( string $type = ‘fee’  )

This method simply checks to see if any fees exist.  Defaults to the fee type, but can accept item as well.

Example:

if ( EDD()->fees->has_fees() ) {
	echo 'yep, we can haz fees!';
}

Returns: true or false.

get_fees( string $type = ‘fee’, integer $download_id = 0  )

This method will get an array of all existing fees.  It can be limited by type and/or download id.

Example

The  Simple Shipping extension is a perfect example of how the EDD_Fees class can be used.

$fees = EDD()->fees->get_fees();

Returns something like this:

Array
(
    [handling_fee] => Array
        (
            [amount]      => 11.00
            [label]       => Handling Fee
            [type]        => fee
            [no_tax]      => 
            [download_id] => 0
            [price_id]    =>
        )

    [admin_special] => Array
        (
            [amount]      => -2
            [label]       => You are an admin special!
            [type]        => fee
            [no_tax]      => 
            [download_id] => 0
            [price_id]    =>
        )

    [tophers_fee] => Array
        (
            [amount]      => 42.00
            [label]       => Topher's fee
            [no_tax]      => 
            [type]        => fee
            [download_id] => 114
            [price_id]    =>
        )

)
get_fee( string $id = ”  )

This method will get an array of a specific fee, identified by the name it was given when it was created.  

Example: 

$my_custom_fee = EDD()->fees->get_fee( 'my_custom_fee' );

Returns something like this:

 Array
(
    [amount] => 42.00
    [label] => The Final Fee
    [no_tax] => 
    [type] => fee
    [download_id] => 114
)
type_total( string $type = ‘fee’  )

This method calculate the total for a specific type of fee.  The types supported are ‘fee’ and ‘item’.

Example: 

$item_total = EDD()->fees->type_total( 'item' );

Returns an number like 51.00

total( integer $download_id = 0  )

This method calculate the total for all fees OR all fees specifically attached to a given download.

Note: If a product has fees and variable prices, The fee will only be applied once per transaction, NOT once per item.

Example:

$total = EDD()->fees->total();

$total = EDD()->fees->total( '42' );

In the example above, the first would return a number like 51.00 that is the sum of all fees.

The second example would return a number like 51.00 that is the sum of all fees tied specifically to the Download with the ID of 42.

record_fees( array $payment_meta, array $payment_data )

This method records the fee information about a specific transaction.  It should never be called directly.

The post EDD_Fees Class first appeared on Easy Digital Downloads.

]]>
edd_add_to_cart https://easydigitaldownloads.com/docs/edd_add_to_cart/ Mon, 24 Jan 2022 19:57:35 +0000 https://edd-site.lndo.site/docs/edd_add_to_cart/ This action runs when an item is added to the cart. Does not run when an item is added with ajax.

The post edd_add_to_cart first appeared on Easy Digital Downloads.

]]>
This action runs when an item is added to the cart. Does not run when an item is added with ajax.

The post edd_add_to_cart first appeared on Easy Digital Downloads.

]]>
EDD_HTML_Elements https://easydigitaldownloads.com/docs/edd_html_elements/ Mon, 24 Jan 2022 19:57:34 +0000 https://edd-site.lndo.site/docs/edd_html_elements/ The EDD_HTML_Elements class provides a series of helper methods for rendering commonly used HTML fields with consistent markup, class names, and attributes. The class includes methods for the following field types: product_dropdown() This method creates a select html element with products in it. Values are product_ids and the text is Download titles. Example: echo EDD()->html->product_dropdown();

The post EDD_HTML_Elements first appeared on Easy Digital Downloads.

]]>
The EDD_HTML_Elements class provides a series of helper methods for rendering commonly used HTML fields with consistent markup, class names, and attributes.

The class includes methods for the following field types:

product_dropdown()

This method creates a
select html element with products in it. Values are product_ids and the text is Download titles.

Example:

echo EDD()->html->product_dropdown();

This would create a drop down list of products.  The method takes one input, an array, and has these defaults:

$defaults = array(
	'name'        => 'products',
	'id'          => 'products',
	'class'       => '', 
	'multiple'    => false,
	'selected'    => 0,
	'chosen'      => false,
	'number'      => 30, 
	'bundles'     => true,
	'placeholder' => sprintf( __( 'Select a %s', 'easy-digital-downloads' ), edd_get_label_singular() )
);

Here’s a description of what’s in each option:

name

This would be the html “name” property of the form element.  Defaults to ‘products’.

Example:


class

This would be the “class” property of the html element.  Defaults to nothing.

Example:


id

This would be the html “id” property of the html element.  Defaults to ‘customers’.

Example:


multiple

This makes the select menu be of the “multiple” type. Defaults to false.

Example:

selected

This allows you to provide a customer_id and have that one be pre-selected when the form loads.  Defaults to 0.

chosen

This activated the “chosen” jquery plugin on your select box.  Defaults to false.

Examples both closed and open:

number

This allows you to set a limit to the number of customers in your list.  Defaults to 30.

placeholder

This is the text that goes in the first line of the select list, usually something like a title. The default is “Select a Customer”.

discount_dropdown()

This method creates a
select html element with a list of Discounts in it. Values are discount_ids and the text is the title of the Discount.

Example:

echo EDD()->html->discount_dropdown();

This would create a drop down list of discounts.

Input

This method takes three values as input.

name

This is the name of the html element.  The default is ‘edd_discounts’

selected

This is the item that should be selected when the select box loads.  The default is to have nothing set to be selected, and the default item will be the first discount on the list.

status

Discounts can be active or inactive.  The ‘status’ option allows a choice of either one.  The default is to not declare, and all Discounts are loaded.

category_dropdown()

This method creates a
select html element with a list of Download categories in it. Values are term_ids and the text is the title of the category.

Example:

echo EDD()->html->category_dropdown();

This would create a drop down list of Download categories.

Input

This method takes two values as input.

name

This is the name of the html element.  The default is ‘edd_categories’

selected

This is the item that should be selected when the select box loads. The default is to have nothing set to be selected, and the select box will have an option titled “All Categories”.

year_dropdown()

This method creates a
select html element with a list of years in it. Text and option value are both a 4 digit year.

Example:

echo EDD()->html->year_dropdown();

This would create a drop down list of 6 years, current year selected by default.

Input

This method takes two values as input.

name

This is the name of the html element.  The default is ‘year’

selected

This is the item that should be selected when the select box loads.  Requires a four digit integer.

month_dropdown()

This method creates a
select html element with a list of months in it. Values are unpadded integers and text is three letter abbreviations of months.

Example:

echo EDD()->html->year_dropdown();

This would create a drop down list of 12 months, current month selected by default.

Input

This method takes two values as input.

name

This is the name of the html element.  The default is ‘month’

selected

This is the item that should be selected when the select box loads. Requires a two digit integer.

select()

This method creates a
select html element and allows you to populate it with any single dimensional array.

Example:

echo EDD()->html->select( $args );

The method takes one input, an array, and has these defaults:

$args = array(
    'options'          => array(),
    'name'             => null,
    'class'            => '',
    'id'               => '',
    'selected'         => 0,
    'chosen'           => false,
    'placeholder'      => null,
    'multiple'         => false,
    'show_option_all'  => _x( 'All', 'all dropdown items', 'easy-digital-downloads' ),
    'show_option_none' => _x( 'None', 'no dropdown items', 'easy-digital-downloads' ),
);

Here’s a description of what’s in each option:

options

This is a single dimensional array of things like this:

$args['options'] = array(
    '1' => 'Thing 1',
    '2' => 'Thing 2',
    '3' => 'Thing 3',
    '4' => 'Thing 4',
);

The array keys are used as the select option values, and the array values are used as the select option text.

name

This would be the html “name” property of the form element.  Defaults to null, required to make a useful form element.

id

This would be the html “id” property of the html element.  Defaults to empty.

class

This would be the “class” property of the html element.  Defaults to empty.

multiple

This makes the select menu be of the “multiple” type. Defaults to false.

Example:

selected

This allows you to provide a key from your array and have that one be pre-selected when the form loads.  Defaults to 0.

chosen

This activated the “chosen” jquery plugin on your select box.  Defaults to false.

Examples both closed and open:

placeholder

This is the text that goes in the first line of the select list, usually something like a title. The default is null.

show_option_all

This creates a select option with a value of “all”, and is inserted into the argument list this way:

'show_option_all'  => _x( 'All', 'all dropdown items', 'easy-digital-downloads' ),
show_option_none

This creates a select option with a value of “-1”, and is inserted into the argument list this way:

'show_option_all'  => _x( 'None', 'no dropdown items', 'easy-digital-downloads' ),

checkbox()

This method creates a single
checkbox html element.

Note: This function does not create any wrapping HTML like .

Example:


The method takes one input, an array, and has these defaults:

$args = array(
    'name'     => null,
    'current'  => null,
    'class'    => 'edd-checkbox',
    'options'  => array(
        'disabled' => false,
        'readonly' => false
    )   
);

Here’s a description of what’s in each option:

name

This would be the html “name” property of the form element.  Defaults to null, required to make a useful form element.

Note: the name is also used for the ‘id’.

current

This is the pre-existing value of the field. It’s used to determine if the checkbox should default to checked.

class

This is the value of the ‘class’ html element. Defaults to ‘edd-checkbox’.

options

This needs to be an array, and can hold two options.

  • disabled – Sets the field to disabled or not with true or false.
  • readonly – Sets the field to readonly or not with true or false.

text()

This method creates a plain text html element.

Example:

html->text( $args ); ?>

The method takes one input, an array, and has these defaults:

$args = array(
    'id'           => '',  
    'name'         => 'text', 
    'value'        => NULL, 
    'label'        => NULL, 
    'desc'         => NULL, 
    'placeholder'  => '',  
    'class'        => 'regular-text',
    'disabled'     => false,
    'autocomplete' => '',
    'data'         => false
);

Here’s a description of what’s in each option:

id

This would be the html “id” property of the html element.  Defaults to empty.

name

This would be the html “name” property of the form element.  Defaults to “text”.

value

This is the pre-existing value of the field. It’s used to pre-fill the text field with this value. Defaults to NULL.

label

This is the text wrapped in a

desc

This is text that is wrapped in a span with a class of “edd-description”.  It’s placed between the label and the input.  Defaults to NULL.

placeholder

This text is placed in the “placeholder” element of the .  Rendering depends on the browser.  
You can read more about the placeholder element at w3schools.  Default is empty.

class

This is the value of the ‘class’ html element. Defaults to ‘regular-text’.

disabled

This sets the field to disabled or not.  Boolean, defaults to false.

autocomplete

This sets the autocomplete element to “on” or “off”.  Defaults to empty, which equates to on in most modern browsers.

data

This accepts an array, and creates data html elements from the array. Example:

array(
	'price' => '42.00',
	'variable-price' => 'no',
);

The above array would result in this html being places inside the input:

data-price="42.00" data-variable-price="no"

Defaults to false.

textarea()

This creates a standard multi-line HTML textarea.

Example:

html->textarea( $args ); ?>

The method takes one input, an array, and has these defaults:

$args = array(
    'name'        => 'textarea',
    'value'       => null,
    'label'       => null,
    'desc'        => null,
    'class'       => 'large-text',
    'disabled'    => false
);

Here’s a description of what’s in each option.

name

This would be the html “name” property of the form element.  Defaults to “textarea”.

value

This is the pre-existing value of the field. It’s used to pre-fill the text field with this value. Defaults to NULL.

label

This is the text wrapped in a

desc

This is text that is wrapped in a span with a class of “edd-description”.  It’s placed after the textarea tag.  Defaults to NULL.

class

This is the value of the ‘class’ html element. Defaults to ‘large-text’.

disabled

This sets the field to disabled or not.  Boolean, defaults to false.

ajax_user_search()

This method creates a text field for searching for EDD users.  It uses ajax to search as you type, and allows you to click to choose a result to populate the field.

Note: this field only works on EDD admin pages.  Not the front of WordPress, and not other WordPress admin areas.

Example:

html->ajax_user_search( $args ); ?>

The method takes one input, an array, and has these defaults:

$args = array(
    'name'        => 'user_id',
    'value'       => NULL,
    'placeholder' => __( 'Enter username', 'easy-digital-downloads' ),
    'label'       => NULL,
    'class'       => '',  
    'disabled'    => false,
    'autocomplete'=> 'off',
);

Here’s a description of what’s in each option.

name

This would be the html “name” property of the form element.  Defaults to “user_id”.

value

This is the pre-existing value of the field. It’s used to pre-fill the text field with this value. Defaults to NULL.

placeholder

This text gets rendered in the input box in most browsers. Defaults to:

__( 'Enter username', 'easy-digital-downloads' )
label

This text does not appear on the front of the site, but is used with aria for screen readers. Defaults to NULL.

class

This is the value of the ‘class’ html element. Defaults to empty.

disabled

This sets the field to disabled or not.  Boolean, defaults to false.

autocomplete

This sets the autocomplete element to “on” or “off”.  Defaults to empty, which equates to on in most modern browsers.

The post EDD_HTML_Elements first appeared on Easy Digital Downloads.

]]>
Registering after payment actions https://easydigitaldownloads.com/docs/registering-after-payment-actions/ Mon, 24 Jan 2022 19:57:33 +0000 https://edd-site.lndo.site/docs/registering-after-payment-actions/ Update: As of EDD 3.2.0, the edd_after_payment_actions have been deprecated in favor of edd_after_order_actions. This new hook behaves in the same way that the after payment actions do, with the primary difference being that instead of passing the EDD_Payment object, it passes the more efficient Order object. View the After Order Actions documentation In Easy

The post Registering after payment actions first appeared on Easy Digital Downloads.

]]>
Update: As of EDD 3.2.0, the edd_after_payment_actions have been deprecated in favor of edd_after_order_actions. This new hook behaves in the same way that the after payment actions do, with the primary difference being that instead of passing the EDD_Payment object, it passes the more efficient Order object.

View the After Order Actions documentation

In Easy Digital Downloads 2.8, the ‘after payment actions’ were introduced, which allow developers a way to add process intensive actions when a payment completes without affecting the speed and performance of the end user completing the purchase. This is a guide on how to add an after payment action.

Introduction

From its inception, Easy Digital Downloads has been built around the concept of extensibility. It’s what has led our platform to have over 250 official add-ons and themes. Over time, as more and more extensions began performing actions after a payment is completed, the checkout process may not seem to complete as quickly. Most of these actions are not ones that are ‘required’ for the purchase to be completed. Things like administrative emails, push notifications, commissions emails, and many other integrations can be delayed slightly as to not affect the purchase completion process. In version 2.8 we’re introducing ‘After Payment’ actions. This new ‘non-transactional’ hook acts exactly like the edd_complete_purchase action that has been previously used for these types of integrations, including the same parameters. So for developers wanting to integrate with the new processing method, it could be as simple as changing the hook you are using.

The hook (edd_after_payment_actions) triggers via WP_Cron just a short time after the payment is marked as completed. Because it fires with WP_Cron, this means that process intensive activities do not affect a user’s load time of your site.

There is a filter if you choose not to use after action hooks, in which case, EDD will fallback and perform the actions at the time of completion, and avoid the delayed process.

Key points about after payment actions

  • Triggers via WP_Cron
  • Able to be disabled via filter
  • By default, it is scheduled for 30 seconds after the purchase, but can be changed via a filter.
  • An order meta key of _edd_complete_actions_run is stored for the order to report when the action run (in GMT)
  • An order note is recorded stating the actions were run.

NOTICE: Because this after payment actions system is dependent on WP_Cron, it should not be used for things considered ‘mission critical’. It’s simply a way to offload expensive integrations with APIs and large sets of data that do not directly affect the purchase data.

The post Registering after payment actions first appeared on Easy Digital Downloads.

]]>
edd_email_templates https://easydigitaldownloads.com/docs/edd_email_templates/ Mon, 24 Jan 2022 19:57:32 +0000 https://edd-site.lndo.site/docs/edd_email_templates/ The  edd_email_templates filter allows you to register new email template names that can be applied to emails sent through Easy Digital Downloads. A new template can be registered by adding an additional key, value pair to the array: function pw_edd_register_email_template( $templates ) { $templates['my_custom_template'] = 'My Custom Template Name'; return $templates; } add_filter( 'edd_email_templates', 'pw_edd_register_email_template' ); The

The post edd_email_templates first appeared on Easy Digital Downloads.

]]>
The 
edd_email_templates filter allows you to register new email template names that can be applied to emails sent through Easy Digital Downloads.

A new template can be registered by adding an additional key, value pair to the array:

function pw_edd_register_email_template( $templates ) {
	$templates['my_custom_template'] = 'My Custom Template Name';
	return $templates;
}
add_filter( 'edd_email_templates', 'pw_edd_register_email_template' );

The template files themselves are located in 
wp-content/plugins/easy-digital-downloads/templates/emails/. EDD will attempt to load the following templates:

  • header-{template name}.php
  • body-{template name}.php
  • footer-{template name}.php

Place your custom templates in a folder called 
edd_templates/emails inside your currently active theme.

The post edd_email_templates first appeared on Easy Digital Downloads.

]]>
edd_get_download_files() https://easydigitaldownloads.com/docs/edd_get_download_files/ Mon, 24 Jan 2022 19:57:30 +0000 https://edd-site.lndo.site/docs/edd_get_download_files/ This function can be used for retrieving all downloadable files attached to a download product. $files = edd_get_download_files( $download_id, $variable_price_id = null ); if( $files ) { foreach( $files as $filekey => $file ) { // Name: $file['name'] // URL or path: $file['file'] } } The first parameter is the ID of the download product

The post edd_get_download_files() first appeared on Easy Digital Downloads.

]]>
This function can be used for retrieving all downloadable files attached to a download product.

$files = edd_get_download_files( $download_id, $variable_price_id = null );
if( $files ) {
	foreach( $files as $filekey => $file ) {
		// Name: $file['name']
		// URL or path: $file['file']
	}
}

The first parameter is the ID of the download product you want to retrieve files for, and the second parameter is an option price ID. If your download has variable prices enabled, you can pass the ID of a price and only the files available to that price ID will be returned.

The post edd_get_download_files() first appeared on Easy Digital Downloads.

]]>
EDD REST API V2 – Customers https://easydigitaldownloads.com/docs/edd-rest-api-v2-customers/ Mon, 24 Jan 2022 19:57:25 +0000 https://edd-site.lndo.site/docs/edd-rest-api-v2-customers/ This document relates specifically to Version 2 of the EDD API. Documentation for Version 1 is here. The EDD REST API provides an endpoint called /customers/. The customers endpoint allows for you to query the database and retrieve a list of customers that have purchased items from your shop. A basic customers query looks like

The post EDD REST API V2 – Customers first appeared on Easy Digital Downloads.

]]>
This document relates specifically to Version 2 of the EDD API.
Documentation for Version 1 is here.

The
EDD REST API provides an endpoint called /customers/. The customers endpoint allows for you to query the database and retrieve a list of customers that have purchased items from your shop. A basic customers query looks like this:

http://yoursite.com/edd-api/v2/customers/?key=c281cf0a95be875d9eeb284fb004c938&token=5f9432f3ffa5945755ebc66179810d70&number=25

For each customer returned, the following information is returned for each customer:

  • customer_id – The unique ID of the customer. Matches id in this API result.
  • user_id – The WordPress user ID. If the customer purchased as a guest, this will return as nothing.
  • username – The WordPress user login name. If the customer purchased as a guest, this will return as nothing.
  • display_name – The WordPress user display name. If the customer purchased as a guest, this will return as nothing.
  • first_name – The customer first name.
  • last_name – The customer last name.
  • email – The customer’s email address.
  • date_created – The date this customer was created in EDD.
  • total_purchases – The total number of purchases the customer has made.
  • total_spent – The total amount the customer has spent.
  • total_downloads – The total number of files the customer has downloaded.
  • date – The date to retrieve cutomers for. This has three accepted values:
    • today – Will retrieve customers created on the current day.
    • yesterday – Will retrieve customers created on the previous day.
    • range – Will retrieve customers created within a date range.
      • startdate – Format: YYYYMMDD. Example: 20120224 = 2012/02/24
      • enddate – Format: YYYYMMDD. Example: 20120531 = 2012/02/24

Along with the data returned for each customer is a
stats object that shows the total number of customers in the database.

A customers query response looks like this:

{
    "customers": [
        {
            "info": {
                "id": "3",
                "user_id": "",
                "username": "",
                "display_name": "",
                "customer_id": "3",
                "first_name": "Matthew",
                "last_name": "Dixon",
                "email": "matthew@example.com",
		"additional_emails": [],
                "date_created": "2016-05-28 00:09:40"
            },
            "stats": {
                "total_purchases": "1",
                "total_spent": "20.000000",
                "total_downloads": 0
            }
        },
        {
            "info": {
                "id": "2",
                "user_id": "2",
                "username": "bob",
                "display_name": "bob",
                "customer_id": "2",
                "first_name": "",
                "last_name": "",
                "email": "bob@example.com",
                "additional_emails": [
                    "robert.joiner@example.com"
                ],
                "date_created": "2016-05-17 14:17:15"
            },
            "stats": {
                "total_purchases": "1",
                "total_spent": "0.000000",
                "total_downloads": 0
            }
        },
        {
            "info": {
                "id": "1",
                "user_id": "1",
                "username": "jose",
                "display_name": "Jose",
                "customer_id": "1",
                "first_name": "Jose",
                "last_name": "Espinoza",
                "email": "jose@example.com",
		"additional_emails": [],
                "date_created": "2016-05-17 14:08:57"
            },
            "stats": {
                "total_purchases": "6",
                "total_spent": "70.000000",
                "total_downloads": 2
            }
        }
    ],
    "request_speed": 0.0081720352172852
}

If you wish to retrieve the info for a specific customer, you can add the
&customer={identifier} parameter, like this:

http://yoursite.com/edd-api/v2/customers/?key=c281cf0a95be875d9eeb284fb004c938&token=5f9432f3ffa5945755ebc66179810d70&customer=1

or

http://yoursite.com/edd-api/v2/customers/?key=c281cf0a95be875d9eeb284fb004c938&token=5f9432f3ffa5945755ebc66179810d70&customer=jose@domain.com

The response for a single customer will be like this:

{
    "customers": [
        {
            "info": {
                "id": "1",
                "user_id": "1",
                "username": "jose",
                "display_name": "Jose",
                "customer_id": "1",
                "first_name": "Jose",
                "last_name": "Espinoza",
                "email": "jose@example.com",
		"additional_emails": [],
                "date_created": "2016-05-17 14:08:57"
            },
            "stats": {
                "total_purchases": "6",
                "total_spent": "70.000000",
                "total_downloads": 2
            }
        }
    ]
}

A query looking for customers created today would look like this:

http://yoursite.com/edd-api/customers/?key=c281cf0a95be875d9eeb284fb004c938&token=5f9432f3ffa5945755ebc66179810d70&date=today

A date range would look like this:

http://yoursite.com/edd-api/customers/?key=c281cf0a95be875d9eeb284fb004c938&token=5f9432f3ffa5945755ebc66179810d70&date=range&startdate=20130201&enddate=20130210

The post EDD REST API V2 – Customers first appeared on Easy Digital Downloads.

]]>
EDD REST API – Authentication https://easydigitaldownloads.com/docs/edd-rest-api-authentication/ Mon, 24 Jan 2022 19:57:24 +0000 https://edd-site.lndo.site/docs/edd-rest-api-authentication/ The EDD REST API may only be accessed by URL with appropriate authentication. This authentication is accomplished by passing an API key and token with the URL, via query parameters. Each user on the site has their own unique set of keys and tokens. These can be managed all in one place by Shop Manager

The post EDD REST API – Authentication first appeared on Easy Digital Downloads.

]]>
The EDD REST API may only be accessed by URL with appropriate authentication. This authentication is accomplished by passing an API key and token with the URL, via query parameters. Each user on the site has their own unique set of keys and tokens. These can be managed all in one place by Shop Manager under Downloads > Tools > API Keys:

They may also be managed by individual users in their WordPress profile pages:

Once you have an API key, you can begin utilizing the EDD API. Both the API key and the token need to be appended to the URL as query parameters, like so:

https://yoursite.com/edd-api/?key=XXXX&token=XXXX

As seen in the screenshot above, API keys may be revoked if needed. If this is done the user is presented with a checkbox option to generate new keys:

The post EDD REST API – Authentication first appeared on Easy Digital Downloads.

]]>
EDD REST API – Sales https://easydigitaldownloads.com/docs/edd-rest-api-sales/ Mon, 24 Jan 2022 19:57:23 +0000 https://edd-site.lndo.site/docs/edd-rest-api-sales/ The EDD REST API provides access to sales data via the /sales/ endpoint. The sales endpoint allows for you to query the database and retrieve information for recent sales. A basic sales query looks like this: http://example.com/edd-api/sales/?key=c281cf0a95be875d9eeb284fb004c938&token=5f9432f3ffa5945755ebc66179810d70 Requests to the /sales/ endpoint accept the following parameters: key – The API key to authenticate the request

The post EDD REST API – Sales first appeared on Easy Digital Downloads.

]]>
The EDD REST API provides access to sales data via the /sales/ endpoint. The sales endpoint allows for you to query the database and retrieve information for recent sales. A basic sales query looks like this:

http://example.com/edd-api/sales/?key=c281cf0a95be875d9eeb284fb004c938&token=5f9432f3ffa5945755ebc66179810d70

Requests to the /sales/ endpoint accept the following parameters:

  • key – The API key to authenticate the request (required).
  • token – The API token to authenticate the request (required).
  • number – The number of records to return (optional).
  • email – A search parameter to return only payments that match the given email (optional).
  • id – The ID number of a specific payment record (optional).
  • purchasekey – The purchase key for a specific payment record (optional).

For each sale returned, the following information will be available:

  • ID – The sale ID number.
  • key -The sale purchase key.
  • subtotal – The sale subtotal.
  • tax – The sales tax amount.
  • fees – Any arbitrary fees that were added to the sale.
  • total – The total sale amount.
  • gateway – The payment method, such as stripe or paypal, used to make the purchase.
  • email – The email address associated with the sale.
  • date – The date the sale was made.
  • discounts – List of discount codes used.
  • products – A list of products purchased. For each product:
    • id – The Product ID.
    • quantity – The cart quantity for the item.
    • name – The name of the product.
    • price – The price of the product (after any discounts).
    • price_name – The price option name that was purchased (if the product has variable prices).

An example sales query response looks like this:

{
    "sales": [
        {
            "ID": 123,
            "mode": "",
            "status": "publish",
            "transaction_id": 12323461261234,
            "key": "ca2aaaa2a9e9e5369b8280403431b6fd",
            "subtotal": 89,
            "tax": "0",
            "fees": null,
            "total": "8.009",
            "gateway": "manual",
            "customer_id": "2",
            "user_id": "0",
            "email": "jdoe@example.org",
            "date": "2021-09-29 13:47:41",
            "discounts": null,
            "products": [
                {
                    "id": 167,
                    "quantity": 1,
                    "name": "Stripe Pro Payment Gateway",
                    "price": 89,
                    "price_name": "Single Site"
                }
            ],
        },
        {
            "ID": 122,
            "mode": "",
            "status": "publish",
            "transaction_id": 12324621266234,
            "key": "7608c3f1b8f5e00b7f21add193ab7ced",
            "subtotal": 199,
            "tax": "0",
            "fees": null,
            "total": "199.00",
            "gateway": "manual",
            "customer_id": "2",
            "user_id": "0",
            "email": "jdoe@example.org",
            "date": "2021-09-29 13:30:59",
            "discounts": null,
            "products": [
                {
                    "id": 1245716,
                    "quantity": 1,
                    "name": "Extended Pass",
                    "price": 199,
                    "price_name": ""
                }
        }
    ]
}

You can narrow the results down by email by adding “&email=test@test.com”. Replace “test@test.com” with the actual user’s email address for whom you want to show sales.

http://example.com/edd-api/sales/?key=c281cf0a95be875d9eeb284fb004c938&token=5f9432f3ffa5945755ebc66179810d70&email=test@test.com

Retrieving Specific Sale Records

To retrieve a specific sale record, you can include either the id or the purchasekey parameter in the request.

For example, to retrieve a sale by the purchase key, the request looks like this:

http://example.com/edd-api/sales/?key=&token=&purchasekey=

To retrieve a sale by the ID, the request looks like this:

http://example.com/edd-api/sales/?key=&token=&id=

Searching Sale Records

Passing the email parameter will result in the API returning all sale records that match the given email address.

http://example.com/edd-api/sales/?key=&token=&email=

The post EDD REST API – Sales first appeared on Easy Digital Downloads.

]]>
edd_get_payment_transaction_id() https://easydigitaldownloads.com/docs/edd_get_payment_transaction_id/ Mon, 24 Jan 2022 19:57:22 +0000 https://edd-site.lndo.site/docs/edd_get_payment_transaction_id/ The  edd_get_payment_transaction_id() function is used to retrieve the transaction ID related to a specific purchase. The function takes the payment ID as a parameter: $trans_id = edd_get_payment_transaction_id( $payment_id ); The transaction ID returned is passed through a filter called  edd_get_payment_transaction_id, which receives two parameters: $transaction_id $payment_id Transaction ID tracking was implemented in EDD v2.1 and is

The post edd_get_payment_transaction_id() first appeared on Easy Digital Downloads.

]]>
The 
edd_get_payment_transaction_id() function is used to retrieve the transaction ID related to a specific purchase.

The function takes the payment ID as a parameter:

$trans_id = edd_get_payment_transaction_id( $payment_id );

The transaction ID returned is passed through a filter called 
edd_get_payment_transaction_id, which receives two parameters:

  • $transaction_id
  • $payment_id

Transaction ID tracking was implemented in EDD v2.1 and is done on a per-gateway basis, so not all payment records will have transaction IDs. If a transaction ID does not exist for a payment record, the 
edd_get_payment_transaction_id-{gateway name} filter is applied before the edd_get_payment_transaction_id filter so that the transaction ID can (possibly) be pulled from the payment notes. This allows payment gateways to update old payment records over time by retrieving the transaction ID from a custom storage method unique to that gateway.

The post edd_get_payment_transaction_id() first appeared on Easy Digital Downloads.

]]>
EDD REST API – Products https://easydigitaldownloads.com/docs/edd-rest-api-products/ Mon, 24 Jan 2022 19:57:21 +0000 https://edd-site.lndo.site/docs/edd-rest-api-products/ TheEDD REST API provides access to product information via the /products/ endpoint. You may access multiple products or a single product. NOTE: The products endpoint does not need a key or token to render published products. Products are intended to be publicly available. A basic products query looks like this: http://example.com/edd-api/products/ A sample products response

The post EDD REST API – Products first appeared on Easy Digital Downloads.

]]>
The
EDD REST API provides access to product information via the /products/ endpoint. You may access multiple products or a single product.

NOTE: The products endpoint does not need a key or token to render published products. Products are intended to be publicly available.

A basic products query looks like this:

http://example.com/edd-api/products/

A sample products response looks like this:

{
    "products": [
        {
            "info": {
                "id": 435,
                "slug": "test-2",
                "title": "Test",
                "create_date": "2013-02-06 19:25:18",
                "modified_date": "2013-02-12 09:40:31",
                "status": "publish",
                "link": "http://localhost/wordpress/?post_type=download&p=435",
                "permalink": "http://localhost/wordpress/?p=435",
                "content": "Test",
                "thumbnail": "http://localhost/wordpress/wp-content/uploads/edd/2013/01/2649089468_abb2633bc6_o.jpg"
            },
            "stats": {
                "total": {
                    "sales": "6",
                    "earnings": "60"
                },
                "monthly_average": {
                    "sales": 6,
                    "earnings": 60
                }
            },
            "pricing": {
                "amount": "29000.00"
            },
            "files": [
                {
                    "name": "",
                    "file": "test",
                    "condition": "all"
                }
            ],
            "notes": ""
        },
        {
            "info": {
                "id": 16,
                "slug": "simple-notices-pro",
                "title": "Simple Notices Pro",
                "create_date": "2013-01-07 22:42:18",
                "modified_date": "2013-02-25 16:16:39",
                "status": "publish",
                "link": "http://localhost/wordpress/?post_type=download&p=16",
                "content": "Dapibus dignissim hac ac penatibus eros, quis diam augue! Nisi dapibus in ridiculus auctor ridiculus scelerisque turpis augue, vel turpis ac odio egestas urna, eros in augue amet, mus et? Nisi est tincidunt ultricies et montes, massa sit. Nec purus? Est cras arcu vut pid? In, dapibus urna porttitor pellentesque pellentesque scelerisque! Diam vel in, adipiscing, dictumst? Cursus vut nec? Cras amet nunc? Tortor vel. Tempor phasellus integer et, turpis nec in! Ut vel turpis, ac dictumst augue! Auctor vel ut, penatibus parturient aliquam, porttitor! Aliquet vut magna eu, ac, aliquam montes a vel, odio, dictumst nec enim vel, pulvinar. Mattis dignissim, urna lacus purus integer, eros vel! Augue dictumst, in arcu integer magna elementum ut. Pid a lacus ultrices.",
                "thumbnail": "http://localhost/wordpress/wp-content/uploads/2013/01/edd_product_support.png"
            },
            "stats": {
                "total": {
                    "sales": "47",
                    "earnings": "902.2"
                },
                "monthly_average": {
                    "sales": 47,
                    "earnings": 902.2
                }
            },
            "pricing": {
                "priceone": "20",
                "pricetwo": "30",
                "price3": "40.55"
            },
            "files": [
                {
                    "name": "Screenshot from 2013-01-09 16:21:43",
                    "file": "http://localhost/wordpress/wp-content/uploads/edd/2013/01/Screenshot-from-2013-01-09-162143.png",
                    "condition": "all"
                },
                {
                    "name": "Screenshot from 2013-01-14 09:37:41",
                    "file": "http://localhost/wordpress/wp-content/uploads/edd/2013/02/Screenshot-from-2013-01-14-093741.png",
                    "condition": "1"
                }
            ],
            "notes": "These are the product notes."
        }
    ]
}

If you want to retrieve info for only a specific product, you can pass a product ID via the
product parameter:

http://example.com/edd-api/products/?product=55

The post EDD REST API – Products first appeared on Easy Digital Downloads.

]]>
Invalid download links due to query string order modification https://easydigitaldownloads.com/docs/invalid-download-links-due-to-query-string-order-modification/ Mon, 24 Jan 2022 19:57:20 +0000 https://edd-site.lndo.site/docs/invalid-download-links-due-to-query-string-order-modification/ Easy Digital Downloads has a robust system in place to keep your file download links secure and prevent them from being abused. When a file download link is clicked, the order of the parameters provided is important. From time to time, certain hosting configurations, caching layers, or CDN providers may re-order the query string parameters

The post Invalid download links due to query string order modification first appeared on Easy Digital Downloads.

]]>
Easy Digital Downloads has a robust system in place to keep your file download links secure and prevent them from being abused. When a file download link is clicked, the order of the parameters provided is important. From time to time, certain hosting configurations, caching layers, or CDN providers may re-order the query string parameters in order to allow some base level caching to be done. Re-ordering these items will cause Easy Digital Downloads to fail the token validation for a customer’s download link.

How can I tell if this is my issue?

If, when a user clicks to download their files, they are given the error “You do not have permission to download this file”, check that the URL still has the following format, paying close attention to the order of the parameters. 

http://example.org/index.php?eddfile=...&ttl=...&file=...&token=...

If the query string parameters are not in the above order, then you are experiencing the issue described above. We do have a few solutions to help prevent this from occurring.

If you have an page caching system setup, like Cloudflare or Varnish, then you may still see this error even though your parameters appear to be in the correct order. This is due to the page caching system sorting those parameters before sending your request to the webserver to be processed by PHP.

How can I prevent this issue?

Hosting configuration changes

The ideal situation is to not have your providers re-order the query string parameters when the request is for a file download by preventing any request containing the eddfile query string parameter from being passed through the re-ordering rules.

If you are using Cloudflare and have enabled their Query String Sort feature, you should be able to disable this feature to allow users to download their files without error.

Custom code snippet

We recognize that this may not always be possible with some providers, so we’ve written a small function that will run any failed validation a 2nd time, to verify that we received the items in the proper order.

function ck_custom_validate_url_token( $ret, $url, $query_args ) {
	// If basic validation failed, let's make sure the URL prarms were in the right order and try again
	if ( false === $ret ) {
		$parts   = parse_url( $url );
		wp_parse_str( $parts['query'], $query_args );

		$fix_arg_order = array(
			'eddfile' => $query_args['eddfile'],
			'ttl'     => $query_args['ttl'],
			'file'    => $query_args['file'],
			'token'   => $query_args['token'],
		);

		$fixed_url   = add_query_arg( $fix_arg_order, site_url() );
		$fixed_token = edd_get_download_token( $fixed_url );

		$ret         = $query_args['token'] === $fixed_token;
	}

	return $ret;
}
add_filter( 'edd_validate_url_token', 'ck_custom_validate_url_token', 10, 3 );

The above function should be tested in a staging environment prior to using it on a production environment, to verify it works correctly in your specific configuration.

The post Invalid download links due to query string order modification first appeared on Easy Digital Downloads.

]]>
EDD REST API – Endpoints https://easydigitaldownloads.com/docs/edd-rest-api-endpoints/ Mon, 24 Jan 2022 19:57:19 +0000 https://edd-site.lndo.site/docs/edd-rest-api-endpoints/ The EDD REST API includes six endpoints for accessing information, each for performing a specific kind of request: stats – For retrieving earnings/sales stats specific dates, date ranges, and specific products. products – For retrieving info about store products. customers – For retrieving customer stats. sales – For retrieving recent sales and info about each sale (items purchased, buyer,

The post EDD REST API – Endpoints first appeared on Easy Digital Downloads.

]]>
The EDD REST API includes six endpoints for accessing information, each for performing a specific kind of request:

  • stats – For retrieving earnings/sales stats specific dates, date ranges, and specific products.
  • products – For retrieving info about store products.
  • customers – For retrieving customer stats.
  • sales – For retrieving recent sales and info about each sale (items purchased, buyer, amount, etc).
  • discounts – For retrieving info about all available discounts.
  • download-logs – For retrieving logs of file downloads.

The endpoints are used like so:

http://example.com/edd-api//

For example:

http://example.com/edd-api/sales/

When combined with the API key and token, the complete URL looks like this:

http://example.com/edd-api/sales/?key=c281cf0a95be875d9eeb284fb004c938&token=5f9432f3ffa5945755ebc66179810d70

Visibility

All endpoints require the API key and token except for the products endpoint. This is because products are intended to be public at all times by default.

Response Format

The response given by the EDD API is available in two formats:

To specify the format returned (jSON will be used if none is specified), simply add the
format argument to the URL:

http://yoursite.com/edd-api/sales/?key=c281cf0a95be875d9eeb284fb004c938&token=5f9432f3ffa5945755ebc66179810d70&format=xml

A sample JSON response looks like this:

{
    "sales": [
        {
            "ID": 611,
            "subtotal": "20",
            "tax": 0,
            "fees": false,
            "total": "20",
            "gateway": "manual",
            "email": "johntest23@test.com",
            "date": "2013-02-25 11:42:05",
            "products": [
                {
                    "name": "Simple Notices Pro",
                    "price": "20",
                    "price_name": "Price one"
                }
            ]
        }
    ]
}

A sample XML response (for the same query) looks like this:

  
    611
    20
    0
    false
    20
    manual
    johntest23@test.com
    2013-02-25 11:42:05
    
      Simple Notices Pro
      20
      Price one
    
  

Optional URL Variables

You can add additional URL variables in order to adjust the output that is given. Here are a few examples of ways you can do that.

  • Number: By default, the API will show 10 results per page, if that’s what you have set under your Reading settings in WordPress. But if you want to change that for a specific API call, you can add “&number=11” to the URL to get a different number of results per page. In this example, you would get 11 results.
  • Page: By default, the API will show page number 1 of the results. If you want to change that for a specific API call, you can add “&page=2” to the URL to get a different page of results.

The post EDD REST API – Endpoints first appeared on Easy Digital Downloads.

]]>
Retrieving a download’s payment IDs using EDD’s Logging Class https://easydigitaldownloads.com/docs/retrieving-a-downloads-payment-ids-using-edds-logging-class/ Mon, 24 Jan 2022 19:57:18 +0000 https://edd-site.lndo.site/docs/retrieving-a-downloads-payment-ids-using-edds-logging-class/ The logging class in Easy Digital Downloads was first introduced in v1.3.1 as a means for logging events and errors. In this tutorial, we’re going to use Easy Digital Downloads’ Logging Class to retrieve each payment ID associated with a download’s purchase. Once you have the payment ID, you have access to a wealth of information

The post Retrieving a download’s payment IDs using EDD’s Logging Class first appeared on Easy Digital Downloads.

]]>
The logging class in Easy Digital Downloads was first introduced in v1.3.1 as a means for logging events and errors. In this tutorial, we’re going to use Easy Digital Downloads’ Logging Class to retrieve each payment ID associated with a download’s purchase. Once you have the payment ID, you have access to a wealth of information about the purchase, which you can use for practical applications.

Once such example is  
EDD Purchase Gravatars, which displays the gravatars of customers who have purchased your product. This can be used for showing social proof/trust, where customers are more inclined to purchase your product when they see other real customers who have already purchased.

edd-purchase-gravatars

The plugin uses the customer’s email address and first name which are required by Easy Digital Downloads to complete the purchase. Using WordPress’ get_avatar() function, the plugin retrieves the gravatar associated with the given email address, and uses the customer’s first name for the image’s alt tag.

The sales log

In order to retrieve the customer’s email address and first name for the gravatars, we ultimately need the payment ID for each purchase. This can be found by first retrieving each purchase’s log ID. We can see a list of all a download’s purchases by clicking “View Sales Log” on the “download stats” metabox on the download’s edit/publish screen.

From the image below, we can see one purchase has a Log ID of 55. In the same row, we can see it has a payment ID of 54. Each time a purchase is made, the Log ID and payment ID are stored at the same time, sequentially.

logs

Digging into wp_postmeta

To understand how we can get the payment ID from the log ID, we need to dig into WordPress’  wp_postmeta table. If we filter the table by a post_id of 55 (log ID), we find the _edd_log_payment_id meta_key with a value of 54 (our payment ID). This also matches the sales log, illustrated in the image above.

post_meta_log_id

Filtering by post_id with our newly discovered payment ID (54), we find all the useful information stored against our purchase. In EDD Purchase Gravatars we use the email stored in the  _edd_payment_user_email meta_key, and the first name which stored inside the _edd_payment_meta array (there’s also an email address inside here also). In order to make use of all the information stored in the _edd_payment_meta array, you will first need to unserialize it, using the maybe_unserialize function in WordPress.

post_meta_purchase_id

Retrieving the Log IDs

Now that we know we need to first retrieve all the Log ID’s of a download, we’ll use the helpful logging class in Easy Digital Downloads to do this for us. This function requires a download ID to be passed to it, which in the case of EDD Purchase Gravatars, allow the gravatars to be shown anywhere on the website, for any download.

Retrieving the Payment IDs

Now that we have an array of all the log IDs, we can use them in a new function to retrieve an array of all the payment IDs.

Conclusion

Now that you have an array of all the payment IDs, you can loop and output the information you need. What else can you build using payment IDs and EDD’s Logging Class?

The post Retrieving a download’s payment IDs using EDD’s Logging Class first appeared on Easy Digital Downloads.

]]>
edd_has_user_purchased() https://easydigitaldownloads.com/docs/edd_has_user_purchased/ Mon, 24 Jan 2022 19:57:17 +0000 https://edd-site.lndo.site/docs/edd_has_user_purchased/ This conditional function will allow you to check whether a user has purchased a particular digital product. The function takes two parameters: $user_id – the ID number of the user to check $download_id – the ID number of the download to check Example: if( edd_has_user_purchased($user_id, $download_id) ) { // the current user HAS purchased $download_id

The post edd_has_user_purchased() first appeared on Easy Digital Downloads.

]]>
This conditional function will allow you to check whether a user has purchased a particular digital product.

The function takes two parameters:

  • $user_id – the ID number of the user to check
  • $download_id – the ID number of the download to check

Example:

if( edd_has_user_purchased($user_id, $download_id) ) {
	// the current user HAS purchased $download_id
} else {
	// the current user has NOT purchase $download_id	
}

The post edd_has_user_purchased() first appeared on Easy Digital Downloads.

]]>
EDD REST API – File Downloads https://easydigitaldownloads.com/docs/edd-rest-api-file-downloads/ Mon, 24 Jan 2022 19:57:16 +0000 https://edd-site.lndo.site/docs/edd-rest-api-file-downloads/ The EDD REST API provides the /file-download-logs/ endpoint, which allows you to retrieve logs for a given site. A basic download-logs query looks like this: http://example.com/edd-api/file-download-logs/?key=c281cf0a95be875d9eeb284fb004c938&token=5f9432f3ffa5945755ebc66179810d70 A sample download-logs response looks like this: { "download_logs": [ { "ID": 257, "user_id": "1", "product_id": 68, "product_name": "Ebook: I am Pippin Williamson, and so can YOU.", "customer_id": "1",

The post EDD REST API – File Downloads first appeared on Easy Digital Downloads.

]]>
The
EDD REST API provides the /file-download-logs/ endpoint, which allows you to retrieve logs for a given site. A basic download-logs query looks like this:

http://example.com/edd-api/file-download-logs/?key=c281cf0a95be875d9eeb284fb004c938&token=5f9432f3ffa5945755ebc66179810d70

A sample download-logs response looks like this:

{
    "download_logs": [
        {
            "ID": 257,
            "user_id": "1",
            "product_id": 68,
            "product_name": "Ebook: I am Pippin Williamson, and so can YOU.",
            "customer_id": "1",
            "payment_id": "254",
            "file": "Be Kind To Your Web Footed Friends",
            "ip": "68.56.68.4",
            "date": "2015-11-03 18:36:05"
        },
        {
            "ID": 256,
            "user_id": "1",
            "product_id": 68,
            "product_name": "Ebook: I am Pippin Williamson, and so can YOU.",
            "customer_id": "1",
            "payment_id": "254",
            "file": "Be Kind To Your Web Footed Friends",
            "ip": "68.56.68.4",
            "date": "2015-11-03 18:34:00"
        }
    ],
    "request_speed": 0.076191902160645
}
Download-logs Variables
customer

Appending &customer=user@example.com will narrow the log search to that email address. Example:

http://yoursite.com/edd-api/file-download-logs/?key=c281cf0a95be875d9eeb284fb004c938&token=5f9432f3ffa5945755ebc66179810d70&customer=user@example.com

Error Messages

If the query you have passed to the EDD API returns an error, the response will come back like this:

{
    "error": "Invalid query!"
}

Each query method in the API includes meaningful error messages to help you figure out what you have done wrong.

For example, if you attempt to perform a stats query with a date range but enter an end date that is before the start date, you will get an error like this:

{
    "error": "The end date must be later than the date date!"
}

The post EDD REST API – File Downloads first appeared on Easy Digital Downloads.

]]>
EDD_USE_PHP_SESSIONS https://easydigitaldownloads.com/docs/edd_use_php_sessions/ Mon, 24 Jan 2022 19:57:15 +0000 https://edd-site.lndo.site/docs/edd_use_php_sessions/ Note: As of Easy Digital Downloads v3.3.0, there is a setting to disable PHP sessions (Database Sessions). See Session Handling here for details. By default, EDD chooses PHP sessions as they are typically more performance friendly than database driven session handling, and help avoid issues with some object caching plugins and their shortcomings with the

The post EDD_USE_PHP_SESSIONS first appeared on Easy Digital Downloads.

]]>
Note: As of Easy Digital Downloads v3.3.0, there is a setting to disable PHP sessions (Database Sessions). See Session Handling here for details.

By default, EDD chooses PHP sessions as they are typically more performance friendly than database driven session handling, and help avoid issues with some object caching plugins and their shortcomings with the transient option types.

In some cases, servers / hosting may not support PHP sessions, which can cause EDD to not function properly. If that’s the case, you’ll need to override the default by setting EDD PHP Sessions to false. All this does is tell EDD to use a different method to keep track of a user on the site.

Empty Cart

The checkout page reporting Empty Cart when an item should be added is a common symptom of PHP sessions not supported by the server. Please review Shopping Cart Is Empty at Checkout prior to disabling sessions as there are other reasons this could be happening.

If you need to change this default:

Place this constant in your wp-config.php file to disable EDD PHP Sessions:

define( 'EDD_USE_PHP_SESSIONS', false );

If you need to re-enable EDD PHP Sessions, either delete the line above or set it to

define( 'EDD_USE_PHP_SESSIONS', true );

If you are unsure of how to edit your wp-config.php file, please consult the official WordPress help page on editing the file.

Note: you must place this code above the line that says:

/* That's all, stop editing! Happy blogging. */

It is safe to leave the constant in wp-config.php indefinitely.

How do EDD PHP Sessions work?

If this constant is defined, Easy Digital Downloads will use PHP $_SESSION for storing cart data. By default, when the EDD_USE_PHP_SESSIONS constant is not defined, EDD will look to see if the server supports PHP based sessions and choose PHP session handling going forward. If the session_start function is not supported, then EDD falls back to the WP_Session class, which is a combination of browser cookies and database rows stored in the wp_options table.

The post EDD_USE_PHP_SESSIONS first appeared on Easy Digital Downloads.

]]>
edd_get_download() https://easydigitaldownloads.com/docs/edd_get_download/ Mon, 24 Jan 2022 19:57:13 +0000 https://edd-site.lndo.site/docs/edd_get_download/ This function can be used to retrieve the post object for a download by either ID or slug. Example: $download = edd_get_download(34); // retrieve the download post data for ID 34 $download = edd_get_download('my-awesome-download'); // retrieve the download post data for slug "my-awesome-download" // you can now do things like this: $title = $download->post_title;

The post edd_get_download() first appeared on Easy Digital Downloads.

]]>
This function can be used to retrieve the post object for a download by either ID or slug.

Example:

$download = edd_get_download(34); // retrieve the download post data for ID 34 
$download = edd_get_download('my-awesome-download'); // retrieve the download post data for slug "my-awesome-download"
// you can now do things like this:
$title = $download->post_title;

The post edd_get_download() first appeared on Easy Digital Downloads.

]]>
EDD_Customer https://easydigitaldownloads.com/docs/edd_customer/ Mon, 24 Jan 2022 19:57:12 +0000 https://edd-site.lndo.site/docs/edd_customer/ Table of Contents Getting a Customer Getting Customer Payment Data Creating a Customer Updating a Customer Updating Specific Fields Customer Meta Customer Email Addresses The EDD_Customer class is used for getting customer data, creating new customer entries, and editing existing customer entries. The values that may be managed with this class are: user_id name email

The post EDD_Customer first appeared on Easy Digital Downloads.

]]>
Table of Contents

The EDD_Customer class is used for getting customer data, creating new customer entries, and editing existing customer entries. The values that may be managed with this class are:

  • user_id
  • name
  • email
  • payment_ids
  • purchase_value
  • purchase_count
  • notes

Getting a Customer

Your reasons for getting Customer data can vary from simply rendering the info to using it for stats or logging or anything else. Here are the steps to get and render customer information.

Step 1, Get the data

In order to create a Customer object you must pass some sort of identifier when instantiating the class. This can be email address, Customer ID, or WordPress user ID.

Examples:

Email

$customer = new EDD_Customer( 'jose@canseco.com' );

Customer ID

$customer = new EDD_Customer( 33 );

WordPress user ID

$customer = new EDD_Customer( 96, true );

Note: for the WordPress user ID you must pass a value of true as the second parameter, so that it knows to look at WordPress rather than EDD.

Step 2, Use the data

Now you can access properties of the customer object like this:

  • $customer->name;
  • $customer->email;
  • $customer->date_created;
  • $customer->purchase_count;
  • $customer->purchase_value;
  • $customer->id; // Customer ID
  • $customer->user_id; // WordPress user ID
  • $customer->payment_ids;

You can echo those, parse them; anything you wish.

Getting Customer Payment Data

The EDD_Customer class has a method called
get_payments(). This method will return an array of EDD_Payment objects. Example:

$customer = new EDD_Customer( 33 );

$payments = $customer->get_payments();

Now $payments will hold an array of EDD_Payment objects. For more information on what that array looks like,
please see the docs on the EDD_Payment class.

Creating a Customer

First instantiate an object:

$customer = new EDD_Customer;
Example 1:
Then set up some arguments:
$args = array(
	'user_id'        => 12
	'name'           => 'Jose Canseco',
	'email'          => 'jose@canseco.com',
	'payment_ids'    => '',
	'purchase_value' => '',
	'purchase_count' => '',
	'notes'          => 'Whatever note you'd like',
);

Note: the
user_id above is a WordPress user ID number. It is only required if you want to associate your Customer with a WordPress user. If not, remove it from the array.

And then run the create method:
$customer->create( $args );
And now at this point your Customer should exist.
Example 2:
The above example shows how to create a customer with all possible options. The only
required option is email, so this would work as well:
$args = array(
	'email' => 'jose@canseco.com',
);
$customer->create( $args );

This creates a customer with only the email address provided, which works just fine.

Updating a Customer

Step 1, Get The Data.

Use the example code from “Getting A Customer” above.

Step 2, Update The Data

There are two ways of updating customer data with EDD_Customer. One is to use the
update() method and update multiple fields at one time.

Example:

$customer = new EDD_Customer( 33 );

$update_args = array(
	'email'          => 'jose@canseco.com',
	'name'          => 'Jose Canseco',
);

Now customer 33 has an updated email address and a new note.

Note: updating the notes field with this method will wipe out any existing notes. Use the add_note() method mentioned below to add a new note.

Updating Specific Fields

Rather than using the general update() method listed above you should generally try to use one of the helper methods provided below. These provide specific limited functionality that can help reduce errors.

For each of the following methods you would first instantiate the customer class as above:

$customer = new EDD_Customer( 33 );

attach_payment() and remove_payment()

These are used for attaching and removing payments to and from a customer. They both take a payment_id as the first variable, and a boolean option as the second. The second will update stats if set to true.

Examples:


$customer->attach_payment( 33, true );

$customer->remove_payment( 33, true );

increase_purchase_count() and decrease_purchase_count()

These are used to increase and decrease the
number of purchases made by a single customer. They both simply take an integer, changing the stored value by that much.

Examples:

$customer->increase_purchase_count( 1 );

$customer->decrease_purchase_count( 1 );

increase_value() and decrease_value()

These are used to increase and decrease the amount spent by a single customer. They both simply take a decimal number, to two places, changing the stored value by that much.

Examples:
$customer->increase_value( 14.98 );
$customer->decrease_value( 3.00 );

get_notes()

This method returns notes left on the customer’s account. It accepts 2 variables, the first for how many notes you want, and the second is an offset.

Examples:
$customer->get_notes( 5 ); // gets the first 5 notes
$customer->decrease_value( 5, 6 ); // gets 5 notes starting at position 6, so notes 6-10

get_notes_count()

This method returns the number of notes on the customer’s account. It takes no input.

Example:
$customer->get_notes_count();

add_note()

This method accepts a string as input, and stores it as a new note on the customer’s account. It preserves hard returns, but does not allow HTML.

Example:

$customer->add_note( 'This is a note. Isn't that cool?' );

Customer Meta

Arbitrary customer meta may be managed using the meta functions built into the EDD_Customer class.

get_meta( $meta_key = ”, $single = true )

get_meta simply takes a meta key and returns the value. If single is set to false it will always return an array.

add_meta( $meta_key = ”, $meta_value, $unique = false )

add_meta accepts a meta_key and its value, but it also accepts a boolean for unique. If the third input is true then add_meta will only succeed if the meta_key does not previously exist. Returns false for failure. True for success.

update_meta( $meta_key = ”, $meta_value, $prev_value = ” )

update_meta accepts a meta_key and the new value you wish to set for it. If you have multiple keys of the same name they will all be updated with the new value. The third input accepts a value to compare the previous value against. So if you already have several meta_keys of
foo but only one with a value of bar, you could make bar the third input and the update would only occur on that one. Returns false for failure. True for success.

delete_meta( $meta_key = ”, $meta_value = ” )

delete_meta will delete all meta data with a matching key. If a value is also passed then both must match. Returns false for failure. True for success.

Customer Email Addresses

Each customer can have multiple email addresses, allowing them to purchase from more than one address, or purchase from one and get support from another. Each customer will also have a primary email address, which gets used as a default for the customer. In the Customer Management tab the UI looks like this:

The EDD_Customer class allows the developer to removes addresses from a customer and add addressed to a customer as well as make a specific address primary.

add_email( $email = ”, $primary = false )

This function accepts an email address to add to the customer. If the second input is true, the new email address will be set as the primary address for the customer. Returns false for failure. True for success.

set_primary_email( $new_primary_email = ” )

This function accepts an email address and if the email address is already attached to this customer it will make it the primary email address for that customer. Returns false for failure. True for success.

remove_email( $email = ” )

This function accepts an email address and if the email address is already attached to this customer it removes it from that customer. Returns false for failure. True for success.

The post EDD_Customer first appeared on Easy Digital Downloads.

]]>
Querying Products in the Database https://easydigitaldownloads.com/docs/querying-products-in-the-database/ Mon, 24 Jan 2022 19:57:11 +0000 https://edd-site.lndo.site/docs/querying-products-in-the-database/ In the process of building around Easy Digital Downloads you may find the need to query the database for product data. This document will show several examples of how to do that properly. Getting a Single Product The best way to get information about a single product is to use the EDD_Download class. It accepts

The post Querying Products in the Database first appeared on Easy Digital Downloads.

]]>
In the process of building around Easy Digital Downloads you may find the need to query the database for product data. This document will show several examples of how to do that properly.

Getting a Single Product

The best way to get information about a single product is to use the EDD_Download class. It accepts a
download_id and returns an object with information about the download. Example:

$download = new EDD_Download( 109 );

This would return an object like this:

EDD_Download Object
(
    [ID] => 109
    [price:EDD_Download:private] => 
    [prices:EDD_Download:private] => 
    [files:EDD_Download:private] => 
    [file_download_limit:EDD_Download:private] => 
    [type:EDD_Download:private] => 
    [bundled_downloads:EDD_Download:private] => 
    [sales:EDD_Download:private] => 
    [earnings:EDD_Download:private] => 
    [notes:EDD_Download:private] => 
    [sku:EDD_Download:private] => 
    [button_behavior:EDD_Download:private] => 
    [post_author] => 2
    [post_date] => 2016-03-22 13:30:29
    [post_date_gmt] => 2016-03-22 13:30:29
    [post_content] => Buy my mp3!
    [post_title] => My MP3
    [post_excerpt] => 
    [post_status] => publish
    [comment_status] => closed
    [ping_status] => closed
    [post_password] => 
    [post_name] => my-mp3
    [to_ping] => 
    [pinged] => 
    [post_modified] => 2016-03-22 13:30:29
    [post_modified_gmt] => 2016-03-22 13:30:29
    [post_content_filtered] => 
    [post_parent] => 0
    [guid] => http://edd.dev/?post_type=download&p=109
    [menu_order] => 0
    [post_mime_type] => 
    [comment_count] => 0
    [filter] => raw
    [post_type] => download
)

Once you have the object there are a wide variety of methods that can be run on it to get information like price, variations etc.
Full documentation for EDD_Download here.

Getting Multiple Products

Downloads are a WordPress custom content type, so it’s possible to get the ids of multiple downloads using
get_posts(). If you specify the fields parameter properly then get_posts will get only the ids, and the query will be much faster. You’ll also need to at least specify download for the post_type. Example:

    $args = array(
        'fields'    => 'ids',
        'post_type' => 'download',
    );

    $downloads = get_posts( $args );

You may use any option you wish in
get_posts() to narrow your query.
Full documentation for get_posts() here.

One additional option not found in the documentation for
get_posts() is called no_found_rows(). This removes some data required for pagination, but dramatically speeds up your query. If you need pagination don’t use this option. If you don’t need pagination it would look like this:

$args = array(
	'fields'        => 'ids',
        'post_type'     => 'download',
	'no_found_rows' => true,
);

$downloads = get_posts( $args );

The above query will return an array of download_ids like this:

Array
(
    [0] => 109
    [1] => 82
    [2] => 79
    [3] => 61
    [4] => 42
)

Working With Multiple Products

Once you have an array of download_ids you may simply iterate over the array creating EDD_Download objects like this:

foreach ( $downloads as $key => $download_id ) {
	$download = new EDD_Download( $download_id );
	// do whatever you wish with each object
}

The post Querying Products in the Database first appeared on Easy Digital Downloads.

]]>
EDD REST API V2 – Products https://easydigitaldownloads.com/docs/edd-rest-api-v2-products/ Mon, 24 Jan 2022 19:57:10 +0000 https://edd-site.lndo.site/docs/edd-rest-api-v2-products/ This document relates specifically to Version 2 of the EDD API. Documentation for Version 1 is here. The EDD REST API provides access to product information via the /products/ endpoint. You may access multiple products or a single product. NOTE: The products endpoint does not need a key or token to render publicly available products.

The post EDD REST API V2 – Products first appeared on Easy Digital Downloads.

]]>
This document relates specifically to Version 2 of the EDD API.
Documentation for Version 1 is here.

The
EDD REST API provides access to product information via the /products/ endpoint. You may access multiple products or a single product.

NOTE: The products endpoint does not need a key or token to render publicly available products. If your product is publicly available on the front of your site, it’s available via API without a key or token.

A basic products query looks like this:

http://example.com/edd-api/v2/products/

A sample products response looks like this,
notes below:

{
    "products": [
        {
            "info": {
                "id": 45,
                "slug": "pdf-test",
                "title": "PDF Test",
                "create_date": "2016-05-23 18:44:51",
                "modified_date": "2016-06-08 17:30:54",
                "status": "publish",
                "link": "http://example.com/?post_type=download&p=45",
                "content": "",
                "excerpt": "",
                "thumbnail": false,
                "category": [
                    {
                        "term_id": 3,
                        "name": "ebooks",
                        "slug": "ebooks",
                        "term_group": 0,
                        "term_taxonomy_id": 3,
                        "taxonomy": "download_category",
                        "description": "",
                        "parent": 0,
                        "count": 2,
                        "filter": "raw",
                        "object_id": 45
                    }
                ],
                "tags": [
                    {
                        "term_id": 7,
                        "name": "pdf",
                        "slug": "pdf",
                        "term_group": 0,
                        "term_taxonomy_id": 7,
                        "taxonomy": "download_tag",
                        "description": "",
                        "parent": 0,
                        "count": 1,
                        "filter": "raw",
                        "object_id": 45
                    }
                ],
                "sku": "AAMAM2016"
            },
            "stats": {
                "total": {
                    "sales": "0",
                    "earnings": "0.00"
                },
                "monthly_average": {
                    "sales": "0",
                    "earnings": "0.00"
                }
            },
            "pricing": {
                "amount": "1.00"
            },
            "files": [
                {
                    "index": "0",
                    "attachment_id": "18",
                    "name": "WCCHI_2014_page_speed",
                    "file": "http://example.com/wp-content/uploads/edd/2016/05/WCCHI_2014_page_speed.pdf",
                    "condition": "all"
                }
            ],
            "notes": "",
            "licensing": {
                "enabled": false,
                "version": "",
                "exp_unit": "days",
                "exp_length": ""
            }
        },
        {
            "info": {
                "id": 42,
                "slug": "variable-license",
                "title": "Variable license",
                "create_date": "2016-05-20 22:21:38",
                "modified_date": "2016-05-23 17:32:47",
                "status": "publish",
                "link": "http://example.com/?post_type=download&p=42",
                "content": "",
                "excerpt": "",
                "thumbnail": false,
                "category": false,
                "tags": false,
                "sku": "-"
            },
            "stats": {
                "total": {
                    "sales": "0",
                    "earnings": "0.00"
                },
                "monthly_average": {
                    "sales": "0",
                    "earnings": "0.00"
                }
            },
            "pricing": {
                "monthly": "10.00",
                "yearly": "120.00"
            },
            "files": [
                {
                    "index": "0",
                    "attachment_id": "18",
                    "name": "WCCHI_2014_page_speed",
                    "file": "http://example.com/wp-content/uploads/edd/2016/05/WCCHI_2014_page_speed.pdf",
                    "condition": "all"
                }
            ],
            "notes": "",
            "licensing": {
                "enabled": true,
                "version": "",
                "exp_unit": "days",
                "exp_length": ""
            }
        },
        {
            "info": {
                "id": 17,
                "slug": "i-am-pippin-williamson-and-so-can-you",
                "title": "I am Pippin Williamson, and so can YOU",
                "create_date": "2016-05-17 14:03:50",
                "modified_date": "2016-06-02 19:51:17",
                "status": "publish",
                "link": "http://example.com/?post_type=download&p=17",
                "content": "This is a test",
                "excerpt": "",
                "thumbnail": false,
                "category": [
                    {
                        "term_id": 3,
                        "name": "ebooks",
                        "slug": "ebooks",
                        "term_group": 0,
                        "term_taxonomy_id": 3,
                        "taxonomy": "download_category",
                        "description": "",
                        "parent": 0,
                        "count": 2,
                        "filter": "raw",
                        "object_id": 17
                    }
                ],
                "tags": false,
                "sku": "-"
            },
            "stats": {
                "total": {
                    "sales": "4",
                    "earnings": "78.000000"
                },
                "monthly_average": {
                    "sales": "4",
                    "earnings": "78.000000"
                }
            },
            "pricing": {
                "amount": "20.00"
            },
            "files": [
                {
                    "index": "0",
                    "attachment_id": "18",
                    "name": "WCCHI_2014_page_speed",
                    "file": "http://example.com/wp-content/uploads/edd/2016/05/WCCHI_2014_page_speed.pdf",
                    "condition": "all"
                }
            ],
            "notes": "This is my download note!",
            "licensing": {
                "enabled": false,
                "version": "",
                "exp_unit": "",
                "exp_length": ""
            }
        },
    ],
    "request_speed": 0.0075628757476807
}

If SKUs are turned on, but the field is empty, it will render a hyphen, as in the second product in the example above.

Filtering Products

Specific Products

If you want to retrieve info for only a specific product, you can pass a product ID via the
product parameter:

http://example.com/edd-api/v2/products/?product=55
Searching

If you want to search for a product you can pass a search phrase via the
s paramenter:

http://example.com/edd-api/v2/products/?s=PDF
Tags and Categories

You may narrow your search using the keywords category and tag, followed by either a slug or ID. Some examples:

http://example.com/edd-api/v2/products/?category=ebooks
http://example.com/edd-api/v2/products/?category=3
http://example.com/edd-api/v2/products/?tag=pdf
http://example.com/edd-api/v2/products/?tag=42

Combined example:

http://example.com/edd-api/v2/products/?category=ebooks&tag=pdf

The post EDD REST API V2 – Products first appeared on Easy Digital Downloads.

]]>
edd_update_payment_status https://easydigitaldownloads.com/docs/edd_update_payment_status/ Mon, 24 Jan 2022 19:57:08 +0000 https://edd-site.lndo.site/docs/edd_update_payment_status/ This action runs after a payment status has been updated. do_action( 'edd_update_payment_status', $payment_id, $new_status, $old_status );

The post edd_update_payment_status first appeared on Easy Digital Downloads.

]]>
This action runs after a payment status has been updated.

do_action( 'edd_update_payment_status', $payment_id, $new_status, $old_status );

The post edd_update_payment_status first appeared on Easy Digital Downloads.

]]>
edd_get_cart_contents() https://easydigitaldownloads.com/docs/edd_get_cart_contents/ Mon, 24 Jan 2022 19:57:07 +0000 https://edd-site.lndo.site/docs/edd_get_cart_contents/ This function returns a nested array of items currently in the cart. Each item, by default, contains the following items: id – The download ID of the cart item options – An array holding optional data, such as price_id (when variable pricing is enabled for the download) quantity – The quantity value. When quantities are

The post edd_get_cart_contents() first appeared on Easy Digital Downloads.

]]>
This function returns a nested array of items currently in the cart. Each item, by default, contains the following items:

  • id – The download ID of the cart item
  • options – An array holding optional data, such as price_id (when variable pricing is enabled for the download)
  • quantity – The quantity value. When quantities are disabled, this should always read 1

Common uses of the options array are things like variable pricing, software licensing upgrades & renewals, and recurring payments.

Example Usage

$cart_contents = edd_get_cart_contents();
if ( ! empty( $cart_contents ) ) {
	foreach ( $cart_contents as $item ) {
		// Execute your code
	}
}

Note: In our example we assigned the contents of edd_get_cart_contents() to a variable before checking it with the `empty` function in our conditional statement. This is to maintain compatibility with PHP 5.2.

Important Information

When called, this function does validate that each item in the cart meets two requirements.

  1. That it is of the post type `download`.
  2. That the item is in a status that allows it to be purchased (non-editors cannot purchase posts that are not published).

If an item fails to meet either of those two requirements, it will be removed from the cart prior to returning the results.

Filters

This function contains one filter just before returning its results. The filter name is:

return apply_filters( 'edd_cart_contents', $cart );

It passes in one argument, which is the current cart contents, after all validation has been done.

Find this function in GitHub

The post edd_get_cart_contents() first appeared on Easy Digital Downloads.

]]>
edd_price() https://easydigitaldownloads.com/docs/edd_price/ Mon, 24 Jan 2022 19:57:06 +0000 https://edd-site.lndo.site/docs/edd_price/ This function will output a nicely formatted price of any specified download. It accepts three parameters: A download id, for the download whose price should be displayed An echo boolean. Defaults to true. A price id for variable pricing. Defaults to the first variation Example: edd_price( 12 ); // will output something like $10 for

The post edd_price() first appeared on Easy Digital Downloads.

]]>
This function will output a nicely formatted price of any specified download. It accepts three parameters:

  • A download id, for the download whose price should be displayed
  • An echo boolean. Defaults to true.
  • A price id for variable pricing. Defaults to the first variation

Example:

edd_price( 12 ); // will output something like $10 for product 12

$edd_price = edd_price( 12, false ); // stores the amount for download id 12 in $edd_price

edd_price( 12, true, 1 ); // echos the price of the first variation on download id 12

The price amount is formatted with the currency set in the plugin options, as well as the currency sign position.

For an example of using this in a theme,
see here.

The post edd_price() first appeared on Easy Digital Downloads.

]]>
edd_complete_purchase https://easydigitaldownloads.com/docs/edd_complete_purchase/ Mon, 24 Jan 2022 19:57:05 +0000 https://edd-site.lndo.site/docs/edd_complete_purchase/ This action runs when a payment is marked as complete. Since EDD v1.6 do_action( 'edd_complete_purchase', $payment_id ); Simple example function pw_edd_on_complete_purchase( $payment_id ) { // Basic payment meta $payment_meta = edd_get_payment_meta( $payment_id ); // Cart details $cart_items = edd_get_payment_meta_cart_details( $payment_id ); // do something with payment data here } add_action( 'edd_complete_purchase', 'pw_edd_on_complete_purchase' );

The post edd_complete_purchase first appeared on Easy Digital Downloads.

]]>
This action runs when a payment is marked as complete.

Since EDD v1.6

do_action( 'edd_complete_purchase', $payment_id );

Simple example

function pw_edd_on_complete_purchase( $payment_id ) {
	// Basic payment meta
	$payment_meta = edd_get_payment_meta( $payment_id );
	// Cart details
	$cart_items = edd_get_payment_meta_cart_details( $payment_id );
	// do something with payment data here
}
add_action( 'edd_complete_purchase', 'pw_edd_on_complete_purchase' );

The post edd_complete_purchase first appeared on Easy Digital Downloads.

]]>
EDD_Download https://easydigitaldownloads.com/docs/edd_download/ Mon, 24 Jan 2022 19:57:04 +0000 https://edd-site.lndo.site/docs/edd_download/ The EDD_Download class is used for getting data about a specific Download, creating new Downloads, and editing existing Downloads.  The public properties that may be managed with this class are: Note: The above properties are inherited from and identical to the properties in WP_Post. Creating a Download To create a new download you first instantiate

The post EDD_Download first appeared on Easy Digital Downloads.

]]>
The EDD_Download class is used for getting data about a specific Download, creating new Downloads, and editing existing Downloads.  The public properties that may be managed with this class are:

  • $ID = 0;
  • $post_author = 0;
  • $post_date = ‘0000-00-00 00:00:00’; 
  • $post_date_gmt = ‘0000-00-00 00:00:00’; 
  • $post_content = ”;
  • $post_title = ”;
  • $post_excerpt = ”;
  • $post_status = ‘publish’; 
  • $comment_status = ‘open’;
  • $ping_status = ‘open’;
  • $post_password = ”;
  • $post_name = ”;
  • $to_ping = ”;
  • $pinged = ”;
  • $post_modified = ‘0000-00-00 00:00:00’; 
  • $post_modified_gmt = ‘0000-00-00 00:00:00’; 
  • $post_content_filtered = ”;
  • $post_parent = 0;
  • $guid = ”;
  • $menu_order = 0;
  • $post_mime_type = ”;
  • $comment_count = 0;
  • $filter;

Note: The above properties are inherited from and identical to the properties in WP_Post.

Creating a Download

To create a new download you first instantiate the class and then run the create() method.

$new_download = new EDD_Download;
$new_download->create();

This will create a single Download with default settings, which are a Draft with the title of ‘New Download Product’.

The create method uses 
wp_insert_post(), so you may pass any arguments to create() that wp_insert_post() can accept.  Something like this would work fine:

$new_download = new EDD_Download;

$download_args = array(
	'post_title'    => 'My eBook',
	'post_content'  => 'This is my eBook. Nice long description.',
	'post_status'   => 'publish',
)
$new_download->create( $download_args );

Loading an Existing Download

This is accomplished simply by passing a Download ID to the class name during instantiation.

Example:

$my_download = new EDD_Download( 1492 );

Data Fetching Methods

EDD_Download has a variety of method for getting data about the Download, manipulating meta data, and testing for various things.

get_ID()

This method simply returns the ID of the Download.

Example:

$download_id = $my_download->get_ID();

Returns: an integer, like 1492.

get_price()

This method returns the price of the Download in double format, with no currency symbol.

Example:
$download_price = $my_download->get_price();

Returns: a double, like 9.99. Math may be done on this result.

get_prices()

This method returns an array of the variable prices of the Download in double format, with no currency symbol.

Example:
$variable_prices = $my_download->get_prices();

Returns an array of prices like this:

Array
(
    [1] => Array
        (
            [index] => 1
            [name] => Regular
            [amount] => 9.99
        )

    [2] => Array
        (
            [index] => 
            [name] => Unleaded
            [amount] => 19.99
        )
is_single_price_mode()

Determines whether Single Price Mode is enabled or disabled.  Single price mode refers to whether multiple price options can be purchased simultaneously.  In the Easy Digital Downloads user interface the checkbox for it is under Variable Pricing.

Example:
$is_single_price_mode = $my_download->is_single_price_mode();

Returns: true or false

has_variable_prices()

Determines whether Variable Pricing is enabled or disabled on a specific Download.

Example:
$download_price = $my_download->has_variable_prices();

Returns: true or false

get_files()

This method returns an array of the files attached to the Download

Example:
$my_files = $my_download->get_files();

Returns an array of prices like this:

Array
(
    [0] => Array
        (
            [attachment_id] => 10
            [name] => Be Kind To Your Web Footed Friends
            [file] => http://example.com/wp-content/uploads/edd/2015/05/be_kind_to_your_web_footed_friend.mp3
            [condition] => all
        )

)
get_file_download_limit()

This method gets the number of times this file may be downloaded.

Example:

$download_limit = $my_download->get_file_download_limit();

Returns: an integer, like 100.

get_file_price_condition()

When a product has variable pricing, one or more files may available for purchase. Under the Price Assignment, Files can be associated with All price options or only specific ones.  In the example below the file is associated with Tracks 1, 2, 3 and Full Album.

Example:

$price_condition = $my_download->get_file_price_condition();

Returns: an integer, like 2.

get_type()

Returns value showing whether the Download is a Bundle or Default.

Example:

$download_type = $my_download->get_type();

Returns: either ‘default’ or ‘bundle’

is_bundled_download()

Determine if this is a bundled download.

Example:

$is_bundled_download = $my_download->is_bundled_download();

Returns: true or false

get_bundled_downloads()

Gets the Download ids of the items in a bundled Download.

Example:

$bundled_downloads = $my_download->get_bundled_downloads();

Returns: An array of Download ids like this:

Array
(
    [0] => 68
    [1] => 114
)

Note: get_bundled_downloads() will return an empty array if the product is not a bundle, so look at doing something like this:

if ( $my_download->is_bundled_download() ) {
	$bundled_downloads = $my_download->get_bundled_downloads();
}
get_notes()

Returns the notes for a Download as a string.

Example:

$download_notes = $my_download->get_notes();

Returns: The notes as a string, and maintains line breaks.

get_sku()

Returns the sku for a Download as a string.

Example:

$download_sku = $my_download->get_sku();

Returns: The sku as a string

get_button_behavior()

Returns the what happens when someone clicks the buy button

Example:

$download_button_behavior = $my_download->get_button_behavior();

Returns: either ‘direct’ for Buy Now or ‘add_to_cart’ for Add To Cart.

get_sales()

Returns the number of sales completed for this item

Example:

$download_sales = $my_download->get_sales();

Returns: an integer like 42

increase_sales()

Increments the number of sales by 1. Cannot take input, cannot increase by more than 1.

Example:

$increase_sales = $my_download->increase_sales();

Returns: either false on failure or an integer of the new sales count.

decrease_sales()

Decrements the number of sales by 1. Cannot take input, cannot increase by more than 1.

Example:

$decrease_sales = $my_download->decrease_sales();

Returns: either false on failure or an integer of the new sales count.

get_earnings()

Returns the total earning for this download.

Example:

$download_earnings = $my_download->get_earnings();

Returns: a float like 152.69

increase_earnings( mixed $amount = 0 )

Increases the total earnings for a Download by the input amount.

Example:

$increase_earnings = $my_download->increase_earnings();

Returns: either false on failure or a float of the new amount, like 247.39

decrease_earnings( mixed $amount = 0 )

Decreases the total earnings for a Download by the input amount.

Example:

$decrease_earnings = $my_download->decrease_earnings();

Returns: either false on failure or a float of the new amount, like 147.39

is_free( mixed $price_id = false )

Checks to see if the download is free, OR if the given price ID is free.

Example:

$is_free = $my_download->is_free();

Returns: true or false

The post EDD_Download first appeared on Easy Digital Downloads.

]]>
EDD_SLUG https://easydigitaldownloads.com/docs/edd_slug/ Mon, 24 Jan 2022 19:57:03 +0000 https://edd-site.lndo.site/docs/edd_slug/ This constant allows you to change the post type slug (also referred to as permalink or URL suffix) of the download post type. By default the slug is downloads, resulting in URLs that looks like this: http://yoursite.com/downloads/download-name, but by using this constant, you can define the slug as anything you want. Place the following code snippet to

The post EDD_SLUG first appeared on Easy Digital Downloads.

]]>
This constant allows you to change the post type slug (also referred to as permalink or URL suffix) of the download post type. By default the slug is downloads, resulting in URLs that looks like this: http://yoursite.com/downloads/download-name, but by using this constant, you can define the slug as anything you want.

Place the following code snippet to change the slug of the download post type:

define('EDD_SLUG', 'my-downloads-slug');

The best way to apply the code snippet to your site is with a plugin that allows you to add custom code to your site. To do that, we recommend using WPCode. Click here to learn how to apply the snippet using WPCode.

Note: after doing this, you should resave your permalink structure for the changes to fully take effect.

The post EDD_SLUG first appeared on Easy Digital Downloads.

]]>
EDD_Payment https://easydigitaldownloads.com/docs/edd_payment/ Mon, 24 Jan 2022 19:57:02 +0000 https://edd-site.lndo.site/docs/edd_payment/ Table of Contents Available Properties Available Methods Examples The EDD_Payment class makes it easy to create, edit, and delete payment information in Easy Digital Downloads. Here are some examples: Example of creating a new payment $payment = new EDD_Payment(); $payment->add_download( 97 ); $payment->email = 'steve@example.com'; $payment->status = 'complete'; $payment->save(); Example of updating the email on

The post EDD_Payment first appeared on Easy Digital Downloads.

]]>
Table of Contents

The EDD_Payment class makes it easy to create, edit, and delete payment information in Easy Digital Downloads. Here are some examples:

Example of creating a new payment
$payment = new EDD_Payment();
$payment->add_download( 97 );
$payment->email = 'steve@example.com';
$payment->status = 'complete';
$payment->save();
Example of updating the email on an existing payment:
$payment = new EDD_Payment( 4023 );
$payment->email = 'steve@example.com';
$payment->save();

Available Properties

These are the properties which are available to your object:

  • $ID
  • $number
  • $mode
  • $key
  • $total
  • $subtotal
  • $tax
  • $fees
  • $discounts
  • $date
  • $completed_date
  • $status
  • $old_status
  • $status_nicename
  • $customer_id
  • $user_id
  • $first_name
  • $last_name
  • $email
  • $address
  • $transaction_id
  • $downloads
  • $ip
  • $gateway
  • $currency
  • $cart_details
  • $has_unlimited_downloads
  • $pending
  • $parent_payment

Available Methods

add_download( $download_id = 0, $args = array(), $options = array() )

This method allows you to add a download to a payment. It accepts three arguments:

$download_id

This is the ID of the download you wish to attach. It’s always an integer.

$args

This is an array that can over-ride these built in defaults:

            'quantity'    => 1,
            'price_id'    => false,
            'item_price'  => 0.00,
            'tax'         => 0.00,
            'fees'        => array()

Fees may be anything required, but follows the format of
add_fee(). For more information see the docs for EDD_Fees.

$options

This is an array that can accept arbitrary options for the download. Examples might be
is_renewal or is_upgrade for the Software Licensing extension.

IMPORTANT: if you add a download to a Completed payment the new download will be set to a zero price. If you add a download to a payment with any other status, that download carries its default financial value, and the total value of the payment increases.

This default behavior may be over-ridden by sending an
item_price in the $args.

remove_download( $download_id, $args = array() )

This method allows you to remove a download from a payment. It accepts two arguments:

$download_id

This is the ID of the download you wish to attach. It’s always an integer.

$args

This is an array that can over-ride these built in defaults:

            'quantity'    => 1,
            'price_id'    => false,
            'item_price'  => 0.00,
            'cart_index'  => false,

NOTE: if your download is variable then the price_id is required so that the proper item is removed.

NOTE: By default remove_download() only removes one item. If you have multiple of the same item you’ll need to use the quantity option in the $args.

get_meta( $meta_key = ‘_edd_payment_meta’, $single = true )

This method gets the meta data associated with a payment. It accepts a meta key and a boolean to request the meta data in single mode or not.

Internally this method runs get_post_meta, but then applies some logic to provide backwards compatibility with EDD 1.5

It then runs apply_filters on
'edd_get_payment_meta_' . $meta_key and then returns the output after one more filter of edd_get_payment_meta

update_meta( $meta_key = ”, $meta_value = ”, $prev_value = ” )

This method allows you to update the post meta for a payment. It accepts a meta key, meta value, and a previous meta value for comparison.

Before updating, the meta_key is run through a filter called
'edd_update_payment_meta_' . $meta_key.

The return value is the output of
update_post_meta.

add_fee( $args = ”, $global = true )

This method allows you to attach an arbitrary fee to the payment. It functions exactly like the one in EDD_Fees, please read the documentation there.

remove_fee( $key )

This method allows you to remove a given fee. It functions exactly like the one in EDD_Fees,
please read the documentation there.

remove_fee_by( $key, $value, $global = false )

This method allows you to remove a fee without having to know its position in the fees array. For example, if you have a fee with a label of shipping you could do something like

$payment->remove_fee_by( 'label', 'Shipping' );

The above code would remove the first instance of a a fee with a label of Shipping. If you add the gobal true flag like this:

$payment->remove_fee_by( 'label', 'Shipping', true );

then it’ll remove ALL fees with a label of Shipping.

add_note( $note = false )

This method allows you to attach a note to the payment. Results will look something like this:

update_status( $status = false )

This method allows you to set the status of a given payment. Here are the possible statuses:

  • Pending
  • Complete
  • Refunded
  • Failed
  • Abandoned
  • Revoked

array_convert()

This method allows you to get all available properties as an array. Example:

$payment = new EDD_Payment( 4577 );
$payments_array = $payment->array_convert();

IMPORTANT: properties that have been moved to an array with array_convert will NOT be updated inside that array. If you need an updated version after a change you would need to re-run this method and re-populate your array.

save()

This method takes any changes or updates made by any other method and writes them to the database.

NOTE: if you don’t use save() then none of your changes will actually take place.

Examples

Here are some code examples of some common tasks:

Creating a payment

$payment = new EDD_Payment(); // Instantiates a payment object
$payment->add_download( 12 ); // Adds download id 12 to the payment at it's default price
$payment->email = 'lisa@example.org'; // Email is required for a payment
$payment->status = 'complete'; // Completes the payment
$payment->save(); // Writes to the database any changes that were made

Editing an existing payment

$payment = new EDD_Payment( 42 ); // Loads the information for Payment ID 42
$payment->email = 'john@example.org'; // Changes the email address on the payment
$payment->save();

Changing a payment status

$payment = new EDD_Payment( 1337 );
$payment->status = 'revoked';
$payment->save();

Adding a variable priced download

$payment = new EDD_Payment( 1942 );
$args = array(
    'price_id' => 1, // Variable price ID
    'item_price' => 0.00, // Makes the item free
);
$payment->add_download( 23, $args ); // Adds Download ID 23, variable price 1 to the payment
$payment->save();

Adding a download with options

$payment = new EDD_Payment( 2008 );
$args = array(
    'item_price' => 4.00,
);
$options = array(
    'is_renewal' => true,
);
$payment->add_download( 28, $args, $options );
$payment->save();

Removing a download

$payment = new EDD_Payment( 2008 );
$payment->remove_download( 23 );
$payment->save();

Removing a download with variable pricing

$payment = new EDD_Payment( 2008 );
$args = array(
    'price_id' => 1,
);
$payment->remove_download( 28, $args );
$payment->save();

The post EDD_Payment first appeared on Easy Digital Downloads.

]]>
EDD API Reference https://easydigitaldownloads.com/docs/edd-api-reference/ Mon, 24 Jan 2022 19:57:01 +0000 https://edd-site.lndo.site/docs/edd-api-reference/ This document has been replaced with newer information at https://easydigitaldownloads.com/docs/edd-api-reference/. Please use the new documentation for all future research.

The post EDD API Reference first appeared on Easy Digital Downloads.

]]>
This document has been replaced with newer information at
https://easydigitaldownloads.com/docs/edd-api-reference/.

Please use the new documentation for all future research.

The post EDD API Reference first appeared on Easy Digital Downloads.

]]>
Developer’s Intro to Easy Digital Downloads https://easydigitaldownloads.com/docs/developers-intro-to-easy-digital-downloads/ Mon, 24 Jan 2022 19:57:01 +0000 https://edd-site.lndo.site/docs/developers-intro-to-easy-digital-downloads/ Easy Digital Downloads has been built with developers in mind, which means that all of the code is well laid out, organized, easy to read, and documented. The source code for EDD is also highly extensible, which makes it extremely easy for developers to hook in their own pieces of functionality, or modify existing parts.

The post Developer’s Intro to Easy Digital Downloads first appeared on Easy Digital Downloads.

]]>
Easy Digital Downloads has been built with developers in mind, which means that all of the code is well laid out, organized, easy to read, and documented. The source code for EDD is also highly extensible, which makes it extremely easy for developers to hook in their own pieces of functionality, or modify existing parts.

If you are looking to do development on EDD, either by contributing to the core plugin or by creating extensions, there are a few things you should familiarize yourself with before you begin.

Github – Bug and Enhancement Tracking

The entire source for Easy Digital Downloads is available on
Github, and this is also where all main bug / enhancement tracking takes place. If you have developer-specific questions, it is best to create an Issue instead of leaving a comment here on this site. If you have an enhancement you would like to propose, Github is also the place to post it.

Organization

EDD’s source code is organized into separate, meaningfully named files. For example, all functions that relate to discount codes are placed in a file called ”
discount-functions.php“. If you are to do development work on EDD, then you are expected to follow the organization and naming convention that is already in place. If you create a new function that has to do with 3rd party plugin compatibility, you will place it into the “plugin-compatibility.php” file.

Function and Class Naming

Organization is one of the most important, but an equally important key to remember is naming. All functions, without exception, are prefixed with
edd_. This helps us ensure we do not create functions with conflicting names with other plugins or themes. For example, do not create a function named like this:

function get_download_details() {
	// do stuff here
}

Do this instead:

function edd_get_download_details() {
	// do stuff here
}

You should also take care to ensure you have named your function appropriately, and that a function does not already exist to do what you need.

Classes should follow the same rules.

Follow WordPress Standards

We work hard to make sure EDD follows the best coding standards, and we expect you to do the same. If you need assistance in learning some of the standards we expect of you, please consult the official 
WordPress Coding Standards codex.

Submitting Your Code

If you have written an add-on,
contact us to discuss getting it listed and possibly selling it on the site. If you are making a contribution to the core source code, please submit a Pull Request on the plugin’s Github page.

Development Blog

The
Easy Digital Downloads development blog is the best place to keep informed of important changes, announcements, and developer guidance relating to EDD. If you develop extensions or do any kind of development relating to EDD, we highly recommend subscribing to the development blog.

The post Developer’s Intro to Easy Digital Downloads first appeared on Easy Digital Downloads.

]]>
EDD REST API – Introduction https://easydigitaldownloads.com/docs/edd-rest-api-introduction/ Mon, 24 Jan 2022 19:57:00 +0000 https://edd-site.lndo.site/docs/edd-rest-api-introduction/ Easy Digital Downloads includes a complete RESTful API that allows stored data to be retrieved remotely in either a JSON or XML format. The API includes methods for retrieving info about store products, store customers, store sales, and store earnings. Note: EDD’s REST API can only retrieve stored data, it cannot create Downloads/Products, Orders, or

The post EDD REST API – Introduction first appeared on Easy Digital Downloads.

]]>
Easy Digital Downloads includes a complete RESTful API that allows stored data to be retrieved remotely in either a JSON or XML format. The API includes methods for retrieving info about store products, store customers, store sales, and store earnings.

Note: EDD’s REST API can only retrieve stored data, it cannot create Downloads/Products, Orders, or Customers.

The API is accessed via the  edd-api end point of your store, like so:

https://yoursite.com/edd-api/

NOTE: If you are getting a 404 error when visiting the link above, you may need to re-save your permalinks. Do this by going to Dashboard > Settings > Permalinks > Save.

To access the API, you will need to provide a valid public API key and also a valid token. An API key and token can be generated for any user by going to  Downloads → Tools → API Keys:

The secret key is used for internal authentication and should never be used directly to access the API.

Individual users may go to their own profile and find their own key:

Once you have an API key, you can begin utilizing the EDD API. Both the API key and the token need to be appended to the URL as query parameters, like so:

https://yoursite.com/edd-api/?key=XXX&token=XXX

Paging Parameters

By default, the EDD API will return 10 results per page for the customers, sales, and products queries.

If a query has 20 results, the first ten will be displayed by default, but then the second 10 can be accessed by adding  &page=2 to the query string, like so:

https://yoursite.com/edd-api/sales/?key=c281cf0a95be875d9eeb284fb004c938&token=5f9432f3ffa5945755ebc66179810d70&page=2

You can change the number of results returned by using the number parameter. This example will return 25 results per page:

https://yoursite.com/edd-api/sales/?key=c281cf0a95be875d9eeb284fb004c938&token=5f9432f3ffa5945755ebc66179810d70&number=25

If you want to retrieve all results (no paging), set number to -1.

FAQ

Can you create orders, products, or customers via API?
No, you cannot create via the API. Our REST API currently only supports pulling data from your store.

The post EDD REST API – Introduction first appeared on Easy Digital Downloads.

]]>
Guidelines for 3rd-Party Extensions https://easydigitaldownloads.com/docs/guidelines-for-3rd-party-extensions/ Mon, 24 Jan 2022 19:56:57 +0000 https://edd-site.lndo.site/docs/guidelines-for-3rd-party-extensions/ Developers are welcome and encouraged to make extensions for Easy Digital Downloads. Here are some guidelines to follow when creating an extension. Naming 3rd-Party Extensions 3rd-party extensions should use the naming convention “Extension Name for Easy Digital Downloads”.  This is standard practice for other plugins that have 3rd-party add ons and helps differentiate between our

The post Guidelines for 3rd-Party Extensions first appeared on Easy Digital Downloads.

]]>
Developers are welcome and encouraged to make extensions for Easy Digital Downloads. Here are some guidelines to follow when creating an extension.

Naming 3rd-Party Extensions

3rd-party extensions should use the naming convention “Extension Name for Easy Digital Downloads”. 

This is standard practice for other plugins that have 3rd-party add ons and helps differentiate between our official extensions and 3rd-party extensions.

Please do not use the naming convention “Easy Digital Downloads – Extension Name”, as it’s used for official Easy Digital Download extensions. 

Easy Digital Downloads Branding

If you are referencing the Easy Digital Downloads brand, please use the proper assets (logos & color scheme).

WordPress.org Guidelines

Every plugin should follow the official WordPress.org repository guidelines; in regards to EDD extensions, make sure you read Plugins must respect trademarks, copyrights, and project names.

Settings

3rd-party extensions should place your EDD specific settings under Downloads → Settings → Extensions → Your Extension Name. To see an example of how to register your subsection and settings, you can reference this Gist:

3rd-Party Extensions Page

Contact support to request that your extension get added to our 3rd-Party Extensions page. Please include your extension’s name, description and website.

The post Guidelines for 3rd-Party Extensions first appeared on Easy Digital Downloads.

]]>
Themedd – Menus https://easydigitaldownloads.com/docs/themedd-menus/ Mon, 24 Jan 2022 19:56:52 +0000 https://edd-site.lndo.site/docs/themedd-menus/ Themedd has 3 display locations that you can add a menu to. Primary Menu A menu assigned to the Primary Menu display location will show just below the site title. Secondary Menu A menu assigned to the Secondary Menu display location will show to the far right of the site title. Mobile Menu A menu

The post Themedd – Menus first appeared on Easy Digital Downloads.

]]>
Themedd has 3 display locations that you can add a menu to.

Primary Menu

A menu assigned to the Primary Menu display location will show just below the site title.

Secondary Menu

A menu assigned to the Secondary Menu display location will show to the far right of the site title.

Mobile Menu

A menu assigned to the Mobile Menu display location will show only for mobile devices. Use this menu location to provide a more streamlined experience to mobile users, where screen real estate is scarce. If no menu is assigned to this location, the menu assigned to the Primary Menu location will be shown to mobile device users.

To learn more about menus, including creating them, adding items to a menu, deleting items and more, see the official WordPress Menu User Guide.

The post Themedd – Menus first appeared on Easy Digital Downloads.

]]>
Checkout Fields Manager – Importing and Exporting Fields https://easydigitaldownloads.com/docs/checkout-fields-manager-importing-and-exporting-fields/ Mon, 24 Jan 2022 19:56:50 +0000 https://edd-site.lndo.site/docs/checkout-fields-manager-importing-and-exporting-fields/ With Checkout Fields Manager, checkout fields can be exported for backup or exported/imported into a different website or store. This can save a great deal of time when replicating a setup or restoring after data loss. Once your form is built, you may go to Downloads → Tools → Checkout Fields Manager and export your

The post Checkout Fields Manager – Importing and Exporting Fields first appeared on Easy Digital Downloads.

]]>
With Checkout Fields Manager, checkout fields can be exported for backup or exported/imported into a different website or store. This can save a great deal of time when replicating a setup or restoring after data loss.

Once your form is built, you may go to Downloads → Tools → Checkout Fields Manager and export your form in .json format. You may also import a previously exported .json file to either restore or recreate a form.

The post Checkout Fields Manager – Importing and Exporting Fields first appeared on Easy Digital Downloads.

]]>
Themedd – Frequently Asked Questions https://easydigitaldownloads.com/docs/themedd-frequently-asked-questions/ Mon, 24 Jan 2022 19:56:44 +0000 https://edd-site.lndo.site/docs/themedd-frequently-asked-questions/ Do you have a demo of Themedd? We sure do! To view a demo of Themedd, visit our fictional eBook website, Success Stories. Could I run a marketplace with Themedd? Yes, Themedd works perfectly with  Frontend Submissions. Why do some EDD extensions now look different? Themes were designed to change how your website looks. In some instances, Themedd

The post Themedd – Frequently Asked Questions first appeared on Easy Digital Downloads.

]]>
Do you have a demo of Themedd?

We sure do! To view a demo of Themedd, visit our fictional eBook website, Success Stories.

Could I run a marketplace with Themedd?

Yes, Themedd works perfectly with  Frontend Submissions.

Why do some EDD extensions now look different?

Themes were designed to change how your website looks. In some instances, Themedd provides custom styling for some EDD extensions to provide an enhanced user experience.

Does Themedd support the Digital Marketplace Bundle?

Yes, all extensions in the Digital Marketplace Bundle will look great with Themedd.

Note: the Digital Marketplace Bundle has been discontinued and replaced with Passes. See Pricing for more information.

Can I use a page builder plugin with Themedd?

Yes, there shouldn’t be any issues with using a page builder plugin with Themedd.

Can I make custom changes to Themedd?

Absolutely! The best way to do this is from a child theme.

Can I contribute to Themedd?

Yes you can! Themedd is open source so you can contribute via GitHub.

The post Themedd – Frequently Asked Questions first appeared on Easy Digital Downloads.

]]>
Checkout Fields Manager – Exporting Payment Data https://easydigitaldownloads.com/docs/checkout-fields-manager-exporting-payment-data/ Mon, 24 Jan 2022 19:56:41 +0000 https://edd-site.lndo.site/docs/checkout-fields-manager-exporting-payment-data/ With Checkout Fields Manager, the values submitted through the custom checkout fields are automatically appended to the Payment History CSV export file that can be generated from Downloads → Reports → Export. More detailed documentation on exporting Payment data here. FAQ Can I import custom checkout field data via CSV? No, custom checkout fields cannot currently

The post Checkout Fields Manager – Exporting Payment Data first appeared on Easy Digital Downloads.

]]>
With Checkout Fields Manager, the values submitted through the custom checkout fields are automatically appended to the Payment History CSV export file that can be generated from Downloads → Reports → Export.

FAQ

Can I import custom checkout field data via CSV?
No, custom checkout fields cannot currently be imported via CSV at this time.

The post Checkout Fields Manager – Exporting Payment Data first appeared on Easy Digital Downloads.

]]>
Troubleshooting Emails https://easydigitaldownloads.com/docs/troubleshooting-emails/ Mon, 24 Jan 2022 19:56:39 +0000 https://edd-site.lndo.site/docs/troubleshooting-emails/ If your emails are not being delivered, it is likely that your website is unable to deliver emails. The easiest way to resolve this is to send emails through an SMTP server. If you have your own SMTP server or wish to send emails through Gmail (or similar), install and configure the   Configure SMTP plugin.

The post Troubleshooting Emails first appeared on Easy Digital Downloads.

]]>
If your emails are not being delivered, it is likely that your website is unable to deliver emails. The easiest way to resolve this is to send emails through an SMTP server.

If you have your own SMTP server or wish to send emails through Gmail (or similar), install and configure the  
Configure SMTP plugin.

If you do not have your own SMTP server or are unsure how to setup the 
Configure SMTP plugin, we recommend using Mandrill, a free service offered by MailChimp:

  1. Create a free account at https://mandrillapp.com/
  2. Install and configure the wpMandrill plugin

Emails should now be properly sent based on the conditions specified.

If you do not wish to use Mandrill or your own SMTP server, 
SendGrid is another great option.

There are also a large number of other SMTP options available from the  
WordPress.org plugin repository.

The post Troubleshooting Emails first appeared on Easy Digital Downloads.

]]>
Zapier integration with Checkout Fields Manager https://easydigitaldownloads.com/docs/zapier-integration-with-checkout-fields-manager/ Mon, 24 Jan 2022 19:56:35 +0000 https://edd-site.lndo.site/docs/zapier-integration-with-checkout-fields-manager/ The Checkout Fields Manger extension for Easy Digital Downloads allows you to collect custom information from your customers while they are checking out. If you have the Zapier extension for Easy Digital Downloads as well, you can use that custom information in your Zapier account to send to hundreds of 3rd party apps. This document

The post Zapier integration with Checkout Fields Manager first appeared on Easy Digital Downloads.

]]>
The Checkout Fields Manger extension for Easy Digital Downloads allows you to collect custom information from your customers while they are checking out. If you have the Zapier extension for Easy Digital Downloads as well, you can use that custom information in your Zapier account to send to hundreds of 3rd party apps. This document will describe how to set that up.

Step 1: Set up your custom checkout fields

The first thing you need to do is make sure you have your custom checkout fields set up using Checkout Fields Manager for Easy Digital Downloads.  Follow the setup guide for it here.

Note: Make sure your custom fields are set to save to Payment Meta and not User Meta if you’re passing data related to payments.

You’ll also need to make sure you have installed the EDD Zapier extension.

Additionally, you need to be ready to make a “test” purchase. So put your EDD store into Test Mode by navigating  to Downloads  → Settings → Payment Gateways, and enable Test Mode. You’ll also want to enable the Test Payment Gateway:

Now you are ready to make a test purchase.

Step 2: Set up the “Zap” in your Zapier account.

Now that you have the custom fields created, you can set up the “Zap”, which will collect the new order information and allow you to port it to the 3rd party app of your choice.

In your Zapier account:

  1. Click this link to gain access to the (currently private) EDD App: https://zapier.com/developer/invite/26897/ef9fb387de3ff31c7661a7ffaa919d45.
  2. Create a new Zap and select Easy Digital Downloads as a triggering service:
  3. For the trigger, choose “New Order”:
  4. Choose the site you are working with. If this is the first time you have created a Zap with Easy Digital Downloads, you will need to authenticate your site by providing your site URL, API Key & API Token. To find those keys, follow the steps in this article
  5. Once you have authenticated your site, you’ll be on “Test this Step”. Here you need to complete a test purchase in your store, making sure you fill out the custom fields you’ve set up on your Checkout. By filling them out and completing a test purchase, Zapier will become aware that your custom fields exist.

    First, click the “Connect & Continue” button. This will make Zapier “Listen” for your test purchase.

    Second, complete a test purchase in your EDD Store. In a separate browser tab, go to your store, add one of your products to the cart, and click “Checkout”. Again, make sure you fill out the custom fields on your Checkout page with some test data.

  6. Once you’ve completed the test purchase, go back to the Zapier tab. It will now say “Test Successful” and look like this:
  7. Now you can set up the integration with the 3rd party app of your choosing. For this example we will use the “Email” action to email ourself whenever a new order is placed. We’ll make the email body contain my custom field information which was entered by the customer at checkout. For the Body (HTML or Plain) area, click on the top right icon and find your custom field in the dropdown. This will add it to the body.Now that you’ve put your custom field data into the body, you can finish setting up the “Zap” as normal and activate it in your Zapier account. That’s all there is to it!

Note: Keep in mind that it is extremely important that you follow all of these steps in this order. If you don’t you may not see your custom fields in Zapier.

Also, once you’ve set up your “Zap” successfully, make sure to take your store back out of Test Mode in your EDD settings.

The post Zapier integration with Checkout Fields Manager first appeared on Easy Digital Downloads.

]]>
Fraud Monitor – Configuring Geofencing https://easydigitaldownloads.com/docs/fraud-monitor-configuring-geofencing/ Mon, 24 Jan 2022 19:56:32 +0000 https://edd-site.lndo.site/docs/fraud-monitor-configuring-geofencing/ The Geofencing feature of Fraud Monitor allows store owners to flag payments that are outside of a ‘fenced’ area, based off geolocation data. By using the Google GeoCode API, we can determine an accurate location for the billing information and couple it with the IP Address location to identify when a purchase might be invalid.

The post Fraud Monitor – Configuring Geofencing first appeared on Easy Digital Downloads.

]]>
The Geofencing feature of Fraud Monitor allows store owners to flag payments that are outside of a ‘fenced’ area, based off geolocation data. By using the Google GeoCode API, we can determine an accurate location for the billing information and couple it with the IP Address location to identify when a purchase might be invalid. Store owners can ‘fence’ payments by country or by distance.

For example, this can be used to detect if a purchase is made from a country other than the country associated with the billing address, then flag the purchase as potentially fraudulent.

Enabling Geofencing

The GeoFence feature is located in the ‘Country’ section of the Fraud Monitor configuration under Downloads → Tools → Fraud Monitor → Country.

Obtaining GeoCode API Keys

To obtain accurate location information, Fraud Monitor uses the Google GeoCode API. You need to set up an API Key to use this service.

1) Visit  https://developers.google.com/maps/documentation/geocoding/get-api-key#creating-api-keys

2) Click the ‘Get a Key’ button

3) Set up an API Key

If you have existing API Keys with Google, you need to select ‘+ Create a new project’ and then choose a name for your project:

If you do not have existing API Keys, you’ll be prompted to create one:

In both cases, once you add a project name, click ‘Create and Enable API’

4) Get your API Key for use with Fraud Monitor:

5) Add your GeoCode API Key to the Fraud Monitor settings:

Configuring a GeoFence Type

To allow store owners to customize their settings to suit their needs, Fraud Monitor allows you to configure your fence to be by “Country” or by “Distance”.

By Country

When you choose the ‘country’ setting, Fraud Monitor will compare the country supplied at checkout to the billing information and the country the IP address is registered to. If these two do not match, the payment will be flagged as fraud, for review.

By Distance

The ‘distance’ setting uses the billing address and IP address to approximate a distance based off the GeoLocation data to determine if the purchase was made from within the ‘fence’. It can be configured to use either miles or kilometers.

At the time of writing, the Google GeoCode API no longer limits the number of free requests per day however they do set a limit of maximum 50 requests/second. Once you reach this limit, Fraud Monitor will stop checking the API and bypass the Geofence feature. For more information on increasing that limit, you can see the Usage Limits section of the Google documentation.

The post Fraud Monitor – Configuring Geofencing first appeared on Easy Digital Downloads.

]]>
Campaign Monitor- Setup Documentation https://easydigitaldownloads.com/docs/campaign-monitor-setup-documentation/ Mon, 24 Jan 2022 19:56:31 +0000 https://edd-site.lndo.site/docs/campaign-monitor-setup-documentation/ The Campaign Monitor email marketing extension adds an option for your customers to join your Campaign Monitor email list during checkout. Configuration Instructions for Campaign Monitor 1. Once installed, locate the settings for this extension via WordPress admin → Downloads → Settings → Extensions → Campaign Monitor 2. Enter your API Key and Client ID

The post Campaign Monitor- Setup Documentation first appeared on Easy Digital Downloads.

]]>
The Campaign Monitor email marketing extension adds an option for your customers to join your Campaign Monitor email list during checkout.

Configuration Instructions for Campaign Monitor

1. Once
installed, locate the settings for this extension via WordPress admin → Downloads → Settings → Extensions → Campaign Monitor

2. Enter your API Key and Client ID found under
Account Settings → API Keys in your Campaign Monitor account dashboard.

Note: Your Campaign Monitor lists will not appear until the API Key and Client ID are saved.

3. Finally set a Checkout Label if you wish and click
Save Settings. By default the checkout page will show Sign up for our mailing list”. Once you Save Settings, all available lists will appear.

The post Campaign Monitor- Setup Documentation first appeared on Easy Digital Downloads.

]]>
Software Licensing – Staged Rollouts https://easydigitaldownloads.com/docs/software-licensing-staged-rollouts/ Mon, 24 Jan 2022 19:56:31 +0000 https://edd-site.lndo.site/docs/software-licensing-staged-rollouts/ Software Licensing version 3.8 added a new “Staged Rollouts” feature that allows you to set conditions for receiving automatic updates via the API. There are two types of staged rollouts that are available: Percentage rollouts – where a percentage of sites are given access to the update. Version rollouts – where the update is only

The post Software Licensing – Staged Rollouts first appeared on Easy Digital Downloads.

]]>
Software Licensing version 3.8 added a new “Staged Rollouts” feature that allows you to set conditions for receiving automatic updates via the API. There are two types of staged rollouts that are available:

  1. Percentage rollouts – where a percentage of sites are given access to the update.
  2. Version rollouts – where the update is only made available to sites currently using a lower or higher version than what you specify.

Note: These features only apply to updates given through the Software Licensing API. They do not apply to customers who are manually downloading the latest version through their account area.

Percentage rollouts

Checkbox to enable percentage rollouts

When enabled, you can choose what percent of sites should be given access to the new version. For example, if set to 50% then half of sites that check in for an update will be given the new version, and the other half will not see that an update is available (they will keep their existing version).

This can be useful if you want to test a major release with a smaller pool of sites before making it available to everyone. You can initially set the percentage lower, and slowly raise it until you’re comfortable making it available to your entire customer base (at which point you would disable staged rollouts completely).

Version rollouts

This option allows you to set version requirements for a new update.

  • If you choose less than or equal to, then customers will only be given access to this new version if they are currently on a version less than or equal to what you specify in the “Version Number” box. If you enter “2.5”, then a customer who’s on version “2.1” will see the update, but a customer who’s on version “2.6” will not.
  • If you choose greater than or equal to, then customers will only be given access to this new version if they are currently on a version greater than or equal to what you specify in the “Version Number” box. If you enter “2.5”, then a customer who’s on version “2.1” will not see the update, but a customer who’s on version “2.6” will see it.

The post Software Licensing – Staged Rollouts first appeared on Easy Digital Downloads.

]]>