Some fixes in viewPurchaseHistory operation
This commit is contained in:
parent
96b6559250
commit
3ca4bf725a
3 changed files with 36 additions and 4 deletions
|
|
@ -11,6 +11,8 @@
|
|||
check for privileges.
|
||||
- fix: RSS From Parent having no icon
|
||||
- fix: HttpProxy now handles styles appropriately.
|
||||
- fix: op=viewPurchaseHistory prices are now formatted correctly
|
||||
- fix: A minor bug in the default viewPurchaseHistory template
|
||||
|
||||
7.2.1
|
||||
- Made a change to version tag commits to deal with unusually long commit
|
||||
|
|
|
|||
19
docs/upgrades/templates-7.2.2/viewPurchaseHistory.tmpl
Executable file
19
docs/upgrades/templates-7.2.2/viewPurchaseHistory.tmpl
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
#PBtmpl0000000000000019
|
||||
<table border="0">
|
||||
<tmpl_loop purchaseHistoryLoop>
|
||||
<tr>
|
||||
<td><b><tmpl_var initDate></b></td>
|
||||
<td><b><tmpl_var completionDate></b></td>
|
||||
<td align="right"><b>$ <tmpl_var amount></b></td>
|
||||
<td><b><tmpl_var status></b></td>
|
||||
<td><tmpl_if canCancel><a href="<tmpl_var cancelUrl>">Cancel</a></tmpl_if></td>
|
||||
</tr>
|
||||
<tmpl_loop itemLoop>
|
||||
<tr>
|
||||
<td align="right"><tmpl_var quantity> x </td>
|
||||
<td align="left"><tmpl_var itemName></td>
|
||||
<td align="right"><tmpl_var amount></td>
|
||||
</tr>
|
||||
</tmpl_loop>
|
||||
</tmpl_loop>
|
||||
</table>
|
||||
|
|
@ -37,13 +37,24 @@ sub www_viewPurchaseHistory {
|
|||
$var{errorMessage} = shift;
|
||||
|
||||
@history = @{WebGUI::Commerce::Transaction->new($session)->transactionsByUser($session->user->userId)};
|
||||
foreach (@history) {
|
||||
%properties = %{$_->get};
|
||||
for my $transaction (@history) {
|
||||
%properties = %{$transaction->get};
|
||||
$properties{initDate} = $session->datetime->epochToHuman($properties{initDate});
|
||||
$properties{completionDate} = $session->datetime->epochToHuman($properties{completionDate}) if ($properties{completionDate});
|
||||
$properties{completionDate} = $session->datetime->epochToHuman($properties{completionDate})
|
||||
if ($properties{completionDate});
|
||||
|
||||
# Format dollar amounts
|
||||
$properties{amount} = sprintf("%.2f",$properties{amount});
|
||||
$properties{shippingCost} = sprintf("%.2f",$properties{shippingCost});
|
||||
|
||||
my $items = $transaction->getItems;
|
||||
for my $item (@$items) {
|
||||
$item->{amount} = sprintf("%.2f",$item->{amount});
|
||||
}
|
||||
|
||||
push(@historyLoop, {
|
||||
(%properties),
|
||||
itemLoop => $_->getItems,
|
||||
itemLoop => $items,
|
||||
cancelUrl => $session->url->page('op=cancelRecurringTransaction;tid='.$properties{transactionId}),
|
||||
canCancel => ($properties{recurring} && ($properties{status} eq 'Completed')),
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue