I recently started using the plugin "WooCommerce PDF Invoices, Packing Slips, Delivery Notes & Shipping Labels (Pro)", since it appears to be the only WPML-compatible PDF invoicer for WooCommerce according to the WPML site.
However when we click the button to generate the invoice from the front end, we get the following error:
Fatal error: Uncaught Error: Class 'Toolset_WPML_Compatibility' not found in .../wp-content/plugins/types-access/application/controllers/custom_errors.php:297 Stack trace: #0 .../wp-content/plugins/types-access/application/models/wpml_settings.php(489): OTGS\Toolset\Access\Controllers\CustomErrors->get_custom_error(0) #1 .../wp-includes/class-wp-hook.php(292): OTGS\Toolset\Access\Models\WPMLSettings->check_language_edit_permissions(Array, Array) #2 .../wp-includes/plugin.php(212): WP_Hook->apply_filters(Array, Array) #3 .../wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php(2912): apply_filters('wpml_active_lan...', Array, Array) #4 .../wp-content/plugins/sitepress-multilingual-cms/inc/template-functions.php(94): SitePress->get_ls_languages(Array) #5 .../wp-content/themes/Avada/includes/lib/inc/class-fusion-multilingual.php(280) in .../wp-content/plugins/types-access/application/controllers/custom_errors.php on line 297
From the error message I would assume it is some kind of error with Toolset Access, but it may also be a WPML issue.
The issue can be reproduced as follows (please request a private reply if necessary for a test login):
1) Sign in as user
2) Click the shopping trolley icon in menu to access WooCommerce Account page
3) Click Subscriptions and click any Subscription number to drill to order details. Here the "Print Invoice" button causes the error described.
4) Additionally, if you drill down on the Order number, both "Print Invoice" and "Download Invoice" buttons cause the described error.
It seems as if Toolset Access is blocking the generation of the PDF.
However, in WP back end, I can generate the invoice successfully, by choosing WP Admin > Invoice/Packing > Invoice > Customise > Preview sample PDF link top right, so the PDF invoicing plugin appears to be able to generate invoices successfully, just not from the front end. I couldn't find anywhere in Toolset Access settings to allow/disallow any functionalities from 3rd party plugins.
I've setup a sandbox site below for us to go through the issue to see if we can replicate on a fresh install to eventually submit to our 2nd tier team for further checks.
Click the link below. hidden link
This will allow you to setup the basics for us to replicate on a clean site.
Please let me know if you're able to replicate the issue on this sandbox site.
When I use that link I'm getting the attached screenshot.
You're welcome to use the Duplicator Pro plugin on our site (it's still a dev site) to make a copy of our site and work on it locally if you want. Probably easier for both of us. Please be sure to deactivate the plugin WordFence on the duplicate site, otherwise we get hammered with emails.
The user you use to test must be of role "Subscribed Family" otherwise you will not be able to see the relevant pages as I detailed in the steps to reproduce. You can use the following test login on our site if you prefer to test directly. You have FTP access already so you can pick up any debug.logs you need: (Please delete this info from the post when you have read it! ).
Our 2nd tier team had a look at this and was able to get it working. Mainly we found the issue only occurs when the Avada theme is active.
There isn't much we can do here because we are unable to replicate the issue even when we placed the avada theme on our sandbox site that you can check out below. hidden link
Here is the my account page below. hidden link
The problem seems to be specific to your setting up of the settings in the theme since a fresh copy doesn't produce the same result.
Also I see that your theme is outdated so I would recommend updating to the latest version of the Avada theme as well.
We updated our theme to the latest 7.4 and have applied all the patches. We have run into to a bug with the WC Add to Cart functionality which means that we cannot add anything to our basket at the moment. So I cannot yet verify if this is working in Avada 7.4.
I will get back to you once the issue is resolved.
This is not an issue between Toolset Access and WPML. Its more on the case of your specific install. As i've noticed that even when i've enabled the Avada theme on our test site it will still produce an invoice.
Were you able to resolve the issue regarding the Avada 7.4 ?
I will try to assist as best as possible but it can be difficult since its not replicable on a fresh install.
After getting some feedback from the plugin author, he asked us to deactivate WPML and try it. It worked fine with WPML deactivated, so indeed WPML seems to be the culprit.
I'll keep you posted, but maybe you or your WPML colleagues may be able to shed some light on what the issue could be.