Change format price in Quick.Cart 4.0 error

dheghel

Avatar: dheghel

2011-02-28 12:28

I follow the instructure at http://opensolution.org/Quick.Cart/docs/?id=tips..
1. In file “core/common.php” in function displayPrice( ) change line:

return $mPrice;

to:

return number_format( $mPrice, 2, '.', ',' );

2. In file “core/common.js” in function changePriceFormat( ) should be set separator for thousands (separator for decimals won’t be changed in that case), so default config lines in that function:

var sDecimalSeparator = '.';
var sThousandSeparator = '';

should be changed to:

var sDecimalSeparator = '.';
var sThousandSeparator = ',';

But i got the error like this [IMG]http://i55.tinypic.com/jj41s5.jpg[/IMG]

What i must change again sir? Thx

» Quick.Cart v4.x

Makaron

Avatar: Makaron

2011-02-28 14:33

What value You set for this product in admin panel?

Mak-Web.pl - Modyfikacje skryptów Q.Cart i Q.Cms

boboo

Avatar: boboo

2011-02-28 15:20

dheghel,
where is the error?
On the picture you have got exactly, what you have done.

http://it-service.kimla.de

dheghel

Avatar: dheghel

2011-02-28 15:38

i put 1000 for that product in admin panel, The problem as my picture give is, word "Price" and curency symbol is missing...

Normally : Price: 1,000.00 EUR

That will happen after i did this :

Change :
return $mPrice;

To:
return number_format( $mPrice, 2, '.', ',' );

dheghel

Avatar: dheghel

2011-02-28 16:24

I did trial and error

* In file “core/common.php” in function displayPrice( ) change line:

Change :
return $mPrice;
To:
return number_format( $mPrice, 0, ',', '.' );


* In file “core/common.js”

Change:
var sDecimalSeparator = '.';
var sThousandSeparator = '';
To:
var sDecimalSeparator = '.';
var sThousandSeparator = ',';

work normally for value set xxx.xxx (hundred thousand) in admin panel [IMG]http://i55.tinypic.com/29wsdc7.jpg[/IMG]

Error with value set x.xxx.xxx (million) in admin panel [IMG]http://i55.tinypic.com/29mqema.jpg[/IMG] "Price" and curency symbol is gone

dheghel

Avatar: dheghel

2011-03-01 03:47

and "Add to basket" is gone too....

boboo

Avatar: boboo

2011-03-01 08:00

dhegel,
how do you put the prices in admin panel???
Like this: 1000000.00 (one milion zero cent)
or like this: 1,000,000.00
???

http://it-service.kimla.de QC- & QCMS-plugins

dheghel

Avatar: dheghel

2011-03-01 08:24

i put this 1000000 ( one million ).....and after i pressed save...will show 1000000.00 on admin panel too

cgan

Avatar: cgan

2011-03-01 19:23

dheghel - exactly the same happend to my Quick.Cart 4.0 when I changed the the way you did. The "Add to basket" and the "Currency" disappeared. But I didn't change the price they disappeared anyway.

cgan

dheghel

Avatar: dheghel

2011-03-03 05:39

@bobo, @makaron
is the width of column too small sir? so "add to basket" and curency symbol disappeared

dheghel

Avatar: dheghel

2011-03-05 04:35

Still can't fix this problem......does anybody can help me?

boboo

Avatar: boboo

2011-03-05 07:08

dhegel,
please give me the ftp access to Your installation.
Today afternoon I can look into.
http://it-service.kimla.de/?kontakt,2

http://it-service.kimla.de QC- & QCMS-plugins

dheghel

Avatar: dheghel

2011-03-07 05:52

@bobo
i can't upload because that error doesn't fix....i only instaal on localhost....
Can u try this metode in ur pc with localhost, try to change with this metode :

* In file core/common; in function displayPrice( ) change line:

Change :
return $mPrice;
To:
return number_format( $mPrice, 0, ',', '.' );


* In file “core/common.js”

Change:
var sDecimalSeparator = '.';
var sThousandSeparator = '';
To:
var sDecimalSeparator = '.';
var sThousandSeparator = ',';

Then u got the error too or just me......my country use big nominal until a million.
Thx boboo 4 ur help

boboo

Avatar: boboo

2011-03-07 08:25

It seems, that I have to write a bug report.
There is a small trap in the code, when you change the price number format.

Dheghel,
You have to change in the code:
This is the solution for prices having no cents, like Your example
1. in core/common.php change the
return $mPrice;
to:
return number_format( $mPrice, 0, ',', '.' );
(zero means: no cents will be shown)
2. And now we repair a bug:
in action_clients/products.php find the line:
if( is_numeric( $aData['mPrice'] ) ){
and replace it exactly! with:
if(is_numeric(preg_replace('/[\.,]/','',$aData['mPrice']))){

The bug here was: the price formated with thousand-dots (1.000.000) is no more numeric for the interpreter. It became string.

3. in core/common.js
The way you took will give out in order form a not nice result.
You display all prices by products in 1.000.000 format, and in order form the delivery and ALL-summary will come with: 1,000,000.00 format.
It is not nice.
So: change the lines
var sDecimalSeparator = '.';
var sThousandSeparator = '';
to:
var sDecimalSeparator = ',';
var sThousandSeparator = '.';

But You don't want the cents in order form (at delivery & all-summry)?
Then a few lines under these lines, You will find:
sPrice = sPriceFull+''+sDecimalSeparator+''+aPrice[1];
just change it to:
sPrice = sPriceFull;
(this will cut the "," as separator and cents after it).

http://it-service.kimla.de QC- & QCMS-plugins

dheghel

Avatar: dheghel

2011-03-12 02:49

Thank...Mr Boboo ur the best

God bless you...

Back to top
about us | contact