From 9fda9c9d017183d09d77bced6d420e3364ecad02 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Mon, 5 May 2008 23:49:39 +0000 Subject: [PATCH] customize some Sku methods for Product --- lib/WebGUI/Asset/Sku/Product.pm | 39 ++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/lib/WebGUI/Asset/Sku/Product.pm b/lib/WebGUI/Asset/Sku/Product.pm index d191f113f..eab373690 100644 --- a/lib/WebGUI/Asset/Sku/Product.pm +++ b/lib/WebGUI/Asset/Sku/Product.pm @@ -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