Regarding my previous post..
Quote Originally Posted by DivaVocals View Post
Quote Originally Posted by DivaVocals View Post
more upgrade questions..

regarding the admin/orders.php file

on line 607 I see this change:
Code:
           '                <td align="right" class="'. str_replace('_', '-', $order->totals[$i]['class']) . '-Amount">' . $order->totals[$i]['text'] . '</td>' . "\n" .
the default code is this:
Code:
           '                <td align="right" class="'. str_replace('_', '-', $order->totals[$i]['class']) . '-Amount">' . $currencies->format($order->totals[$i]['value'], false) . '</td>' . "\n" .
Is this a Rewards points change?? (there are no code comments to help clarify this if it is) If it is a Rewards Points modification, I need some clarification as to what EXACTLY this change does???


Also because the orders.php file bundled in the Rewards Points module is from the last v1.5.4RC version and NOT the final release, it is MISSING a language file change that went into the last release v1.5.4RC version and eventually into the final release code.

line 978 reads:
Code:
      $contents[] = array('text' => 'Products Ordered: ' . sizeof($order->products) );
It should be:
Code:
      $contents[] = array('text' => TABLE_HEADING_PRODUCTS . ': ' . sizeof($order->products) );
Quote Originally Posted by lhungil View Post
I believe the change is to show the "text" field from the order_total database table directly instead of reading from the "value" and displaying based upon currency rules.

It has been a long time since I have looked at this module, But If I remeber correctly the order total module for reward points uses the "text" field to display the "points" and leaves the value at 0 for earned (and a monetary value if redeemed).
Now I see what happened and when this code was introduced into the base module.. Thanks to a little birdie, I found these posts from the old support thread:

Quote Originally Posted by izar74 View Post
Hi again,

hard work bring issues as long as solutions ;-)

First the issue: I found that when i was going to the details of an order the Rewards point shown were always 0, but if you go on the invoice module the Rewards point magically appeared. Simply in the order details the point were not shown.

it seems that the problem could be with this line in /admin/order.php around line 666
PHP Code:
<td align="right" class="'. str_replace('_', '-', $order->totals[$i]['class']) . '-Amount">' . $currencies->format($order->totals[$i]['value'], false) . '</td>' . "\n" . 
If replaced with:
PHP Code:
<td align="right" class="'. str_replace('_', '-', $order->totals[$i]['class']) . '-Amount">' . $order->totals[$i]['text'] . '</td>' . "\n" . 
all seems fine. Someone else got this error?

Zencart 1.51
Reward Point 2.1b
Quote Originally Posted by lhungil View Post
Order Total Modules were designed to show prices added or subtracted from an order... While the changes mentioned earlier "may" work... They may also break pricing calculation for stores accepting more than one currency... The stock Zen Cart "/admin/order.php" uses the database entry for "value" (with any currency conversion and formatting) instead of "text".

Instead of removing the currency calculations from EVERY order total module, one should probably add a modification to "/admin/order.php" specifically targeting the "Reward Points display" order total module (and using "text" when this module is encountered)... If going this route, one would also need to add an exemption to cause "Edit Orders" to NOT load the "Reward Points display" module (so it does not edit this line)... Or add "special" handling to address the non-standard use of the "value" and "text" but the "Reward Points display" order total module.

The alternative is to stop using (and remove) the "Reward Points Display" order total module and add the reward points earned information directly to the various templates / pages involved. This avoids the issues caused by using the "orders_total" database table in a way not expected by the Zen Cart core code.
Quote Originally Posted by lhungil View Post
Alright, dug into this the subject a little deeper today. Looks like Zen Cart 1.5.x out of box does not allow one to view orders in the admin with a currency other than the store default... I remember a discussion of this somewhere on the forums in the past, but do not remember what was decided...

So your change should not make a difference for the majority of users of Zen Cart 1.5.x (only those who may have for some reason wanted to see localized pricing for a different country in the admin and made changes)... I still believe it would be even better to at least add some conditional code to check which "order total" module (in "/admin/orders.php") is being displayed and ONLY skip the format function on the "Reward Points display" order total module... Or replace the "Reward Points display" order total module completely.


I currently have many other ongoing projects, so will not be able to spend any time on this project. Just was browsing this thread (have poked in here from time to time since it crossed my path) and decided to share some thoughts.
Now at the risk of offending anyone, IMHO this code should have NEVER found it's way into the base module.. I am not a fan of modules which include incomplete solutions which IMHO this code change is.. I think lhungil was on the right track on what the RIGHT solution SHOULD be. Perhaps the change to the orders.php file would have been better served as an instruction included in the readme as opposed to being made part of the code base. This way for those who are okay with this solution knowing the pros and cons of it can implement if they wish.. Or make this "bandaid" solution an admin on/off option..