
Originally Posted by
DivaVocals
Okay so after thinking about this I think I know what solution I would prefer to implement to achieve the objective of showing the actual points earned (the results of the order_total table's "text" column) on the order detail page..
Been messing around with stuff, and I think what would work while still keeping the currency support is the following:
Show ALL order totals from the order_total table where the class is not = to "ot_reward_points_display" display the "title" and the "value" columns
BUT...
If there are order totals from the order_total table where the class is = to "ot_reward_points_display", show those totals JUST below the other orders totals, but display the values in the "title" and the "text" columns.
.....
Dunno if this could help, i'm still trying to figure it out, but Diva's mumbling made me mumble a lot
.. so i found this kind of solution...
I modified the code:
PHP Code:
<?php
for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) {
echo ' <tr>' . "\n" .
' <td align="right" class="'. str_replace('_', '-', $order->totals[$i]['class']) . '-Text">' . $order->totals[$i]['title'] . '</td>' . "\n" .
' <td align="right" class="'. str_replace('_', '-', $order->totals[$i]['class']) . '-Amount">' . $currencies->format($order->totals[$i]['value'], false) . '</td>' . "\n" .
' </tr>' . "\n";
}
?>
With:
PHP Code:
<?php
for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) {
if ($order_total['class'] = "ot_reward_points_display") {
echo ' <tr>' . "\n" .
' <td align="right" class="'. str_replace('_', '-', $order->totals[$i]['class']) . '-Text">' . $order->totals[$i]['title'] . '</td>' . "\n" .
' <td align="right" class="'. str_replace('_', '-', $order->totals[$i]['class']) . '-Amount">' . $order->totals[$i]['text'] . '</td>' . "\n" .
' </tr>' . "\n";
} else {
echo ' <tr>' . "\n" .
' <td align="right" class="'. str_replace('_', '-', $order->totals[$i]['class']) . '-Text">' . $order->totals[$i]['title'] . '</td>' . "\n" .
' <td align="right" class="'. str_replace('_', '-', $order->totals[$i]['class']) . '-Amount">' . $currencies->format($order->totals[$i]['value'], false) . '</td>' . "\n" .
' </tr>' . "\n";
}
}
?>
It seem to work... still testing
Bookmarks