using decimals in order amounts

yalides

No avatar

2007-08-19 19:43

Hello,

I am setting up a quickart store for selling fabrics. I want buyers to be able to enter values like 1,5 M or 0,75M, but quickart only lets them enter integer values. How can I change that to decimal values? I am using quickart version 1.4

» Quick.Cart v1.x

merci

No avatar

2007-08-20 13:25

yalides - yes, it is possible, but you will have always amount displays as float, it means that if somebody would like to order 1 m, it will be displays as 1.00 m.
1. Open file core/orders-ff.php and replace this code:

$aFile[$i] = $aExp[0].'$'.$aExp[1].'$'.$aExp[2].'$'.sprintf'%01.0f'$aElements[$aExp[0]] ).'$'.$aExp[4].'$'.$aExp[5].'$'."\n";


to this:

$aFile[$i] = $aExp[0].'$'.$aExp[1].'$'.$aExp[2].'$'.sprintf'%01.2f'$aElements[$aExp[0]] ).'$'.$aExp[4].'$'.$aExp[5].'$'."\n";


2. Open file actions_client/orders.php and replace this code:

if( isset( $iProduct ) && is_numeric$iProduct ) && isset( $iQuantity ) && is_numeric$iQuantity ) && $iQuantity >= && $iQuantity 1000 ){


to this:

if( isset( $iProduct ) && is_numeric$iProduct ) && isset( $iQuantity ) && is_numeric$iQuantity ) && $iQuantity && $iQuantity 1000 ){

yalides

No avatar

2007-08-20 13:48

Thank you very much for your answer :-)

Greetings Yalides

yalides

No avatar

2007-08-28 21:03

I have tried this solution but it doesn't work :-(
Does anyone know an other way to make this work?

Greetings Yalides

merci

No avatar

2007-08-29 08:53

yalides - well, you have to make one more modyfication. In file core/orders-ff.php find line:

if( isset( $aElements[$aExp[0]] ) && $aElements[$aExp[0]] >= )

and replace it to this:

if( isset( $aElements[$aExp[0]] ) && $aElements[$aExp[0]] > )


Now it should works, but you have to enter emount as for example 1.5 (not 1,5).

yalides

No avatar

2007-08-29 10:32

It still doesn't work. If I want to enter 1.5 it says I have to fill in a legal value.

Greetings Yalides

merci

No avatar

2007-08-29 14:58

yalides - strange, because I have tested it and it works without problems.

yalides

No avatar

2007-08-29 16:49

And was this also version 1.4 ???
If it is, I wil download a new version of 1.4 and try it again.

Greetings Yalides

yalides

No avatar

2007-08-29 17:08

I have tried it in a clean install of version 1.4 again and I get this :-(

[img]http://testsite.yalidesigns.nl/foutmelding.jpg[/img]

Greetings Yalides

yalides

No avatar

2007-08-29 17:10

You can find the image here

http://testsite.yalidesigns.nl/foutmelding.jpg

and the test-store is here

http://testsite.yalidesigns.nl

Greetings Yalides

merci

No avatar

2007-08-30 09:04

yalides - well, you are right, I have checked it only in basekt page, and you have to make one more modyfication in product's descriptiion page. Open file templates/products_more.tpl and somewhere in 16 line you should have:

Array( 'iQuantity''int''0'null'>' )

delete from that line: 'int', so it will look like:

Array( 'iQuantity''0'null'>' )

Does it work now?

yalides

No avatar

2007-08-30 20:54

Yes it works :-)
You have made me very happy now I can build my webshop the way I want.

Greetings Yalides

yalides

No avatar

2007-08-30 21:13

Is it also possible to have 4 or 5 numbers at the quantity so they can also ask for 10.5 or 1.25 mtr ???

And I want to donate some but I don't have a creditcard so I can use paypall can I also donate otherwise??? Because I am so happy with all the help I get here.

Greetings Yalides

merci

No avatar

2007-08-31 08:47

yalides - open file templates/orders_basket.tpl and find line:

<fieldset><input type="text" name="aElements[$aList[iElement]]" value="$aList[iQuantity]" maxlength="3" size="2" /></fieldset>

and replace it with:

<fieldset><input type="text" name="aElements[$aList[iElement]]" value="$aList[iQuantity]" maxlength="4" size="3" /></fieldset>

then open file templates/products_more.tpl and change line:

<input type="text"   name="iQuantity" value="1" maxlength="3" size="2" /><br />

to this:

<input type="text"   name="iQuantity" value="1" maxlength="4" size="3" /><br />


You can make donation by paypall also. We will be glad for your financial support.

yalides

No avatar

2007-09-02 08:39

Thank you very much :-)
When my store is online I will my a donation for all your hard work.

Greetings Yalides

Back to top
about us | contact