Hi,
The edd_software_licensing filed type is one of the custom field types included in the field type pack and it allows you to let your users activate/deactivate Easy Digital Download software licenses managed with the Software Licensing extension.
A scenario:
1. Somebody purchases your program at your site (license server) with EDD + Software Licensing installed.
2. The site generates a license key and the customer receives a download link and a license key.
3. The customer types the license key in your program and the program checks whether the license key is valid and activates the license if necessary.
4. The program performs automatic updates if the set license is verified.
The field type will do the job of Step 3. It creates a form field that lets the user set a license key in the form input that the field type generates. And if the user presses the submit button, it sends a request to the license server in the background and activate/deactivate the license.
Setting up the field should be strait forward. You need to prepare 1. Product Name and 2. The store (license server) url. Then set them with the product_name and store_uri arguments in the field definition array.
Hope this clears it up a bit.
Sweet. Got basic functionality working. Related question: can APF handle multiple licenses on one page, as in:
$options[$license_count] = array(
'field_id' => 'dgxdonate_tye_license_key',
'type' => 'edd_software_licensing',
'store_uri' => $store_url,
'product_name' => $product_name1,
'title' => $product_name1,
),
$options[$license_count] = array(
'field_id' => 'dgxdonate_rlf_license_key',
'type' => 'edd_software_licensing',
'store_uri' => $store_url,
'product_name' => $product_name2,
'title' => $product_name2,
),
It is supposed to be possible but I found a bug preventing it.
Can you modify the filed type code for the time being until an update gets released?
1. Find the the following block in the replyToCheckLicense() method.
// Initial checks.
if ( ! is_array( $asInput ) ) {
return $asInput;
}
if ( ! isset( $asInput['input_id'], $aSubmitInfo['input_id'] ) ) {
return $asInput;
}
if ( $asInput['input_id'] !== $aSubmitInfo['input_id'] ) {
return $asInput;
}
2. Replace it with the following code.
// Initial checks.
if ( ! isset( $asInput[ 'submit' ], $asInput[ 'input_id' ] ) ) {
return $asInput;
}
if ( ! $asInput[ 'submit' ] ) {
return $asInput;
}
Sorry for the inconvenience.
Thanks! No problem. This will work for now.
Speaking of, when you update the Field Type Pack, will that just show up as an automatic update, or will I need to go somewhere and download the new version?
It will show up as an automatic update on your site that activates the Field Type Pack license.
Closing the topic due to inactivity.