Skip to content

Added sales price

Compare
Choose a tag to compare
@SungjunApp SungjunApp released this 10 May 09:12
· 15 commits to master since this release
a12f5e6

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 price Demo
  • 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))