Commit 5e02ed4c by Rune Madsen

Improved check for default variant

parent cdce7fc7
...@@ -71,7 +71,11 @@ ...@@ -71,7 +71,11 @@
{ {
if ([self.variants count] == 1) { if ([self.variants count] == 1) {
BUYProductVariant *productVariant = [self.variants firstObject]; BUYProductVariant *productVariant = [self.variants firstObject];
if ([productVariant.title isEqualToString:@"Default Title"]) { BUYOptionValue *optionValue = [productVariant.options firstObject];
NSString *defaultTitleString = @"Default Title";
NSString *defaultString = @"Default";
if ([productVariant.title isEqualToString:defaultTitleString] &&
([optionValue.value isEqualToString:defaultTitleString] || [optionValue.value isEqualToString:defaultString])) {
return YES; return YES;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment