CommerceTemplate
public struct CommerceTemplate : Codable, Templatable
기본 템플릿으로 제공되는 커머스 템플릿 클래스 입니다.
커머스 템플릿은 하나의 컨텐츠와 하나의 커머스 정보, 하나의 기본 버튼을 가집니다. 임의의 버튼을 최대 2개까지 설정할 수 있습니다.
let template = CommerceTemplate(content: Content(title: "Ivory long dress (4 Color)",
imageUrl: URL(string: "http://mud-kage.kakao.co.kr/dn/RY8ZN/btqgOGzITp3/uCM1x2xu7GNfr7NS9QvEs0/kakaolink40_original.png")!,
link: Link(mobileWebUrl: URL(string: "https://developers.kakao.com")!)),
commerce: CommerceDetail(regularPrice: 208800,
discountPrice: 146160,
discountRate: 30),
buttons: [Button(title: "구매하기",
link: Link(mobileWebUrl: URL(string: "https://developers.kakao.com")!)),
Button(title: "공유하기",
link: Link(mobileWebUrl: URL(string: "https://developers.kakao.com")!)),
])
-
“commerce” 고정 값
Declaration
Swift
public let objectType: String
-
컨텐츠에 대한 가격 정보.
Seealso
CommerceDetail
Declaration
Swift
public let commerce: CommerceDetail
-
기본 버튼 타이틀(“자세히 보기”)을 변경하고 싶을 때 설정. 이 값을 사용하면 클릭 시 이동할 링크는 content에 입력된 값이 사용됩니다.
Declaration
Swift
public let buttonTitle: String?
-
Declaration
Swift
public func toJsonObject() -> [String : Any]?