Re: Rounding problem when converting from points to $ in Total Order
Quote:
Originally Posted by
izar74
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
The only problem is this module doesn't show any points when using edit orders. Admin/customer/orders/edit. It has been like this ever since Andrew left the scene. Points show everywhere else, invoice, details.
Re: Rounding problem when converting from points to $ in Total Order
Agree, i just find that solution but i'm yet testing it. If someone would like to try itand post a feedback i'll appreciate. :-)
Re: Rounding problem when converting from points to $ in Total Order
Quote:
Originally Posted by
countrycharm
The only problem is this module doesn't show any points when using edit orders. Admin/customer/orders/edit. It has been like this ever since Andrew left the scene. Points show everywhere else, invoice, details.
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.
Re: Rounding problem when converting from points to $ in Total Order
Quote:
Originally Posted by
izar74
Agree, i just find that solution but i'm yet testing it. If someone would like to try itand post a feedback i'll appreciate. :-)
lhungil is right. They may also break pricing calculation for stores accepting more than one currency
I don't use more than one currency so it wouldn't affect me but it might somebody else.
Re: Rounding problem when converting from points to $ in Total Order
Quote:
Originally Posted by
lhungil
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.
lhungil feel free to take a stab at this if you would. I feel like that would be and excellent idea in what should to be done in handling this problem.
Re: Rounding problem when converting from points to $ in Total Order
Quote:
Originally Posted by
countrycharm
lhungil is right. They may also break pricing calculation for stores accepting more than one currency
I don't use more than one currency so it wouldn't affect me but it might somebody else.
lhungil is right, the only thing is that the line i modified is not touched in the Edit Orders module. Actually i've tryed a few order switching currencies and it seem no problem arise.. still testing.
Re: Rounding problem when converting from points to $ in Total Order
Quote:
Originally Posted by
izar74
lhungil is right, the only thing is that the line i modified is not touched in the Edit Orders module. Actually i've tryed a few order switching currencies and it seem no problem arise.. still testing.
I did some testing too and found no problems switching currency but this needs more testing to see if it will break pricing calculation, if not one solution solved.
Re: Rounding problem when converting from points to $ in Total Order
Quote:
Originally Posted by
countrycharm
I did some testing too and found no problems switching currency but this needs more testing to see if it will break pricing calculation, if not one solution solved.
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.
Quote:
Originally Posted by
countrycharm
lhungil feel free to take a stab at this if you would. I feel like that would be and excellent idea in what should to be done in handling this problem.
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.
Re: Rounding problem when converting from points to $ in Total Order
I just installed this awesome plugin last night and it is working great except for one thing. I have changed it so that customers are going to get 5 points for each $1 spent. So under Catalog>Reward Points I have set the Global Rewards Point Settings to 5.0000. The problem is that customers are only getting 5 points per order. For example, one customer has spent $3 and only received 5 points. It should have been 15 points. When you are shopping though it shows in the sidebox how many points you have in your cart and it adds up all the points you have in your cart. If you have $3 in your cart is shows 15 points. I hope I'm explaining this right and you all understand me. I'm sure it's just a setting that I need to change but I just don't know which setting. Any help would be greatly appreciated.
Re: Rounding problem when converting from points to $ in Total Order
Quote:
Originally Posted by
prettyeyes1
I just installed this awesome plugin last night and it is working great except for one thing. I have changed it so that customers are going to get 5 points for each $1 spent. So under Catalog>Reward Points I have set the Global Rewards Point Settings to 5.0000. The problem is that customers are only getting 5 points per order. For example, one customer has spent $3 and only received 5 points. It should have been 15 points. When you are shopping though it shows in the sidebox how many points you have in your cart and it adds up all the points you have in your cart. If you have $3 in your cart is shows 15 points. I hope I'm explaining this right and you all understand me. I'm sure it's just a setting that I need to change but I just don't know which setting. Any help would be greatly appreciated.
Can You please tell which are your settings under Configuration/Reward Points?
Have you checked if that client have pending points (from client/reward Points menu)?
From what You wrote It seems that only few point are passed from "pending" to "earned".