clean-up www_buy and addToCart. inventory control is now completely in the cart
This commit is contained in:
parent
f167c67637
commit
604b021514
2 changed files with 2 additions and 26 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue