added

[iOS SDK] Added sales price

Release Note: https://github.com/pixlee/pixlee-ios-sdk/releases/tag/2.9.0

a new example to the demo app

  • how to access the example: Launch the app > main screen > tap Product UI Example button

[Data] Added new fields to PXLProduct

  • these fields are added to provide discount price information
#!java
public struct PXLProduct {
...
    public let salesPrice: Double?
    public let salesStartDate: Date?
    public let salesEndDate: Date?
...
}

[UI] Added a new option to PXLPhotoProductView for sales price

  • let discountPrice: DiscountPrice? is added to PXLProductCellConfiguration
    • discountLayout: DiscountLayout has tree options [CROSS_THROUGH, WAS_OLD_PRICE, WITH_DISCOUNT_LABEL]
    • isCurrencyLeading: Bool
      • true: display currency symbol in front of the price
      • false: display currency symbol after the price

isCurrencyLeading is nil or false

.CROSS_THROUGH.WAS_OLD_PRICE.WITH_DISCOUNT_LABEL

isCurrencyLeading is true

.CROSS_THROUGH.WAS_OLD_PRICE.WITH_DISCOUNT_LABEL
No Option selected or no sales priceDemo
  • Code Example
    • To display sales price, you need to pass PXLProductCellConfiguration(discountPrice: discountPrice) to PXLPhotoProductView.. Please see the example codes below.
    #!swift
      let discountPrice = DiscountPrice(discountLayout: DiscountLayout.WITH_DISCOUNT_LABEL, isCurrencyLeading: true)
      let widget = PXLPhotoProductView.widgetForPhoto(photo: photo,
              delegate: self,
              cellConfiguration: PXLProductCellConfiguration(discountPrice: discountPrice))