Adding Shipping plugins
This commit is contained in:
parent
8dc80f6e2d
commit
2d2228e266
3 changed files with 152 additions and 0 deletions
48
lib/WebGUI/Commerce/Shipping/PerTransaction.pm
Normal file
48
lib/WebGUI/Commerce/Shipping/PerTransaction.pm
Normal 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;
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue