customize some Sku methods for Product

This commit is contained in:
Colin Kuskie 2008-05-05 23:49:39 +00:00
parent ab895904e3
commit 9fda9c9d01

View file

@ -291,6 +291,21 @@ sub getCollateral {
}
#-------------------------------------------------------------------
=head2 getConfiguredTitle ( )
Returns the shortdesc of a variant that has been applied (applyOptions) to this
Product.
=cut
sub getConfiguredTitle {
my $self = shift;
return $self->getOptions->{shortdesc};
}
#-------------------------------------------------------------------
=head2 getIndexedCollateralData ( tableName )
@ -361,9 +376,17 @@ sub getFileUrl {
}
#-------------------------------------------------------------------
=head2 getPrice ( )
Only returns a price after options from a variant have been applied to this
Product.
=cut
sub getPrice {
my $self = shift;
return $self->get('price');
return $self->getOptions->{price};
}
#-------------------------------------------------------------------
@ -375,6 +398,20 @@ sub getThumbnailUrl {
#-------------------------------------------------------------------
=head2 getWeight ( )
Only returns a weight after options from a variant have been applied to this
Product.
=cut
sub getWeight {
my $self = shift;
return $self->getOptions->{weight};
}
#-------------------------------------------------------------------
=head2 moveCollateralDown ( tableName, index )
Moves a collateral data item down one position. If called on the last element of the