Completed Order Email doesn't Contain Download Links
Completed Order Email doesn’t Contain Download Links
On some WooCommerce installs you can experience the following issue: when a customer purchases a downloadable product, the Complete Order Emaildoesn’t contain any download link for the customer to download purchased products. Here is how the email looks like in that case:
No Download Link In Completed Order Email
While it should look like this:
Download Link included In Completed Order Email
↑ Back to top
This happens because a SQL table called wp_woocommerce_downloadable_product_permissions is missing in your database.
When activating WooCommerce, a few new SQL tables are added in your database. You can find the list of all tables here. But this process can fail sometimes if the WordPress SQL tables prefix is too long: the table name can’t contain more than 64 characters.
The following table describes the maximum length for each type of identifier in the database. Please note that the maximum length for table is 64:
Identifier
Maximum Length (characters)
Database
64
Table
64
Column
64
Index
64
Constraint
64
Stored Program
64
View
64
Alias
256
Compound Statement Label
16
The WordPress SQL Table prefix is defined during WordPress install, and is stored in the file called wp-config.php.
↑ Back to top
To solve this issue, there’s only one single solution: renaming the WordPress SQL table prefix.
You can do this using the Change Table Prefix plugin.
Or you can do it manually. In that case you need to rename all tables names using a tool like phpMyAdmin, reduce the table’s prefix, and update the prefix value in wp-config.php. When you’ve done this, deactivate WooCommerce and re-activate it. Don’t worry you won’t lose any data, and re-enabling WooCommerce should force it to create missing SQL tables.
Please create a backup of your database and of your site before doing such actions.
Note: we recommend you to define a WordPress SQL Table Prefix containing less than 20 characters to avoid any potential issue.