Catalog Item Details

For every item presented in the Catalog you can fetch details such as locations, contact information, prices and etc using the following method.

let catalogItem = catalog.groups[0].items[0]
Traveler.fetchCatalogItemDetails(catalogItem) { (details, error) in

}

Alternatively you can use the delegate pattern

Traveler.fetchCatalogItemDetails(catalogItem, delegate: self)
extension MyViewController: CatalogItemDetailsFetchDelegate {
    func catalogItemDetailsFetchDidSucceedWith(_ result: CatalogItemDetails) }
    
    }
    
    func catalogItemDetailsFetchDidFailWith(_ error: Error) {
    
    }
}

It is recommended that you display the details of this item in a modal. The UI SDK ships with a storyboard for your convenience (CatalogItem.storyboard) so that if you wish to use our recommended flows from here all the way to making a booking, you can simply just use it as a reference in your own storybaords inside Xcode's Interface Builder. If you are not using storyboards, you can always instantiate the flow via code like below.

let storyboard = UIStoryboard(name: "CatalogItem", bundle: Bundle(for: CatalogItemViewController.self))
if let vc = storyboard.instantiateInitialViewController() {
    present(vc, animated: true)
}

If you choose to use our recommended flow for the details screen and onwards, you can stop right here as our UI SDK will handle the rest all the way to booking and placing an order; however if you like to implement your own cusom UI and flow, you will be required to make a few more calls and collect more information from your user.

Last updated