diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 4743363cc..1eb94ee86 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -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 diff --git a/docs/upgrades/upgrade_7.5.18-7.5.19.pl b/docs/upgrades/upgrade_7.5.18-7.5.19.pl index 76b4ae523..cf1f7d072 100644 --- a/docs/upgrades/upgrade_7.5.18-7.5.19.pl +++ b/docs/upgrades/upgrade_7.5.18-7.5.19.pl @@ -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 { diff --git a/lib/WebGUI/Asset/Sku/Product.pm b/lib/WebGUI/Asset/Sku/Product.pm index a63d47d3b..313ef6275 100644 --- a/lib/WebGUI/Asset/Sku/Product.pm +++ b/lib/WebGUI/Asset/Sku/Product.pm @@ -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 ) diff --git a/lib/WebGUI/i18n/English/Asset_Product.pm b/lib/WebGUI/i18n/English/Asset_Product.pm index cc4660e85..a0d5e4ba9 100644 --- a/lib/WebGUI/i18n/English/Asset_Product.pm +++ b/lib/WebGUI/i18n/English/Asset_Product.pm @@ -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;