Form
// Define the product categories and their choices
$productCategories = array(
'Number of people' => array(
'1 person',
'2 persons',
'3 persons',
'4-5 people',
'more'
),
'Application' => array(
'Shower',
'Kitchen',
'garden house',
'tiny house',
'Camper'
)
);
// Ask the customer what features they want
$selectedProperties = array();
foreach ($productCategories as $category => $options) {
echo "For $category, please select an option:\n";
foreach ($options as $index => $option) {
echo ($index + 1) . ".$option\n";
}
$selection = readline("Your selection (1-" . count($options) . "): ");
$selectedproperties[$category] = $options[$selection - 1];
}
// Logic for product recommendation based on selected properties
$recommendedProduct = '';
if ($selectedProperties['Application'] == 'Shower') {
if ($selectedproperties['number of people'] == '1 person') {
$recommended product = '30 L photovoltaic off-grid boiler or 30 L photovoltaic hybrid boiler';
} elseif ($selectedProperties['Number of People'] == '2 People') {
$recommended product = '30 L photovoltaic off-grid boiler or 30 L photovoltaic hybrid boiler (moderate shower behaviour) or 80 L photovoltaic off-grid boiler or 80 L photovoltaic hybrid boiler';
} elseif ($selectedProperties['Number of People'] == '3 People') {
$recommended product = '80 L photovoltaic off-grid boiler or 80 L photovoltaic hybrid boiler (with moderate shower behavior) or 200 L photovoltaic boiler';
} elseif ($selectedproperties['number of people'] == '4-5 people') {
$recommendedproduct = '200 L photovoltaic boiler';
} elseif ($selectedproperties['number of people'] == 'more') {
$recommended product = '300 L photovoltaic boiler (suitable for 5-6 people)';
}
} elseif ($selectedProperties['Application'] == 'Kitchen') {
$recommendedProduct = '10 L Offgridboiler';
} elseif ($selectedProperties['Application'] == 'Summer house') {
$recommendedproduct = '10 L photovoltaic off-grid boiler';
} elseif ($selectedProperties['Application'] == 'RV') {
$recommendedproduct = '10 L Caravan Boiler';
} elseif ($selectedProperties['Application'] == 'Tiny House') {
if ($selectedproperties['number of people'] == '1 person') {
$recommendedproduct = '30 L boiler';
} elseif ($selectedProperties['Number of People'] == '2 People') {
$recommended product = '30 L photovoltaic off-grid boiler or 30 L photovoltaic hybrid boiler (moderate shower behaviour) or 80 L photovoltaic off-grid boiler or 80 L photovoltaic hybrid boiler';
}
}
// Output of recommended products
echo "Recommended Product: $recommendedProduct\n";
?>