dimitrislalas
Forum Replies Created
-
Forum: Plugins
In reply to: [License Manager for WooCommerce] Decrypted License keyThats perfect! It worked! Thank you very much. I search everythhing about what i should do with the add_action call but i couldnt find the right one.
Forum: Plugins
In reply to: [License Manager for WooCommerce] Decrypted License keyI am trying to implemend this code to the functions.php file. And at the output i get the license key encrypted
Forum: Plugins
In reply to: [License Manager for WooCommerce] Decrypted License keyadd_action(‘after_setup_theme’,’doit’)
function doit(){
$uid = get_current_user_id();/** @var LicenseResourceModel[] $licenses */
$licenses = LicenseResourceRepository::instance()->findAllBy(array(‘created_by’ => $uid));$response = array();
$check= array();
foreach ($licenses as $license) {
//$licenseData = $license->toArray();
// Remove the hash, decrypt the license key, and add it to the response
// unset($licenseData[‘hash’]);
// $licenseData[‘licenseKey’] = $license->getDecryptedLicenseKey();
$check[0]=”;
$check[]= $license-> getCompanyName();
//apply_filters(‘lmfwc_decrypt’,$key);
//$response[] = $licenseData[‘licenseKey’];
$response[] = $license->getDecryptedLicenseKey();
}if($check[1]!=null){
wpas_add_custom_field( ‘cp_name’,
array(
‘title’ => __( ‘Select your Company Name’, ‘wpas’ ),
‘field_type’ => ‘select’,
‘log’ => true,
‘show_column’ => true,
‘show_frontend_detail’ => true,
‘sortable_column’ => true,
‘required’ => true,
‘options’ => $response )
);}else{
wpas_add_custom_field( ‘cpname’,
array(
‘title’ => __( ‘Select your Company Name’, ‘wpas’ ),
‘field_type’ => ‘select’,
‘show_column’ => true,
‘show_frontend_detail’ => true,
‘sortable_column’ => true,
‘required’ => true,
‘options’ => array(
”=> ‘You dont have any products attached to a company name!’)
) );}
}}- This reply was modified 4 years, 7 months ago by dimitrislalas.