Adding Shipping plugins

This commit is contained in:
Martin Kamerbeek 2005-04-25 22:22:31 +00:00
parent 8dc80f6e2d
commit 2d2228e266
3 changed files with 152 additions and 0 deletions

View file

@ -0,0 +1,48 @@
package WebGUI::Commerce::Shipping::PerTransaction;
our @ISA = qw(WebGUI::Commerce::Shipping);
use strict;
#-------------------------------------------------------------------
sub calc {
my ($self);
$self = shift;
return 0 unless (scalar(@{$self->getShippingItems}));
return $self->get('pricePerTransaction');
};
#-------------------------------------------------------------------
sub configurationForm {
my ($self, $f);
$self = shift;
$f = WebGUI::HTMLForm->new;
$f->float(
-name => $self->prepend('pricePerTransaction'),
-label => WebGUI::International::get('price', 'CommerceShippingPerTransaction'),
-value => $self->get('pricePerTransaction')
);
return $self->SUPER::configurationForm($f->printRowsOnly);
}
#-------------------------------------------------------------------
sub init {
my ($class, $self);
$class = shift;
$self = $class->SUPER::init('PerTransaction');
return $self;
}
#-------------------------------------------------------------------
sub name {
return WebGUI::International::get('title', 'CommerceShippingPerTransaction');
}
1;