When using european price notation (comma for decimal separator, dot for thousand separator) the price of a product is multiplied by 100 after editing it.
This is caused by the unformatted value of price, which consequently is wrongly interpreted by the valid_product_price() function.

This patch solves the problem by formatting the price according to the shop number format settings.

Cheers, Danny

Comments

dvdweide’s picture

Component: product.module » product
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new2.63 KB

I've found two other places where price formatting doesn't take place as it should:

- function product_overview
- function product_shortlist

New patch is attached.
This patch works fine, so i've taken the bold decision to promote the status to 'path ready to be committed'.
The problem also exists in cvs.

Cheers, Danny

dvdweide’s picture

Version: 4.7.x-1.x-dev » master

Ah.. too quick!!
Forgot to move the version to CVS

sun’s picture

Priority: Normal » Critical

Patch works like a breeze.

dvdweide’s picture

StatusFileSize
new2.27 KB

Unfortunately another modification has also enterd into thiis patch.
It's an extension to the function "product_unit_nice_name" to enter cycles in hours and minutes to recurring payments.
Since it has nothing to do with this bug, i'v removed it from this new patch.

Excuses for this mistake!
Danny

sun’s picture

Why are there changes to billing cycle?

@@ -540,7 +540,7 @@
 
     $interval = drupal_map_assoc(range(0, 31));
     $interval[0] = '--';
-    $unit = array(0 => t('-please choose-'), 'D' => t('Day(s)'), 'W' => t('Week(s)'), 'M' => t('Month(s)'), 'Y' => t('Year(s)'));
+    $unit = array(0 => t('-please choose-'), '-M' => t('Minute(s)'), '-H' => t('Hour(s)'), 'D' => t('Day(s)'), 'W' => t('Week(s)'), 'M' => t('Month(s)'), 'Y' => t('Year(s)'));
     $form['billing_cycle']['price_interval'] = array(
       '#type' => 'select',
       '#title' => t('Interval'),
dvdweide’s picture

StatusFileSize
new1.75 KB

Ooops!
That's the other modification that i really had to remove. It's related to the other one, ofcourse.
It's there only for testing purposes to make subscriptions expire faster.
It has been removed now.

Sorry again!
..Maybe i should have stayed in bed a little longer...

Danny

sun’s picture

Patch applies and works fine.

mo6’s picture

Just ran into the same problem(s). Nice work, Danny.

Now let's hope someone will commit these patches asap (in 4.7 as well please).

sun’s picture

*bump*

Still not committed! Still applies!

sime’s picture

Assigned: Unassigned » sime

assigning to myself

sime’s picture

Status: Reviewed & tested by the community » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)