If I understand correctly, it looks like you really only have 2 branches to your tree (products and services). Everything else applies to all products or all services respectively and is one-to-one (except for budget). Instead of using categories, I would probably opt for using Entry Type
to determine whether it's a product or service, and dropdown and/or checkbox fields to determine the product/service attributes, which you can then use to search for products/services directly using an ElementCriteriaModel
.
Channel => productsServices
Entry Type => product
Field => testingType (dropdown)
Field => surfaceType (dropdown)
Entry Type => service
Field => reportingLevel (dropdown)
Field => isoCertification (checkbox)
Field => price
In your template, you can use javascript to display the correct form questions (based on the answer to the first question) using .on('change', function(event){..}
). Select field options can be set dynamically from the field options. Budget options can perhaps be stored in a separate field in a global set ('budgetOptions') for example.
Who will test your self-cleaning surface?
<select name="productServiceType">
<option value="product">I'll test it myself</option>
<option value="service">I want the experts</option>
</select>
<div class="product-questions" style="display:none">
What is the reason for your testing?
<select name="testingType">...</select>
What surface type will you be testing?
<select name="surfaceType">...</select>
</div>
<div class="services-questions" style="display:none">
What level of reporting do you require?
<select name="reportingLevel">...</select>
Do you require ISO certification?
<select name="isoCertification">...</select>
What is your budget?
<select name="budget">...</select>
</div>
You can then submit the form to your productServices template, retrieve the attributes and find the associated products/services.
{# set default params #}
{% set params = {
section: 'productsServices',
limit: null
} %}
{# determine productService Type #}
{% set type = craft.request.getParam('productServiceType') %}
{# set product params #}
{% if type == "product" %}
{% set testingTypeParam = craft.request.getParam('testingType') %}
{% set surfaceTypeParam = craft.request.getParam('surfaceType') %}
{% set params = params|merge([
testingType: testingTypeParam,
surfaceType: surfaceTypeParam
]) %}
{% endif %}
{# set service params #}
{% if type == "service" %}
{% set reportingLevelParam = craft.request.getParam('reportingLevel') %}
{% set isoCertificationParam = craft.request.getParam('isoCertification') %}
{% set budgetParam = craft.request.getParam('budget') %}
{% set params = params|merge( [
reportingLevel: reportingLevelParam,
isoCertification: isoCertificationParam
price: '>= ' ~ budgetParam
]) %}
{% endif %}
{# retrieve entries #}
{% set entries = craft.entries(params) %}
{% for entry in entries %}
{{ title }}
...
{% endfor %}
Not tested, but should be close.