ChronoEngine.com homepage

Forums

Please write a review for the extension you are using on the Joomla extensions directory before posting a new question as we are being spammed by many negative reviews.

Thank you for your support!

Problem converting v5 php to v6

dariegler 13 May, 2019
I have the following custiom code to determine a meal choice from a dropdown i have two problems.
1. getting the value of thh meal so i can do a switch on the value.
2. i do this in two different pieces for two meals.
3. when done i need to add two valules together to get a total
4. the variables are defined as hidden variables.

<?php

$favcolor = $form->data['MealM'];

switch ($favcolor) {
case "Salmon":
echo "Your meal choice is Salmon";
$form->data['amt'] = 32;
break;
case "chicken":
echo "Your meal choice is chicken!";
$form->data['amt'] = 26;
break;
case "pork":
echo "Your meal choice is pork!";
$form->data['amt'] =32;
break;
default:
echo "No Match";
}
?>
Below is the addition php which needs to change

<?php

$form->data['cost'] = $form->data['amt'] + $form->data['amt1'];
?>

Max_admin 14 May, 2019
Answer
Any $form->data should be changed to $this->data

Best regards
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
This topic is locked and no more replies can be posted.

2Checkout.com

2CheckOut.com Inc. (Ohio, USA) is an authorized retailer for goods and services provided by ChronoEngine.com