     }
     
 }
+
+// MARK: - ViewDetailLogging
+
+extension mParticle: ViewDetailLogging {
+
+    /// Logs the action of viewing a product's details.
+    ///
+    /// - parameter product: The SimcoeProductConvertible instance.
+    /// - parameter eventProperties: The event properties.
+    ///
+    /// - returns: A tracking result.
+    public func logViewDetail<T: SimcoeProductConvertible>(product: T, eventProperties: Properties?) -> TrackingResult {
+        let mPProduct = MPProduct(product: product)
+        let event = MPCommerceEvent(eventType: .ViewDetail,
+                                    products: [mPProduct],
+                                    eventProperties: eventProperties)
+
+        MParticle.sharedInstance().logCommerceEvent(event)
+
+        return .Success
+    }
+    
+}


        let event: MPEvent
        do {
            event = try toEvent(usingData: eventProperties)
        } catch let error as MPEventGenerationError {
            return .Error(message: error.description)
        } catch {

        MParticle.sharedInstance().start()
    }

}

// MARK: - CartLogging

extension mParticle: CartLogging {

    /// Logs the addition of a product to the cart.
    ///
    /// - parameter product:         The SimcoeProductConvertible instance.
    /// - parameter eventProperties: The event properties.
    ///
    /// - returns: A tracking result.
    public func logAddToCart<T: SimcoeProductConvertible>(product: T, eventProperties: Properties?) -> TrackingResult {
        let mPProduct = MPProduct(product: product)
        let event = MPCommerceEvent(eventType: .AddToCart,
                                    products: [mPProduct],
                                    eventProperties: eventProperties)

        MParticle.sharedInstance().logCommerceEvent(event)

        return .Success
    }

    /// Logs the removal of a product from the cart.
    ///
    /// - parameter product:         The SimcoeProductConvertible instance.
    /// - parameter eventProperties: The event properties.
    ///
    /// - returns: A tracking result.
    public func logRemoveFromCart<T: SimcoeProductConvertible>(product: T, eventProperties: Properties?) -> TrackingResult {
        let mPProduct = MPProduct(product: product)
        let event = MPCommerceEvent(eventType: .RemoveFromCart,
                                    products: [mPProduct],
                                    eventProperties: eventProperties)

        MParticle.sharedInstance().logCommerceEvent(event)

        return .Success
    }
    
}

// MARK: - CheckoutTracking

extension mParticle: CheckoutTracking {

    /// Tracks a checkout event.
    ///
    /// - parameter products:        The products.
    /// - parameter eventProperties: The event properties.
    ///
    /// - returns: A tracking result.
    public func trackCheckoutEvent<T: SimcoeProductConvertible>(products: [T], eventProperties: Properties?) -> TrackingResult {
        let mPProducts = products.map { MPProduct(product: $0) }
        let event = MPCommerceEvent(eventType: .Checkout,
                                    products: mPProducts,
                                    eventProperties: eventProperties)

        MParticle.sharedInstance().logCommerceEvent(event)

        return .Success
    }

}

// MARK: - ErrorLogging

