Hi there,
I have a question about calculating with values.
I have the number of things someone want to order and I know that one of those things costs 4 $. How can I calculate the overall price to show it on the thanks page?
I tried to use a custom code element with this code:
But then my form is not shown at all...π
Can you help me please?
Regards
Steffen
I have a question about calculating with values.
I have the number of things someone want to order and I know that one of those things costs 4 $. How can I calculate the overall price to show it on the thanks page?
I tried to use a custom code element with this code:
<?php
$rechnungsbetrag = 0;
$rechnungsbetrag = {anzahl_buecher} + {anzahl_usb};
?>
<input type="hidden" id="rechnungsbetrag " name="rechnungsbetrag " title="rechnungsbetrag " value="<?php echo $rechnungsbetrag; ?>" />
But then my form is not shown at all...π
Can you help me please?
Regards
Steffen
Hi Steffen,
You can't use the curly brackets syntax in PHP, you have to use PHP variables. Please try
Bob
You can't use the curly brackets syntax in PHP, you have to use PHP variables. Please try
<?php
$form->data['rechnungsbetrag'] = $form->data['anzahl_buecher'] + $form->data['anzahl_usb'];
?>
Then put {rechnungsbetrag} in the Thank you page.
Bob
hi iam having a similar problem testing
<?php
$form->data['message'] = $form->data['Kmat'] + $form->data['lgBx'];
echo $message;
?>
and in email template
{message} only returns a 0
any help will be greatly appreciated
<?php
$form->data['message'] = $form->data['Kmat'] + $form->data['lgBx'];
echo $message;
?>
and in email template
{message} only returns a 0
any help will be greatly appreciated
it should be
Where do you add this code ? you should have it inside a "custom code" action BEFORE the "Email" action!
echo $form->data['message'];
in your case!
Where do you add this code ? you should have it inside a "custom code" action BEFORE the "Email" action!
yes it is in custom code, testing now, thanks
hi , so i replace strings on all variables to include the form data array, there is only one portion of the code being ignored, is there something i may do to covert this php to be compatible with cfv5? thanks in advance
here is the code being ignored
here is the code being ignored
$total_pstairs = 0;
$total_pstairs = 0;
if($pickupstairs == '3' || $pickupstairs == '4' || $pickupstairs == '5' || $pickupstairs == '6' || $pickupstairs == '6+'){
if($pickupstairs=='6+'){
$pstairs = 5;
}else{
$pstairs = $pickupstairs-2;
}
$total_pstairs = ($total * 10)/100;
$total_pstairs = $total_pstairs * $pstairs;
}
if($dropoffstairs == '3' || $dropoffstairs == '4' || $dropoffstairs == '5' || $dropoffstairs == '6' || $dropoffstairs == '6+'){
if($dropoffstairs=='6+'){
$dstairs = 5;
}else{
$dstairs = $dropoffstairs-2;
}
$total_dstairs = ($total * 10)/100;
$total_dstairs = $total_dstairs * $dstairs;
}
$total_stairs = $total_pstairs + $total_dstairs;
$total_quote = $total + $total_pstairs + $total_dstairs;
sorry the issue is not in code i found that on these dropdown fields I am unable to use
elevator=Elevator
groundFloor=Ground Floor
1=1 Flight of Stairs
2=2 Flights of Stairs
3=3 Flights of Stairs
4=4 Flights of Stairs
5=5 Flights of Stairs
6=6 Flights of Stairs
6+=more than 6 Flights
and so i used
elevator=Elevator
groundFloor=Ground Floor
(1)=1 Flight of Stairs
(2)=2 Flights of Stairs
(3)=3 Flights of Stairs
(4)=4 Flights of Stairs
(5)=5 Flights of Stairs
(6)=6 Flights of Stairs
(6+)=more than 6 Flights
otherwise my server will crash?
elevator=Elevator
groundFloor=Ground Floor
1=1 Flight of Stairs
2=2 Flights of Stairs
3=3 Flights of Stairs
4=4 Flights of Stairs
5=5 Flights of Stairs
6=6 Flights of Stairs
6+=more than 6 Flights
and so i used
elevator=Elevator
groundFloor=Ground Floor
(1)=1 Flight of Stairs
(2)=2 Flights of Stairs
(3)=3 Flights of Stairs
(4)=4 Flights of Stairs
(5)=5 Flights of Stairs
(6)=6 Flights of Stairs
(6+)=more than 6 Flights
otherwise my server will crash?
Solved by email!
Regards,
Max
Regards,
Max
This topic is locked and no more replies can be posted.