Jump to content

Licensing Addon + Version Number


nightkingdoms

Recommended Posts

What I'm trying to do is put a version number as part of the returned variables during the license check. I tried following the logic enumerated here but can't exactly get it to work.

 

I have a product, put a custom field on it of "version" with the description value I need ("1.01") and I added the hook file into the includes/hooks/ directory.

 

It only partially worked. On my sample license checks I get as part of the var_dump:

 

  ["customfields"]=>
 string( "version="

 

I've tried to put it as both the description and the select options and I get nothing but the name. As a side note I also tried to do this after the product was already ordered and it didn't show on the var_dump until I ordered it again.

 

Any ideas?

Link to comment
Share on other sites

Hi,

 

Did you try to use "LicensingAddonVerify" hook point as Matt suggested on post http://forum.whmcs.com/showthread.php?51938-ability-to-add-custom-fields-to-the-license-verify-request&p=238674#post238674

 

Also, if you can please show us the code you are using on your hook so we can point out the issue you are having.

 

Thanks,

Sayed

Link to comment
Share on other sites

I was using the same code that you're referencing. I just couldn't find right away where you put the actual version number so it shows on the license pull.

 

Apparently this isn't something you can set as a field/value for that specific product like I was thinking, rather it's a custom field that shows up on each instance of the product that someone's ordered. Not quite what I was looking for. Because this is the case, this means that each individual ordered product record would need to have the version number added to it for what I want to do to work.

 

What I wanted to do was add a custom, non-visible value tied to the product itself that I could pull while the license check was going and determine the current version of the program vs what the customer has installed. If the product version number is higher than the installed version - and that customer has an upgrade addon on that order, to present in the program a download link for the newest version.

Link to comment
Share on other sites

After taking some time to do a little debugging, the hook isn't working. I used the same base code as the OP and installed it in the /includes/hooks/ directory. The file does indeed get run by the system. The function, however, does not. Because there's not really any way that I can think of to debug the actual add_hook function, I'm kind of at a loss of what to do. The code seems totally sound, if it ever would run.

 

I really don't care if I use the given get_query_val or run my own SQL to grab the needed information, I need the hook to run so I can do it. I've submitted a ticket, will update this page once I get a response and/or get it working.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated