After-Form Page Does Not Show

Hi all,

Im facing "small" issue on my eshop with forms... when I try to fill form on frontpage (no matter how many and what fields I use) and send it I should get confirmation page with infotext I have defined. But after I click send button I only get refreshed form page with empty fields. Form itself (filled) is sended to my email, which is fine, but customer feels like form does not work and keeps filling it over and over.

I have two storefronts and problem is same on both, but second storefront was added recently and I could believe it was connected with it.

Anyone recognizing this situation and could possibly help?

Also I have one additional question... I was searching for some third-party Forms addon, which would allow more features, specificaly I need to automaticaly send copy of filled form (as confirmation email) back to customer.

Original CS-cart form cant do this, but maybe it would be possible to modify it...?

Thanks for any info, Marek

You should be getting a confirmation notification that form was submitted. You could​ do a small addon to capture form data, reformat and send to customer as confirmation or simply add a hook that word cc then on the email to the admin.

You should be getting a confirmation notification that form was submitted. You could​ do a small addon to capture form data, reformat and send to customer as confirmation or simply add a hook that word cc then on the email to the admin.

...thanks, yes Im getting conf.email (as eshop admin), but my main issue is that I dont get confirmation page on screen (after form fill). This would be great to solve as first step, then I will think about modifications

For these kind of questions/issues, it is most helpful if you could identify what version of cs-cart you are running. It could be a recently introduced defect or a long standing problem.

I don't see where the form submission on a "pages" page gives a confirmation.

So to do that, I would:

1) Create a language varialbe like "form_submitted_notice" with content of something like "Form has been submitted" (or whatever you want).

2) Create a php hook function called (for the my_changes addon) "fn_my_changes_send_form".

3) Your function in my_changes/func.php should look something like the following (NOT TESTED).

// Add $sender to the 'to' field of a submitted form
// Issue a notification
function fn_my_changes_send_form(&$page_data, &$form_values, &$result, &$from, &$sender) {
  if( $result == true ) {
    $page_data['form']['general'][FORM_RECIPIENT] .= ($empty($sender) ? '' : ",$sender");
    fn_set_notification("N", __("notice"), __("form_submitted_notice"), 'K');
  }
}

For these kind of questions/issues, it is most helpful if you could identify what version of cs-cart you are running. It could be a recently introduced defect or a long standing problem.

my version is 4.3.7 ULT with some modifications which makes it painfull to update, but as I wrote, it was working just fine till I set second storefront about a week ago.

I don't see where the form submission on a "pages" page gives a confirmation.

So to do that, I would:

1) Create a language varialbe like "form_submitted_notice" with content of something like "Form has been submitted" (or whatever you want).

2) Create a php hook function called (for the my_changes addon) "fn_my_changes_send_form".

3) Your function in my_changes/func.php should look something like the following (NOT TESTED).

// Add $sender to the 'to' field of a submitted form
// Issue a notification
function fn_my_changes_send_form(&$page_data, &$form_values, &$result, &$from, &$sender) {
  if( $result == true ) {
    $page_data['form']['general'][FORM_RECIPIENT] .= ($empty($sender) ? '' : ",$sender");
    fn_set_notification("N", __("notice"), __("form_submitted_notice"), 'K');
  }
}

I really appreciate your help with code. I put it in, but there is no expected action after form is filled. I do understand used logic, but as Im not programmer (just experienced user), I cant recognize what should be changed or corrected.

I would like to have it done, so if you are willing to help me out, Im ready for next try :-)

Did you register the hook in the my_changes/init.php file? It should contain:

fn_register_hooks('send_form');

Otherwise it won't know to call your hook function.

Hi all,

Im facing "small" issue on my eshop with forms... when I try to fill form on frontpage (no matter how many and what fields I use) and send it I should get confirmation page with infotext I have defined. But after I click send button I only get refreshed form page with empty fields. Form itself (filled) is sended to my email, which is fine, but customer feels like form does not work and keeps filling it over and over.

I have two storefronts and problem is same on both, but second storefront was added recently and I could believe it was connected with it.

Anyone recognizing this situation and could possibly help?

If you have any 3rd party modules which works with pages (blog, forms, polls, etc), try to temporary disable them

Did you register the hook in the my_changes/init.php file? It should contain:

fn_register_hooks('send_form');

Otherwise it won't know to call your hook function.

I put it in as you described and get following error...

line 13 in func.php is: $page_data['form']['general'][FORM_RECIPIENT] .= ($empty($sender) ? '' : ",$sender");

PHP Fatal Error

Message

Uncaught Error: Function name must be a string in /hosting/www/iqhracky.cz/www/app/addons/my_changes/func.php:13 Stack trace: #0 /hosting/www/iqhracky.cz/www/app/functions/fn.control.php(143): fn_my_changes_send_form(Array, Array, true, 'default_company...', '', Array, true, 'TEST') #1 /hosting/www/iqhracky.cz/www/app/addons/form_builder/func.php(270): fn_set_hook('send_form', Array, Array, true, 'default_company...', '', Array, true, 'TEST') #2 /hosting/www/iqhracky.cz/www/app/addons/form_builder/controllers/frontend/pages.post.php(29): fn_send_form('85', Array) #3 /hosting/www/iqhracky.cz/www/app/functions/fn.control.php(699): include('/hosting/www/iq...') #4 /hosting/www/iqhracky.cz/www/app/functions/fn.control.php(455): fn_run_controller('/hosting/www/iq...', 'pages', 'send_form', '', '') #5 /hosting/www/iqhracky.cz/www/index.php(25): fn_dispatch() #6 {main} thrown

Error at

app/addons/my_changes/func.php, line: 13

Backtrace

Please provide with the whole content of the app/addons/my_changes/func.php file

Please provide with the whole content of the app/addons/my_changes/func.php file

if (!defined('BOOTSTRAP')) { die('Access denied'); }
function fn_my_changes_pre_get_orders($params, &$fields, $sortings, $get_totals, $lang_code) {
$fields[] = '?:orders.payment_id';
$fields[] = '?:orders.shipping_ids';
}
// Add $sender to the 'to' field of a submitted form
// Issue a notification
function fn_my_changes_send_form(&$page_data, &$form_values, &$result, &$from, &$sender) {
if( $result == true ) {
$page_data['form']['general'][FORM_RECIPIENT] .= ($empty($sender) ? '' : ",$sender");
fn_set_notification("N", __("notice"), __("form_submitted_notice"), 'K');
}
}
?>

Try

$page_data['form']['general'][FORM_RECIPIENT] .= (empty($sender) ? '' : ",$sender");

Pay attention to the $ symbol near empty

Try

$page_data['form']['general'][FORM_RECIPIENT] .= (empty($sender) ? '' : ",$sender");

Pay attention to the $ symbol near empty

BINGO... works well... many thanks for your help

As I'd said..... UNTESTED. One typo, guess that's not too bad! :-)