customize some Sku methods for Product
This commit is contained in:
parent
ab895904e3
commit
9fda9c9d01
1 changed files with 38 additions and 1 deletions
|
|
@ -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 )
|
=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 {
|
sub getPrice {
|
||||||
my $self = shift;
|
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 )
|
=head2 moveCollateralDown ( tableName, index )
|
||||||
|
|
||||||
Moves a collateral data item down one position. If called on the last element of the
|
Moves a collateral data item down one position. If called on the last element of the
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue