Display SOME products based on info gathered in a HTML frame

Highlighted
New Member
2 0 0

Hi everyone, 

Here's a challenge for Shopify PROS...pleeeease I need some help here . I am creating a site where customers have to take an online assessment of lets say 50 questions. Questions are created via a bot (landbot.io, it has an open API) and the bot is embedded in an HTML frame on my shopify. Output of this bot are variables like this:

{ product1="yes", product2:"", product3:"yes", name: "victor"}. 

At the end of the bot, there is button "go to recommendations".

The main question here is: how to display ONLY the products + buy button that have a "yes" value ? (examples of code and where to put it)

Other questions are:

- Do i need to create a new page everytime for each user? if yes, how ?

- Is a webhook the best way to send the data from the bot to my shopify site ?

I know i am asking a lot but i am sure some of you can help :).

Many thanks guys!

0 Likes
Shopify Expert
9420 11 1261

The concept of the questionnaire is simple enough, but there's context missing on the products shown. For example, how many products are shown at the end of the process?

If the answer to that question is 1000, the approach could be vastly different to if you just want to show one or two.

Let's assume that the end result of the questionnaire is a single value like "foo". You could just link to a collection called "foo" or link to a collection filtered by the "foo" tag, or even just link to a search page with the keyword of "foo". There'll be other approaches as well including custom apps.

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
1 Like
New Member
2 0 0

Hey Jason.

Thanks for your quick response. I'll try to be clearer.

- We have around 30 different products. At the end of the process, the user would see between 5-10 different products that is called a "cure".

- the number of possible different "cures" containing 10 products  is endless (30x29x28x27x26...x20) ... So creating 1 filter for each cure is impossible. That's why I need to pick the products with multiple variables instead of filtering them with one. I would like something like: If variable Product1="yes", show Product1 AND if vriable Product2="yes", show product2 etc...

Or maybe there is another approach ?

Thanks !

0 Likes
Shopify Partner
1231 6 151

Hey vboels,

 

I've been playing last month with a quiz.

I am not exactly sure on the logic you are looking for but in terms of code you will need to:

  1. Have a products data object
  2. Have a logic data model
  3. Apply the filter logic to the products data

The Shopify product contains a lot of data you can use: type, price, vendor, tags, variants...

 

You can have a look at https://sections.design/pages/quiz

There are about 20 initial products.

There are 3 quiz questions that will filter them by: type, option and tags (few other options available)

At the and of the quiz, the user inputed data will be applied to the products.

The result will show only products that satisfy those conditions.

Something like: show the product IF product.type is 'foo' AND product.vendor is 'fee' and AND product.tags contain 'bar'.

 

You could change the filter logic to accommodate your custom needs but the overall code setup can be the same.

The code is at: https://github.com/mirceapiturca/Sections/tree/master/Quiz

 

Hope it helps

Say hi mircea@typefolly.com
0 Likes