Fix per item shipping in Products.

This commit is contained in:
Colin Kuskie 2008-07-31 02:37:52 +00:00
parent 8f4149d082
commit 448f1ffdf5
4 changed files with 46 additions and 1 deletions

View file

@ -9,6 +9,7 @@
some results
- Exposed a form element for the GalleryAlbum Others Can Add property
- fixed: EMS 2.0 migration badges
- fixed: per item shipping
7.5.18
- fixed: Collateral Image Manager broken in Firefox 3

View file

@ -31,6 +31,7 @@ my $session = start(); # this line required
# upgrade functions go here
addNewInboxIndexes( $session );
updateAddressTable( $session );
addProductShipping( $session );
finish($session); # this line required
@ -45,7 +46,7 @@ finish($session); # this line required
#----------------------------------------------------------------------------
# Removes the name field and adds a firstName and lastName field
sub updateAddressTable{
sub updateAddressTable {
my $session = shift;
print "\tUpdating TABLE address... " unless $quiet;
$session->db->write("ALTER TABLE address DROP COLUMN name");
@ -53,6 +54,15 @@ sub updateAddressTable{
print "\tDone.\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Removes the name field and adds a firstName and lastName field
sub addProductShipping {
my $session = shift;
print "\tAdding shippingRequired to the Product table... " unless $quiet;
$session->db->write("ALTER TABLE Product add COLUMN isShippingRequired INT(11)");
print "\tDone.\n" unless $quiet;
}
#----------------------------------------------------------------------------
# Add new indexes to the inbox to make millions of messages possible
sub addNewInboxIndexes {

View file

@ -128,6 +128,13 @@ sub definition {
deleteFileUrl=>$session->url->page("func=deleteFileConfirm;file=manual;filename="),
defaultValue=>undef
},
isShippingRequired => {
tab => "shop",
fieldType => "yesNo",
label => $i18n->get('isShippingRequired'),
hoverHelp => $i18n->get('isShippingRequired help'),
defaultValue => 0,
},
warranty=>{
tab => "properties",
fieldType=>"file",
@ -478,6 +485,21 @@ sub getWeight {
return $self->getOptions->{weight};
}
#-------------------------------------------------------------------
=head2 isShippingRequired
Overriding the method from Sku so that the user can configure it.
=cut
sub isShippingRequired {
my $self = shift;
$self->session->log->warn('is shipping required: '.$self->get('isShippingRequired'));
return $self->get('isShippingRequired');
}
#-------------------------------------------------------------------
=head2 moveCollateralDown ( tableName, keyName, keyValue )

View file

@ -841,6 +841,18 @@ be useful, others may not.|,
context => q|template variable|
},
'isShippingRequired' => {
message => q|Is shipping required?|,
lastUpdated => 0,
context => q|label for the edit sku|
},
'isShippingRequired help' => {
message => q|This determines whether shipping costs will be calculated when the user checks out.|,
lastUpdated => 0,
context => q|hover help for isShippingRequired in the edit sku screen|
},
};
1;