Download & Extend

Aaaa... So I just rewrote uc_license_keys a week or so ago...

Project:Ubercart Product Keys
Version:6.x-1.x-dev
Component:Code
Category:task
Priority:normal
Assigned:freixas
Status:closed (won't fix)

Issue Summary

So I pretty much rewrote uc_license_keys for an internal site just the other day. I didn't really care much for the 6.x port that was posted on the comments page. I'm glad I was pointed to this recently released module as I was about to create a new project myself. ;-)

uc_license_keys has an odd schema imo hooking into order_id and model (sku) though you're probably already familiar with it. Using the model runs into a few issues like trying to use the same license key on a different sku purchase although that's solved via a sub-module to shift things over at sku change (out of scope of uc_license_keys).

Some other random thoughts:

  • I decided to rewrite and use views to generate admin and key pages. Though as mentioned, the sku/model schema made it kind of weird
  • the api I added let other developers return a custom form rather than keys... not sure which is better
  • mmmm... conditional actions...
  • is the robust schema necessary in all use cases or should you leave that to sub-modules and customization? Some fields are redundant like uid, which is already associated via the order_id. Pkid seems redundant. The unique number is the serial/product key, right? You don't want the same product key sold that would unlock multiple products? Or maybe that's an option with product sequerences..?
  • Activations? Great idea.
  • Upgrade paths for older modules like uc_license_keys...
  • uc_license_keys assumes that keys associate with a sku version of a product node. So any of the keys would work with that sku. Is the idea behind activations and product sequences so you can manage product/license keys and track usage all on the same web site?

Interested in maybe collaborating a bit.

Comments

#1

A new module appears, licensing.

I'm going to create a post on groups.drupal.org Similar Module Review (formerly hall of shame) for collaboration.

#2

Sorry, but I never received your posting. I have no idea why. I have another module, uc_addresses, and I seem to get all the messages posted there. I also checked all my email (I don't delete much) and couldn't find your postings.

Regarding your random thoughts:

  • Using views sounds like a good idea. I thought about it, but just don't have a great deal of experience with integrating with views. Interested in collaborating on adding views support?
  • I'd need to know more.
  • The schema so non-programmers can have a working system, Sub-modules could solve the problem, but none exist (yet). It might be possible to refactor the code later to separate functionality. uid is included in the order, but sometimes you'd rather avoid the extra join or database fetch. I think I might have started out without it and then added it to avoid some database operations. Finally, I'm embarrassed to tell you how long my product keys are. My theory is that the database index is going to be a lot smaller if it is based on an integer than the a lengthy product key—and it may operate faster. This is also the reason that I avoided creating a unique index for product keys—it could affect performance. I am not a database guru, though, so I might be wrong.
  • Thanks.
  • I'm not a uc_license_keys user, but if anyone would like to provide the code for an upgrade path, they would be welcome,
  • First, uc_product_keys associates a key with a product in the same way that uc_license_keys associates a key with an SKU. Any of the keys work with the given product. Why not use the SKU? I wanted to allow two products to use keys from the same pool (for example, several betas might use the same beta product key). There are two ways to do this: In the product sequences, I could create a bunch of fields to create associations to products or in each product I could provide an association with one sequence. I prefered the latter. Because products may have variant SKUs in a variety of places, it was simpler to associate the product with a sequence than an SKU with a sequence. Product sequences provide a place to store certain characteristics of a sequence, such as whether it is dynamically generated or imported.

Regarding the multiplicity of Drupal modules dealing with licensing: uc_license_keys is not an official Drupal module, so when I created uc_product_keys, there was no duplication.

It may be possible to rework the code to use the Licensing module. I don't know much about it yet and the author has never contacted me (as far as I know—the email system may be flaky). The description seems to claim it does not duplicate uc_product_keys.

Sorry for the later reply and thanks for your input.

#3

i am getting error in my products page :

warning: Invalid argument supplied for foreach() in /home/website/public_html/sites/all/modules/uc_product_keys/uc_product_keys.module on line 760.

Also, where do I configure uc_product_keys? i can't find it anywhere in drupal.

#4

ok, i found the menu to find in readme.txt.

Also, the error seems to be gone once I configured a product key.

I want to use the hook (dynamic gen key) method. But I have no idea where to start in creating my own script. Can you please help?

Would it be possible to do something like this :
1) customer buy product
2) select the item (let say this is new license)
3) then register account and make payment
4) payment approved by payment gateway
-- how does uc_product_keys handle this if payment failed?
5) hook_uc_product_keys_generate_keys() will execute which will actually call an external php script
6) the script will retrieve the key dynamically from license distributor's website
7) the script will return results back to hook_uc_product_keys_generate_keys()
8) the script will also send out email to user and administrator (with complete details of customer's purchases)
-- does uc_product_keys handle this?

Please email replies to my email account if possible. abubin at gmail.com

Thanks.

#5

I'm also very interested in doing the exact same thing here as abubin. Please help!
thanks a lot for your work on this, its great

will at blasthaus.com

#6

Assigned to:Anonymous» freixas

Sorry for the late response. I am still not getting any notifications when bugs are posted.

1) Please don't attach bug reports to existing, unrelated issues.

2) Did you see the release notes? "A sample extension module is included that should help you extend the module."

3) Product keys are generated only when the order successfully completes (using Ubercart's hook for order completion). There are a bazillion payment systems; you will need to verify that, for your payment system, the Ubercart order completion hook is only called if the payment is made.

4) The sample extension module demonstrates how to do everything you asked for. It's all possible. If you need hand-holding, however, I would be happy to help at my usual rate. :-)

#7

Title:Aaaa... So I just rewrote uc_license_keys a week or so ago...» rate?

i"m not advanced enough yet with hooks to feel confident I could do it the best way and kind of anxious to get this part done. Please contact me will at blasthaus dotcom and if anything is useful we could include another sample extension for the module. thanks! -wil

#8

Title:rate?» Aaaa... So I just rewrote uc_license_keys a week or so ago...

Changing the title back to what this issue originally was for.

It makes it hard to keep track of things if issues get hijacked.

As freixas mentioned before you should create a new issue if you
have an issue that is different to the original post.

Then that will also help other people that have your problem to find
an issue with a possible solution.

#9

Status:active» closed (won't fix)

Closed due to no activity in over 2 weeks.

nobody click here