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!

Comments

dvdweide’s picture

StatusFileSize
new3.17 KB

Patch for store.module

dvdweide’s picture

StatusFileSize
new808 bytes

patch for cart.module

dvdweide’s picture

StatusFileSize
new1.59 KB

Here 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

dvdweide’s picture

Component: -- other -- » product
Assigned: Unassigned » dvdweide
gordon’s picture

Priority: Critical » Normal
Status: Needs review » Closed (won't fix)

This has been completely re-written in 4.7-3 (to be released soon) and HEAD.