This happens because for all calculations of expiration/renewal datetimes the function "product_unit_nice_name()" is used to generate interval strings for "strtotime()".
The product_unit_nice_name() function localizes the unit name strings from e.g. "day" to "giorno" (in case of italian), and strtotime() is not going to understand this, ofcourse!
I'd like to propose the following solution:
- Create a new function "product_unit_interval" which produces a correct interval string from it's parameters $unit and $interval, including the interval.
- Update all strtotime() use to use this new function and remove the adding of $interval there since it will already be added by "product_unit_interval".
These modification involve modules: product.module, store.module.
I also changed an commented out line in cart.module, just to be complete!
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | product.module_8.patch | 1.59 KB | dvdweide |
| #2 | cart.module_2.patch | 808 bytes | dvdweide |
| #1 | store.module_2.patch | 3.17 KB | dvdweide |
| product.module_4.patch | 1.64 KB | dvdweide |
Comments
Comment #1
dvdweide commentedPatch for store.module
Comment #2
dvdweide commentedpatch for cart.module
Comment #3
dvdweide commentedHere is an update of the patch for the product module.
This one actually really works!
The previous version rather a quick solution and clearly not tried at all.
Cheers,
Danny
Comment #4
dvdweide commentedComment #5
gordon commentedThis has been completely re-written in 4.7-3 (to be released soon) and HEAD.