Quiz Kit

The Fish Wishlist and Quiz Kit integration allows quiz results to automatically populate a customer’s wishlist.

When a shopper completes a quiz, the recommended products from Quiz Kit are seamlessly added to their wishlist.

This integration is available to any store with both Fish Wishlist and Quiz Kit installed.



How it works

  • A customer completes a quiz in Quiz Kit.

  • Quiz Kit generates product recommendations.

  • The recommended products are automatically added to the customer’s Fish Wishlist.

This makes it easier for customers to revisit their personalized quiz results later and take action directly from their wishlist.


Setup Instructions

  1. In your Shopify Admin, open the theme editor or theme code editor.

  2. Locate the section where your Quiz Kit quiz is installed.

  3. Create a new Liquid section (or edit an existing one under the quiz section).

  4. Add the following script to the section:

<script>
document.addEventListener('quizKitResultsPageLoaded', function (e) { 
  if(!("FishWishlist" in window)) return
  for(let recommendedProduct of e.detail.recommendedProducts) {
    let fishVariant = recommendedProduct.variants?.[0]
    if(!fishVariant) continue
    FishAPI.addToWishlist('WL1', {
      ...fishVariant,
      title: `${recommendedProduct.title}`,
      availableForSale: fishVariant.available_for_sale,
      featured_image: {
        src: fishVariant.image.src || recommendedProduct.image.src,
        src_small: fishVariant.image.src || recommendedProduct.image.src
      },
      price: {
        amount: parseFloat(fishVariant.price.replace(/[^0-9.]/g, ''))
      },
      compareAtPrice: {
        amount: fishVariant.compare_at_price
      }
    })
    FishWishlist.helpers.setCount()
    document.querySelector('wishlists-drawer').renderWishlistElements()
  }
}, false);
</script>

That’s it!

Now, whenever a customer completes a quiz in Quiz Kit, their recommended products will automatically appear in their Fish Wishlist.


Last updated