Gift Quiz

Help customers find the perfect gift with a quiz and product recommendations.

Code Level

Intermediate

Published

 

Example Description

In this example, a visitor provides information about who they want to buy a gift for, and the site makes recommendations based on their answers.

Example Code

How We Built It

The Collection We Added: productsKeywords

The productsKeywords collection has the following fields:

  • product: A reference field that points to an item in the Products collection

  • keywords: A list of keywords that relate to the product

​​

Adding the Quiz

We added a slideshow on the Gift Quiz page. Each slide contains a quiz question. The slideshow is set up so that when a question is answered, the next slide appears.

Displaying the Recommendations

When the last question is answered, we query the productsKeywords collection for all the products with keywords that match the answers.

 

The last slide in the slideshow then displays a random selection of the query results in a repeater. Each repeated item has elements that display the image, name, and price of the recommended gifts.

Next Steps

  1. Open this example in the Editor to work with the template.

  2. Publish the site and refresh your browser so the Stores collections appear in the Database.

  3. Learn how to work with examples in Corvid.​​

APIs We Used

Related Articles

Related Examples

Add to Cart Gallery

Let customers to add products to their cart

INTERMEDIATE

Hide and Show Elements

Hide and show elements in response to user interactions

BEGGINER

Hide and Show Elements

Hide and show elements in response to user interactions

BEGGINER