I suggest you contribute to the documentation pages on ubercart.org by adding that hook to the list of hooks and by starting a page documenting what it does. Any authenticated user has the ability to edit the documentation.
I don't know what it does, hence the need for documentation. It really is more productive if someone who wrote the code writes at least the basics of the code docs, as they know what the code does and don't have to spend time unpicking it. Hence we collectively gain Drupal development time.
The text from http://www.ubercart.org/comment/49527 that @chishah92 mentioned can be found on wayback.com, as ubercart.org is not maintained. I've reproduced it below with only minor changes.
Define a product 'feature' and callbacks supporting the feature.
(opinion)
Where Ubercart supports 'classes' for different types of products, 'attributes' for variations in products, and 'options' for the specific values within an attribute... a 'product feature' is an algorithmically generated aspect of a product - sort of like an 'attribute', but requiring custom logic to support. For example, downloadable files, membership subscriptions, and recurring charges are all examples of a 'product feature'. They need to be 'features', rather than 'attributes', because the purchase of these products cause changes to the account status of the purchaser. When a downloadable file is purchased, the purchaser is granted the role of an individual with access to download the file they've purchased. Likewise, when a membership product is purchased, the purchaser is granted the role of 'site member'. Further, these 'features' can support additional logic that maintains the status of the granted roles - such as a recurring fee associated with the membership product.
I have no idea if this description is correct, but that's what it seems to be after several days of research online and in the Ubercart code. Please correct me if any of this is incorrect.
(end opinion)
Note that if your site does not activate any modules that implement product features (via implementing hook_uc_product_feature()), your product's editing nodes will not contain any 'product features' tab.
where the hook is expected to return an associative array with the following keys:
'id' - a unique identifier used to identify the feature being implemented
'title' - a string displayed to users as the name of this feature
'callback' - a function implementing a form for specifying and modifying the feature for specific products, the form as generated is passed to uc_product_feature_form() and the return value from that is the return value of this callback
'delete' - a function implementing any logic to delete this feature from the environment
'settings' - a function implementing a form for creating instances of this feature; function returns form array
The parameter signatures of the callback and settings forms appear non-standard, and are what I'm currently researching.
I suggest looking at the source of uc_file.module, uc_roles.module, uc_recurring.module and uc_userpoints_product.module for example logic.
Comments
Comment #1
tr commentedI suggest you contribute to the documentation pages on ubercart.org by adding that hook to the list of hooks and by starting a page documenting what it does. Any authenticated user has the ability to edit the documentation.
Comment #2
joachim commentedI don't know what it does, hence the need for documentation. It really is more productive if someone who wrote the code writes at least the basics of the code docs, as they know what the code does and don't have to spend time unpicking it. Hence we collectively gain Drupal development time.
Comment #3
tr commentedI didn't write the code either, and I can't do all the work myself, that's why I asked you to pitch in and try to help.
Comment #4
tr commentedLet's get this in 7.x-3.x first, then we can backport it.
Comment #5
tr commentedTagging.
Comment #6
chishah92 commentedFYI , Documentation for this hook exists on Ubercart website
URL : http://www.ubercart.org/comment/49527
Comment #7
tr commentedThe text from http://www.ubercart.org/comment/49527 that @chishah92 mentioned can be found on wayback.com, as ubercart.org is not maintained. I've reproduced it below with only minor changes.
The original text was provided by https://www.drupal.org/u/bsenftner