From b4559e89359056d6a1c27381fad4739c6057b0d8 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Mon, 25 Aug 2008 01:59:22 +0000 Subject: [PATCH] Fix a variable clash in the Cart www_view method. --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Shop/Cart.pm | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 4f98cacf0..d3f137c51 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -4,6 +4,7 @@ - fixed: Asset view time format problem - fixed: DataForm doesn't work properly with internationalized fields - fixed: incoming data not properly decoded from utf8 + - fixed: Can't call method "getSku" on unblessed reference 7.5.22 - fixed: Layout template now gets prepared correctly diff --git a/lib/WebGUI/Shop/Cart.pm b/lib/WebGUI/Shop/Cart.pm index a846ba02a..17d7e4410 100644 --- a/lib/WebGUI/Shop/Cart.pm +++ b/lib/WebGUI/Shop/Cart.pm @@ -695,8 +695,8 @@ sub www_view { |); - my @items = @{$self->getItems}; - if(scalar(@items) < 1) { + my @cartItems = @{$self->getItems}; + if(scalar(@cartItems) < 1) { # there are no items in the cart, return a message to the template my %var = ( message => $i18n->get('empty cart') @@ -708,7 +708,7 @@ sub www_view { } # generate template variables for the items in the cart - foreach my $item (@items) { + foreach my $item (@cartItems) { my $sku = $item->getSku; $sku->applyOptions($item->get("options")); my %properties = (