Finally, we can add an event to the WebGUI Shopping Cart =)
This commit is contained in:
parent
86cd6179ab
commit
268ff54c30
3 changed files with 6 additions and 11 deletions
|
|
@ -336,11 +336,7 @@ sub www_addToCart {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my $eventId = $self->session->form->get("pid");
|
my $eventId = $self->session->form->get("pid");
|
||||||
|
|
||||||
#my $cart = WebGUI::Commerce::ShoppingCart->new($self->session);
|
WebGUI::Commerce::ShoppingCart->new($self->session)->add($eventId, 'Event');
|
||||||
#$cart->add($eventId, 'Event');
|
|
||||||
|
|
||||||
my $item = WebGUI::Commerce::Item->new($self->session, $eventId, 'Event');
|
|
||||||
$self->session->errorHandler->warn($item->{_eventData}->{available});
|
|
||||||
|
|
||||||
return $self->www_view;
|
return $self->www_view;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -168,8 +168,7 @@ sub new {
|
||||||
$load = "use $cmd";
|
$load = "use $cmd";
|
||||||
eval($load);
|
eval($load);
|
||||||
$session->errorHandler->warn("Item plugin failed to compile: $cmd.".$@) if($@);
|
$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($@);
|
$session->errorHandler->warn("Couldn't instantiate Item plugin: $cmd.".$@) if($@);
|
||||||
return $plugin;
|
return $plugin;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,17 +6,17 @@ our @ISA = qw(WebGUI::Commerce::Item);
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub available {
|
sub available {
|
||||||
return $_[0]->{_event}->{available};
|
return $_[0]->{_event}->{approved};
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub description {
|
sub description {
|
||||||
return $_[0]->{_event}{description};
|
return $_[0]->{_event}->{description};
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub id {
|
sub id {
|
||||||
return $_[0]->{_event}{productId};
|
return $_[0]->{_event}->{productId};
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
@ -36,7 +36,7 @@ sub new {
|
||||||
$session = shift;
|
$session = shift;
|
||||||
$eventId = 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
|
from EventManagementSystem_products as e, products as p
|
||||||
where p.productId = e.productId and p.productId=".$session->db->quote($eventId));
|
where p.productId = e.productId and p.productId=".$session->db->quote($eventId));
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue