From 604b021514dab28e6a06e6515f8078ab67a8535b Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Sat, 14 Jun 2008 00:52:24 +0000 Subject: [PATCH] clean-up www_buy and addToCart. inventory control is now completely in the cart --- docs/changelog/7.x.x.txt | 2 +- lib/WebGUI/Asset/Sku/Product.pm | 26 +------------------------- 2 files changed, 2 insertions(+), 26 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index b2ad6678b..6194f5643 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -14,7 +14,7 @@ - fixed: Asset Manager can now change ranks again - fixed: Cannot manage revisions in version tags. - fixed: Date picker shows time after moving through months - + - fixed: Cannot Instantiate Template 7.5.12 - skipping this release diff --git a/lib/WebGUI/Asset/Sku/Product.pm b/lib/WebGUI/Asset/Sku/Product.pm index b9611e425..bec0938e8 100644 --- a/lib/WebGUI/Asset/Sku/Product.pm +++ b/lib/WebGUI/Asset/Sku/Product.pm @@ -56,27 +56,6 @@ sub addRevision { return $newSelf; } -#------------------------------------------------------------------- - -=head2 addToCart ( variant ) - -Override/extend Sku's addToCart method to handle inventory control. - -=head3 variant - -A hashref of variant information for the variant of the Product -that is being added to the cart. Inventory management is handled -by the cart, which calls onAdjustQuantity. - -=cut - -sub addToCart { - my $self = shift; - my $variant = shift; - my $i18n = WebGUI::International->new($self->session, 'Asset_Product'); - $self->SUPER::addToCart($variant); -} - #------------------------------------------------------------------- sub definition { my $class = shift; @@ -972,10 +951,7 @@ sub www_buy { my $vid = $self->session->form->process('vid'); my $variant = $self->getCollateral('variantsJSON', 'variantId', $vid); return '' unless keys %{ $variant }; - my $error = $self->addToCart($variant); - if ($error) { - $self->view($error); - } + $self->addToCart($variant); $self->{_hasAddedToCart} = 1; return $self->www_view; }