One of my clients requested a feature which I added to the UC Roles module. The client wanted have relative expiration dates conform to their publication cycle. They publish a set of monthly reports on a given day of that month, e.g. on the 15th, so they want roles to expire on that day. For example, if it is 2009/10/09, and a customer purchases a role for a year, the expiration date would need to be 2010/10/15. Customers that purchase after the given day of the month essentially get an extra month, e.g. if it is 2009/10/31, then the role should expire on 2010/11/15.
I have attached a patch that proposes how this might be done. What do you think?
Comment | File | Size | Author |
---|---|---|---|
adjust-expiration-uc-roles.patch | 3.12 KB | thisgeek | |
Comments
Comment #1
hefox CreditAttribution: hefox commentedIt looks like I need this patch also (to the first of the month :>), so subscribing and will test when I get a development box up for that site.
Comment #2
hefox CreditAttribution: hefox commentedHaven't tested it yet, but the variable_set instead of using a field in the uc_roles_products table; that looks like the appropriate place for it.
Comment #3
hefox CreditAttribution: hefox commentedNvm about above, didn't find that setting page until later.
Doesn't work for when the role expiration date has been overriden (say default 1 year, product overrides to 2 years). Moved the code up before the if else and works fine. (in _uc_roles_product_get_expiration). (Svn is a bit messy for making patch, so too lazy to repatch).
Comment #4
TR CreditAttribution: TR commentedNew features should go into 7.x-3.x first.
Comment #5
TR CreditAttribution: TR commentedMarked #1188384: Allow role assignment to use end of the month as a duplicate.
Comment #6
TR CreditAttribution: TR commented