Commit 64e1c656 by Nejc

BUYLineItem didn't have a productId when initialized with BUYVariant

parent 54cf0179
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#import "BUYProductVariant.h" #import "BUYProductVariant.h"
#import "NSDecimalNumber+BUYAdditions.h" #import "NSDecimalNumber+BUYAdditions.h"
#import "NSString+Trim.h" #import "NSString+Trim.h"
#import "BUYProduct.h"
@interface BUYLineItem () @interface BUYLineItem ()
...@@ -54,6 +55,7 @@ ...@@ -54,6 +55,7 @@
self = [super init]; self = [super init];
if (self) { if (self) {
self.variantId = variant.identifier; self.variantId = variant.identifier;
self.productId = variant.product.productId;
self.quantity = variant ? [NSDecimalNumber one] : [NSDecimalNumber zero]; self.quantity = variant ? [NSDecimalNumber one] : [NSDecimalNumber zero];
self.price = variant ? [variant price] : [NSDecimalNumber zero]; self.price = variant ? [variant price] : [NSDecimalNumber zero];
self.title = variant ? [variant title] : @""; self.title = variant ? [variant title] : @"";
......
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