Optimize checkout experience

In this Article:

  1. Configure Hyper Widget
  2. Select preferred product

1. Configure Hyper Widget

Configure onValidPreference() method to be notified of user’s preferred product, if it’s available from the Hyper API.

2.Select preferred product

If you are using Hyper’s checkout template, you can use selectRecommendedProduct() method to be select user’s preferred product to review and checkout.

Example:
widget.onValidPreference = function(data) {
    if(window.checkout && typeof window.checkout.selectRecommendedProduct === 'function') {
        window.checkout.selectRecommendedProduct(data.sku);
    }
}