I am working on a website built in WordPress to sell license keys with Woocommerce. I found a plugin that allows managing license keys easily and fully integrated with Woocommerce named “License Manager for WooCommerce”.
This plugin is just perfect, allowed me to manage the customers license keys, generate and display the license keys in the order page.
However, the main problem I encountered was with the License Keys Section in Woocommerce My Account page. No license is displayed in the list after assignation to an order.
After hours of searching in the plugin’s code, if found that the function selecting the licenses from database to display in page “License Keys” was filtering postmeta data by key lmfwc_order_complete.
The key lmfwc_order_complete is inserted on database only when the license is generated automatically by the License Generator.
This was not my case as I’m using an offline software to generate the license keys and importing them or manually fulfilling the form to add new key.
When manually entering a key by fulfilling the form or importing from files/clipboard the meta key lmfwc_order_complete was not inserted in database.
In order to make it happen, and display the license keys in correctly, I had to edit the plugin code manually and do a call to function update_post_meta($orderId, 'lmfwc_order_complete', 1) to set the order as complete from the function insertImportedLicenseKeys just before return statement in the class Controller.
Path to file: /public_html/wp-content/plugins/license-manager-for-woocommerce/includes/integrations/woocommerce/Controller.php