Decimal into order

stefano

Avatar: stefano

2010-08-16 17:00

Hy, it's possible insert decimal number into order. I've see an aswer for QC 2.2
(http://opensolution.org/Quick.Cart/forum/?p=readTopic&nr=4935)
but not yet for last version!
Thanks!

» Quick.Cart v3.x

Thancks!

boboo

Avatar: boboo

2010-08-17 06:38

It is possible.
1. You have to replace:
(int) $iQuantity
- there are 2 entries - in function addToBasket in core/orders.php to: ereg_replace(',' , '.' , $iQuantity)
2. In product_default.tpl change:
<input type="hidden" name="iQuantity" value="1" />
to:
<input type="text" name="iQuantity" value="1" />
3. Remove alt="int" in the line:
<input type="text" name="aProducts[$aData[iProduct]]" value="$aData[iQuantity]" size="3" maxlength="4" class="input" id="quantity$aData[iProduct]" alt="int" />
in orders_basket.tpl

I did not test it. This solution is only what my logic tells me ;-)

http://skupienie.kimla.de/?software-quickcart,106

Makaron

Avatar: Makaron

2010-08-17 16:02

There already was solution for this problem on this forum but I can't find it right now..

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

stefano

Avatar: stefano

2010-08-18 14:42

no, sorry, method of boboo not ok!
Sorry even formy english!
Someone can help me?
Thanks!

boboo

Avatar: boboo

2010-08-19 11:10

OK, I went so far...
With a good editor (like notepad++) and good file manager, it took me about 15 minutes (only replacing the entries, not trying and searching for "integer-trojans" ;-)
1. Replace all iQuantity to fQuantity (in every file!!!) (the first letter 'i' indicates the integer and will be checked in FlatFiles)
2. Remove alt="int" in lines with Quantity in templates (.tpl)
3. Replace (int)$fQuantity to ereg_replace(',' , '.' , $iQuantity) in core/orders.php --> addToBasket function
4. And now the last "integer-trojan" ;-)
in the core/orders.php saveBasket function replace:
$aExp[2] = (int) $aForm['aProducts'][$aExp[1]]);

with:
$aExp[2] = ereg_replace(',','.',$aForm['aProducts'][$aExp[1]]);

I have just checked. It works correctly.

http://skupienie.kimla.de/?software-quickcart,106

boboo

Avatar: boboo

2010-08-19 11:12

upps.
line 3. should be:
3. Replace (int)$fQuantity to ereg_replace(',' , '.' , $fQuantity) in core/orders.php --> addToBasket function

http://skupienie.kimla.de/?software-quickcart,106

Back to top
about us | contact