First off, wow! Thanks for ChronoForms 4! It's really really good! We're a charity who has no budget for a web site and ChronoForms 4 is every bit as good as the commercials solutions I've seen!
Now my question.
I've made a booking form, and need to attach a booking reference id to the resulting e-mail and in the thank you message on screen. As cf_id in the database table is unique I would like to grab this.
I've tried various bits of PHP code in the e-mail template, but to no avail.
I found a forum topic on the subject for pre-ChronoForms 4, but the solution doesn't work in ChronoForms 4 for Joomla! 1.6.
Can anyone help?
Many thanks!
Now my question.
I've made a booking form, and need to attach a booking reference id to the resulting e-mail and in the thank you message on screen. As cf_id in the database table is unique I would like to grab this.
I've tried various bits of PHP code in the e-mail template, but to no avail.
I found a forum topic on the subject for pre-ChronoForms 4, but the solution doesn't work in ChronoForms 4 for Joomla! 1.6.
Can anyone help?
Many thanks!
Hi Trouble,
I think that all the data saved should be available after the DB Save Event in the $form->data['chronoform_data'] object*
You should then be able to access the id with something like:
Bob
* 'chronoform_data' is the default value unless you change it in he DB Save configuration.
I think that all the data saved should be available after the DB Save Event in the $form->data['chronoform_data'] object*
You should then be able to access the id with something like:
<?php
$data = $form->data['chronoform_data'];
echo "the id is ".$data->cf_id;
?>
Bob
* 'chronoform_data' is the default value unless you change it in he DB Save configuration.
Thanks Bob!
Unfortunately that doesn't work :-(
All I get is "the id is ".
I've come from a J 1.5 upgrade and put the data in to it's own table so I confirmed the table name in phpMyAdmin and changed the code to:
It's in the template section of the "Email - #1" event, which appears straight after the "DB Save" event.
Justin
Unfortunately that doesn't work :-(
All I get is "the id is ".
I've come from a J 1.5 upgrade and put the data in to it's own table so I confirmed the table name in phpMyAdmin and changed the code to:
<php
$data = $form->data['j16_chronoforms_data_booking_enquiry'];
echo "the id is ".$data->cf_id;
?>
It's in the template section of the "Email - #1" event, which appears straight after the "DB Save" event.
Justin
Hi Justin,
You don't want the table name in there (unlike CFv3.2). There's a new Model ID set in the DB Save configuration.
Do you have a cf_id column in your table?
Bob
You don't want the table name in there (unlike CFv3.2). There's a new Model ID set in the DB Save configuration.
Do you have a cf_id column in your table?
Bob
Hi Bob!
Ahh yes I see.
The Model ID in the DB Save configuration is still the default "chronoform_data"!
I definitely have a cf_id column.
Although I have copied and pasted your code it still returns just "the id is ". :-(
Many thanks!
Justin
Ahh yes I see.
The Model ID in the DB Save configuration is still the default "chronoform_data"!
I definitely have a cf_id column.
Although I have copied and pasted your code it still returns just "the id is ". :-(
Many thanks!
Justin
Hi Justin,
By all means email or PM me the site URL and a SuperAdmin login and I'll take a quick look.
Bob
By all means email or PM me the site URL and a SuperAdmin login and I'll take a quick look.
Bob
Bob, your reputation precedes you🙂
URL and login e-mailed.
Thanks once again!
Justin
URL and login e-mailed.
Thanks once again!
Justin
Hi Justin,
A little trial and error - apologies for all the emails you had to delete - but we got there in the end. The data is in an array not an object and the code needed is
Bob
A little trial and error - apologies for all the emails you had to delete - but we got there in the end. The data is in an array not an object and the code needed is
<?php
$data = $form->data['chronoform_data'];
echo "the id is ".$data['cf_id'];
?>
Bob
This topic is locked and no more replies can be posted.