WishListItem
@objc(GFYWishListItem)
public class WishListItem : NSObject, Encodable
Represents a product within a wish list
-
The parent ID of the product
Declaration
Swift
@objc public let productId: String
-
Whether the item is currently in stock
Declaration
Swift
@objc public let inStock: Bool
-
The specific SKU of the product/variant (optional)
Declaration
Swift
@objc public let sku: String?
-
The current unit price of the product, after discount or sale pricing (optional)
Declaration
Swift
@objc public let price: Price?
-
The regular price of the product before sales or discounts (optional)
Declaration
Swift
@objc public let regularPrice: Price?
-
The name or title of the product (optional)
Declaration
Swift
@objc public let title: String?
-
The address of the product image (optional)
Declaration
Swift
@objc public let image: URL?
-
The date when the product was added to the list (optional)
Declaration
Swift
@objc public let dateAdded: Date?
-
The price of the product when it was added to the list (optional)
Declaration
Swift
@objc public let priceWhenAdded: Price?
-
Address of the product’s anchor tag in the list page (optional)
Declaration
Swift
@objc public let callToAction: URL?
-
Address of the product page (optional)
Declaration
Swift
@objc public let productPage: URL?
-
init(productId:
inStock: sku: price: regularPrice: title: image: dateAdded: priceWhenAdded: callToAction: productPage: ) Creates a
WishListItem
instance from each distinct item propertyDeclaration
Parameters
productId
The parent ID of the product
inStock
Whether the item is currently in stock
sku
The specific SKU of the product/variant (optional)
price
The current unit price of the product, after discount or sale pricing (optional)
regularPrice
The regular price of the product before sales or discounts (optional)
title
The name or title of the product (optional)
image
The address of the product image (optional)
dateAdded
The date when the product was added to the list (optional)
priceWhenAdded
The price of the product when it was added to the list (optional)
callToAction
Address of the product’s anchor tag in the list page (optional)
productPage
Address of the product page (optional)
-
Creates a
WishListItem
instance from aProduct
and any additional (optional) property values.Declaration
Parameters
product
The product in the wish list
dateAdded
The date when the product was added to the list (optional)
priceWhenAdded
The price of the product when it was added to the list (optional)
callToAction
Address of the product’s anchor tag in the list page (optional)
productPage
Address of the product page (optional)
-
Encodes an instance of
WishListItem
Since
2.0.0Declaration
Swift
public func encode(to encoder: Encoder) throws