diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index a1294896f..ee5c090d1 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -13,6 +13,7 @@ - fixed #12103: PayPalStd driver fails occasionally - rfe #12105: Make shortcuts related for export purposes - rfe #12108: Mail to Group preference field + - fixed #12107: Viewing an individual transaction item fails 7.10.13 - added #12079: Carousel Auto Play diff --git a/docs/templates.txt b/docs/templates.txt index 5b42ed00d..faf97a9b6 100644 --- a/docs/templates.txt +++ b/docs/templates.txt @@ -1,6 +1,11 @@ This is a running list of template changes made during upgrades. If you have copied the default templates, you will need to apply these changes manually to your copies. +7.10.14 + * My Purchases Detail (Default) - shopping-cart-collateral-items/my-purchases-detail-default + * Email Receipt (Default) - shopping-cart-collateral-items/email-receipt-default + Added code to prevent links to items with bad skus to both templates. + 7.10.13 * Cart (Default) - default-shopping-cart-template In 7.10.7, hardcoded JavaScript was removed from the Cart code and migrated to the Cart template. The list of Javascript and files which are needed is below. Please add it to the Attachments or Extra Head Tags for any customized Cart templates. diff --git a/docs/upgrades/packages-7.10.14/shopping-cart-collateral-items_email-receipt-default.wgpkg b/docs/upgrades/packages-7.10.14/shopping-cart-collateral-items_email-receipt-default.wgpkg new file mode 100644 index 000000000..1e15616b3 Binary files /dev/null and b/docs/upgrades/packages-7.10.14/shopping-cart-collateral-items_email-receipt-default.wgpkg differ diff --git a/docs/upgrades/packages-7.10.14/shopping-cart-collateral-items_my-purchases-detail-default.wgpkg b/docs/upgrades/packages-7.10.14/shopping-cart-collateral-items_my-purchases-detail-default.wgpkg new file mode 100644 index 000000000..b83bef0bf Binary files /dev/null and b/docs/upgrades/packages-7.10.14/shopping-cart-collateral-items_my-purchases-detail-default.wgpkg differ diff --git a/lib/WebGUI/Help/Shop.pm b/lib/WebGUI/Help/Shop.pm index 9151f1ca4..94649fb1b 100644 --- a/lib/WebGUI/Help/Shop.pm +++ b/lib/WebGUI/Help/Shop.pm @@ -740,6 +740,9 @@ our $HELP = { { name => 'viewItemUrl', }, + { + name => 'hasSku', + }, { name => 'price', description => 'price help', diff --git a/lib/WebGUI/Shop/Transaction.pm b/lib/WebGUI/Shop/Transaction.pm index 4e089ae3d..3b228bfe0 100644 --- a/lib/WebGUI/Shop/Transaction.pm +++ b/lib/WebGUI/Shop/Transaction.pm @@ -463,11 +463,16 @@ sub getTransactionVars { # Post purchase actions my $actionsLoop = []; - my $actions = $item->getSku->getPostPurchaseActions( $item ); - for my $label ( keys %{$actions} ) { - push @{$actionsLoop}, { - label => $label, - url => $actions->{$label}, + my $sku = eval { $item->getSku }; + my $has_sku = 0; + if (! WebGUI::Error->caught) { + my $actions = $sku->getPostPurchaseActions( $item ); + $has_sku = 1; + for my $label ( keys %{$actions} ) { + push @{$actionsLoop}, { + label => $label, + url => $actions->{$label}, + } } } @@ -485,7 +490,8 @@ sub getTransactionVars { %{$item->get}, %taxVars, viewItemUrl => $url->page('shop=transaction;method=viewItem;transactionId='.$self->getId.';itemId='.$item->getId, 1), - price => sprintf("%.2f", $item->get('price')), + hasSku => $hasSku, + price => sprintf( "%.2f", $item->get('price') ), pricePlusTax => sprintf( "%.2f", $price + $taxAmount ), extendedPrice => sprintf( "%.2f", $quantity * $price ), extendedPricePlusTax => sprintf( "%.2f", $quantity * ( $price + $taxAmount ) ), @@ -1187,6 +1193,8 @@ sub www_view {
}; foreach my $item (@{$transaction->getItems}) { + eval { $item->getSku; }; + my $sku_exists = !WebGUI::Error->caught; $output .= WebGUI::Form::formHeader($session) .WebGUI::Form::hidden($session, {name=>"shop",value=>"transaction"}) .WebGUI::Form::hidden($session, {name=>"method",value=>"updateItem"}) @@ -1194,9 +1202,15 @@ sub www_view { .WebGUI::Form::hidden($session, {name=>"itemId",value=>$item->getId}) .q{