Closed MechComp closed 4 years ago
Version 5.3.3 - Item reference
how about manually typing item reference... we bind this to wp categories
user A select the category as reference instead.
I have started to use the solution in there already. And it's working fine.
I think that manually typing reference on product page is not so big problem. There is a checkbox in the settings to use this.
I found that using categories also brings sometimes unwanted result - category archive
The only thing which is bad in my approach is when you want to start selling multiple items and you have some already - without the item reference. Then you need to update the table for the existing records with reference for of the already used software. I did it in sql editor, but it should be possible to do that somewhere in settings.
â£Sent from BlueMail â
On Apr 27, 2020, 22:16, at 22:16, Michel notifications@github.com wrote:
how about manually typing item reference... we bind this to wp categories
user A select the category as reference instead.
-- You are receiving this because you modified the open/close state. Reply to this email directly or view it on GitHub: https://github.com/michelve/software-license-manager/pull/21#issuecomment-620210051
here is a work around i have done, when reference is not set or empty, it will be set to default.
if (version_compare($used_db_version, '4.1.3', '<=')) {
// get empty values
$item_result = $wpdb->get_results("SELECT id FROM `$lic_key_table` WHERE `item_reference` LIKE '' ORDER BY id");
foreach ($item_result as $reference_item) {
$item_id = $reference_item->id;
// update and set default value
$update_reference = "UPDATE $lic_key_table SET item_reference='default' WHERE id='".$item_id."';";
dbDelta($update_reference);
}
}
i have updated the repo with your changes - will close this pull request for now.
New feature to allow selling multiple items licences - now it can compare Item reference of the plug-in versus Item reference of licenced product