From 2db563c1cff3f80b8093eb5b0b593fa7748145d4 Mon Sep 17 00:00:00 2001 From: Martin Kamerbeek Date: Sun, 14 Jan 2007 15:26:26 +0000 Subject: [PATCH] Made the shopping cart support dynamic item plugins --- docs/changelog/7.x.x.txt | 2 ++ lib/WebGUI/Commerce/ShoppingCart.pm | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 9a54f01e0..9969dd619 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -9,6 +9,8 @@ - fix: Media Folder (perlDreamer Consulting, LLC) - fix: Cannot save new content filters. - fix: Cannot delete content filter. + - change: adapted WebGUI::Commerce::ShoppingCart to make it capable of + handling dynamic item plugins. (Martin Kamerbeek / Oqapi) 7.3.4 - fix: SQLForm - cannot add new asset (Martin Kamerbeek / Oqapi) diff --git a/lib/WebGUI/Commerce/ShoppingCart.pm b/lib/WebGUI/Commerce/ShoppingCart.pm index 002a2f903..182db215d 100644 --- a/lib/WebGUI/Commerce/ShoppingCart.pm +++ b/lib/WebGUI/Commerce/ShoppingCart.pm @@ -80,6 +80,10 @@ sub add { $item = WebGUI::Commerce::Item->new($self->session,$itemId, $itemType); return "" unless ($item->available); + + # Fetch the itemId from the item plugin in stead of the given parameter. + # This allows item plugins to dynamically create new items. + $itemId = $item->id; $self->{_items}{$itemId."_".$itemType} = { itemId => $itemId,