Finally, we can add an event to the WebGUI Shopping Cart =)

This commit is contained in:
Roy Johnson 2006-02-03 23:16:57 +00:00
parent 86cd6179ab
commit 268ff54c30
3 changed files with 6 additions and 11 deletions

View file

@ -336,11 +336,7 @@ sub www_addToCart {
my $self = shift;
my $eventId = $self->session->form->get("pid");
#my $cart = WebGUI::Commerce::ShoppingCart->new($self->session);
#$cart->add($eventId, 'Event');
my $item = WebGUI::Commerce::Item->new($self->session, $eventId, 'Event');
$self->session->errorHandler->warn($item->{_eventData}->{available});
WebGUI::Commerce::ShoppingCart->new($self->session)->add($eventId, 'Event');
return $self->www_view;
}

View file

@ -168,8 +168,7 @@ sub new {
$load = "use $cmd";
eval($load);
$session->errorHandler->warn("Item plugin failed to compile: $cmd.".$@) if($@);
#$plugin = eval($cmd."->new('$session', '$id', '$namespace')");
$plugin = eval($cmd->new($session, $id, $namespace));
$plugin = eval($cmd.'->new($session, "$id", "$namespace")');
$session->errorHandler->warn("Couldn't instantiate Item plugin: $cmd.".$@) if($@);
return $plugin;
}

View file

@ -6,17 +6,17 @@ our @ISA = qw(WebGUI::Commerce::Item);
#-------------------------------------------------------------------
sub available {
return $_[0]->{_event}->{available};
return $_[0]->{_event}->{approved};
}
#-------------------------------------------------------------------
sub description {
return $_[0]->{_event}{description};
return $_[0]->{_event}->{description};
}
#-------------------------------------------------------------------
sub id {
return $_[0]->{_event}{productId};
return $_[0]->{_event}->{productId};
}
#-------------------------------------------------------------------
@ -36,7 +36,7 @@ sub new {
$session = shift;
$eventId = shift;
my $eventData = $session->db->quickHashRef("select p.productId, p.title, p.description, p.price, e.available
my $eventData = $session->db->quickHashRef("select p.productId, p.title, p.description, p.price, e.approved
from EventManagementSystem_products as e, products as p
where p.productId = e.productId and p.productId=".$session->db->quote($eventId));