Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / General Questions / Is this a bug in v1.50? orders_total doesn't output "text" but "value"

Is this a bug in v1.50? orders_total doesn't output "text" but "value"

Started by inception on 4 Sep 2012, 6:25 AM · Views: 5,498

Results 1 to 11 of 11
4 Sep 2012, 6:25 AM
#1
inception avatar

inception

New Zenner

Join Date:
Jun 2011
Posts:
63
Plugin Contributions:
0

Post #1 by inception

i use zen cart 1.39 for some sites, they work well
but for the sites which use zen cart 1.50, i find an issue

in admin orders page,

Sub-Total: $30.00
Shipping cost: $2.00
Total: $32.00

for zen1.39, the "$32.00" is from the column "text" of sql table zen_orders_total
but for zen150, it is the record of the column "value" and plus "$" before it

from phpmyadmin, i tried modifying the column "text" from "$32.00" to "hello", it changes nothing in admin orders page, then i tried modifying the column "value" from "32.00" to "111.00", it shows "$111.00" in admin orders page

i guess this not correct, is there anything i missed?

4 Sep 2012, 7:15 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Post #2 by kobra

Why are you trying to edit through phpmyadmin??

Zen-Venom Get Bitten

4 Sep 2012, 7:19 AM
#3
inception avatar

inception

New Zenner

Join Date:
Jun 2011
Posts:
63
Plugin Contributions:
0

Post #3 by inception

i am not trying to edit,
i edited it only for make sure that the record on admin orders page is from column "text" or "value" of table zen_orders_total

in zen_orders_tatal, the record of column "text" is $32.00, of column ''value" is "32.00",
it displays "Total: $32.00" on admin orders page
in fact, in zen1.50, this "$32.00" is from the column "value" and plus the "$"

but in zen 1.39, it is from the column "text", it is "$32.00"

4 Sep 2012, 7:37 AM
#4
inception avatar

inception

New Zenner

Join Date:
Jun 2011
Posts:
63
Plugin Contributions:
0

Post #4 by inception

i have more than one currency,
1.50, it always displays "Total: $32.00" on admin orders page wherever this order is placed from USD or GBP
1.39, it displays "Total: $32.00" or "Total: £20.12" depends on which currency the customer chose

another problem is that i use mod reward points full suit, that mod needs to output the records from column "text" cause all records of the column "value" are 0, this thread http://www.zen-cart.com/showthread.php?95021-Reward-Points-Module-Live-Release-now-available&p=1147655#post1147655

4 Sep 2012, 7:44 AM
#5
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Post #5 by kobra

From your other thread

inception:

i guess it is a bug of reward point full suite 2.1b on zen cart 1.50
Why are you reposting this same issue?

Zen-Venom Get Bitten

4 Sep 2012, 7:51 AM
#6
inception avatar

inception

New Zenner

Join Date:
Jun 2011
Posts:
63
Plugin Contributions:
0

Post #6 by inception

firstly i thought its the problem of the mod reward points, i did many test, i was looking for help from the thread of that mod, untill one hour ago, after so many tests, i finally found that is not the reward point issue, its the issue of zen cart 1.50, so i posted here, cause i don't think i could find the solution from that thread, since its not cause by that mod

4 Sep 2012, 6:03 PM
#7
inception avatar

inception

New Zenner

Join Date:
Jun 2011
Posts:
63
Plugin Contributions:
0

Post #7 by inception

i use some sites 1.39 and some sites 1.50, they work well on 1.39 sites, but all sites 1.50 get the same issue
it outputs record of column "value" of table zen_orders_order on admin orders page

if the default currency is USD, the customer place order from GDP, then the record of column "text" is "£20.12", of column "value" is "32.00",
1.50 it displays "Total: $32.00" on admin orders page,
1.39 it displays "Total: £20.12" on admin orders page

is this the issue of zen cart 1.50? cause all my sites 1.50 get this issue, but i'm not sure, perhaps i missed something?
any help?

5 Sep 2012, 8:11 AM
#8
inception avatar

inception

New Zenner

Join Date:
Jun 2011
Posts:
63
Plugin Contributions:
0

Post #8 by inception

any idea?

5 Sep 2012, 9:38 AM
#9
wilt avatar

wilt

Oji-san

Join Date:
Jun 2003
Location:
Newcastle UK
Posts:
1,950
Plugin Contributions:
3

Post #9 by wilt

Hi,

Yes, it does look as though there was a bug introducd into v1.5 in the admin/orders.php file

at approximately line 600 you will have a line like this

          '                <td align="right" class="'. str_replace('_', '-', $order->totals[$i]['class']) . '-Amount">' . $currencies->format($order->totals[$i]['value'], false) . '</td>' . "\n" .

try changing it to

           '                <td align="right" class="'. str_replace('_', '-', $order->totals[$i]['class']) . '-Amount">' . $currencies->format($order->totals[$i]['value'], true, $order->info['currency'], $order->info['currency_value']) . '</td>' . "\n" .
5 Sep 2012, 10:56 AM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,512
Plugin Contributions:
176

Post #10 by drbyte

Looks like it came from this: http://www.zen-cart.com/showthread.php?163954-Formatting-order-totals-admin-page-order-php

It would be useful to understand more about what you'd like to see things do when customers shop in alternate currencies.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

10 Sep 2012, 4:38 AM
#11
inception avatar

inception

New Zenner

Join Date:
Jun 2011
Posts:
63
Plugin Contributions:
0

Post #11 by inception

thanks, this works

but it doesn work for mod reward points full suit which output the record of column "text"

wilt:

Hi,

Yes, it does look as though there was a bug introducd into v1.5 in the admin/orders.php file

at approximately line 600 you will have a line like this

      '                <td align="right" class="'. str_replace('_', '-', $order->totals[$i]['class']) . '-Amount">' . $currencies->format($order->totals[$i]['value'], false) . '</td>' . "\n" .
> 
> 
> try changing it to
> 
> ```
           '                <td align="right" class="'. str_replace('_', '-', $order->totals[$i]['class']) . '-Amount">' . $currencies->format($order->totals[$i]['value'], true, $order->info['currency'], $order->info['currency_value']) . '</td>' . "\n" .