VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: pixelofficer on August 29, 2013, 01:29:38 AM

Title: Decimal symbol - Shipment cost
Post by: pixelofficer on August 29, 2013, 01:29:38 AM
Is there some rule for entering decimals in VM administration? Should I use comma (common in EU) or dot (US style :) ? When I use the comma - everything works fine with product price... e.g. - in administration price is entered like 14,99 and displayed 14,99€

But when I enter 2,50 as shipment cost in shipment methods - in cart is displayed only 2,00€
When I enter 2.50 - user can see correct price 2,50€

Is it bug or not?

(using VM 2.0.22, Joomla 2.5.9)
Title: Re: Decimal symbol - Shipment cost
Post by: Maxim Pishnyak on August 29, 2013, 10:19:38 AM
Dot.

Did you saw individual currency settings in VM backend?
Title: Re: Decimal symbol - Shipment cost
Post by: pixelofficer on August 29, 2013, 18:49:21 PM
Yes I did...  And did you understand me?

There is nothing that can affect this behaviour and nothing that explains why is possible to use comma and in other forms are accepted only dots.

All currencies are disabled, only active currency is Euro and decimal separator is comma. (i think that it may be related only to displaying decimals, not for entering)

OR, am I missing something?
Title: Re: Decimal symbol - Shipment cost
Post by: Maxim Pishnyak on August 29, 2013, 22:57:17 PM
Quote from: pixelofficer on August 29, 2013, 18:49:21 PM
There is nothing that can affect this behaviour and nothing that explains why is possible to use comma and in other forms are accepted only dots.
Could you be more specific?
Title: Re: Decimal symbol - Shipment cost
Post by: pixelofficer on September 03, 2013, 11:14:46 AM
How can i be more specific? When I edit for example products - their price - it is ok to use comma as decimal separator and everything works
When I want to edit the shipment cost - I must use dot as decimal separator...

why?

as far as i know - decimal separator in currency settings affects only template / not the administration
Title: Re: Decimal symbol - Shipment cost
Post by: alatak on September 05, 2013, 08:53:22 AM
Hello

You have to do this in the file  plugins/vmshipment/weight_countries/weight_countries.php

replace the code
/**
* @param $method
*/
function convert (&$method) {

//$method->weight_start = (float) $method->weight_start;
//$method->weight_stop = (float) $method->weight_stop;
$method->orderamount_start = (float)$method->orderamount_start;
$method->orderamount_stop = (float)$method->orderamount_stop;
$method->zip_start = (int)$method->zip_start;
$method->zip_stop = (int)$method->zip_stop;
$method->nbproducts_start = (int)$method->nbproducts_start;
$method->nbproducts_stop = (int)$method->nbproducts_stop;
$method->free_shipment = (float)$method->free_shipment;
}

by the code
/**
* @param $method
*/
function convert (&$method) {

//$method->weight_start = (float) $method->weight_start;
//$method->weight_stop = (float) $method->weight_stop;
$method->orderamount_start =  (float)str_replace(',','.',$method->orderamount_start);
$method->orderamount_stop =   (float)str_replace(',','.',$method->orderamount_stop);
$method->zip_start = (int)$method->zip_start;
$method->zip_stop = (int)$method->zip_stop;
$method->nbproducts_start = (int)$method->nbproducts_start;
$method->nbproducts_stop = (int)$method->nbproducts_stop;
$method->free_shipment = (float)str_replace(',','.',$method->free_shipment);
}