Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

After-Form Page Does Not Show Rate Topic   - - - - -

 
  • markuson
  • Junior Member
  • Members
  • Join Date: 08-May 11
  • 30 posts

Posted 12 March 2017 - 07:13 PM #1

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



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11358 posts

Posted 12 March 2017 - 08:12 PM #2

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.

EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • markuson
  • Junior Member
  • Members
  • Join Date: 08-May 11
  • 30 posts

Posted 12 March 2017 - 08:29 PM #3

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



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11358 posts

Posted 12 March 2017 - 08:32 PM #4

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.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11358 posts

Posted 12 March 2017 - 09:08 PM #5

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');
  }
}


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • markuson
  • Junior Member
  • Members
  • Join Date: 08-May 11
  • 30 posts

Posted 12 March 2017 - 09:37 PM #6

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.



 
  • markuson
  • Junior Member
  • Members
  • Join Date: 08-May 11
  • 30 posts

Posted 12 March 2017 - 10:41 PM #7

 

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 :-) 



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11358 posts

Posted 13 March 2017 - 04:16 AM #8

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.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19687 posts

Posted 13 March 2017 - 07:36 AM #9

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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • markuson
  • Junior Member
  • Members
  • Join Date: 08-May 11
  • 30 posts

Posted 13 March 2017 - 09:02 AM #10

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

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19687 posts

Posted 13 March 2017 - 02:05 PM #11

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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • markuson
  • Junior Member
  • Members
  • Join Date: 08-May 11
  • 30 posts

Posted 13 March 2017 - 02:16 PM #12

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

 

<?php
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');
  }
}
?>


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19687 posts

Posted 13 March 2017 - 02:21 PM #13

Try

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

Pay attention to the $ symbol near empty


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • markuson
  • Junior Member
  • Members
  • Join Date: 08-May 11
  • 30 posts

Posted 13 March 2017 - 02:38 PM #14

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



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11358 posts

Posted 13 March 2017 - 10:04 PM #15

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


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.