diff --git a/lib/Interchange6/Cart/Product.pm b/lib/Interchange6/Cart/Product.pm index d8645a9..b21eaec 100644 --- a/lib/Interchange6/Cart/Product.pm +++ b/lib/Interchange6/Cart/Product.pm @@ -149,8 +149,16 @@ than zero. Default for quantity is 1. =cut has quantity => ( - is => 'ro', - isa => PositiveInt, + is => 'ro', + # The following isa check is failing on some smokers for an (as yet) + # unknown reason. See: + # https://github.com/interchange/Interchange6/issues/28 + # so for now we use a sub instead of the Type::Tiny type + #isa => PositiveInt, + isa => sub { + die "quantity must be a positive integer" + unless ( $_[0] && $_[0] =~ /^\d+$/ ) + }, default => 1, writer => 'set_quantity', );