Checkout Error In 4.3.3

If I set up the checkout to display new customer first (most of my customers are new), and checkout as guest as the default option (see screenshot), the customer gets an error when they click the Checkout as Guest button (see second screen shot). The error message is one of those really helpful ones: Error Oops, something went wrong (Internal Server Error). Please try again.



Any idea why this is?

Screen Shot 2015-07-08 at 9.06.12 PM.png

Screen Shot 2015-07-08 at 9.08.19 PM.png

Actually it doesn't seem to matter what settings I choose for how the checkout is set up, choosing guest checkout causes the same error and the customer can't proceed.

OK I got the answer below from Helpdesk last night. Can someone tell me how to make these changes using FTP and a text editor. I'm assuming these are commands to be issued from a Linux command prompt. I have little to no experience with that. Helpdesk should not assume that CS-Cart users are all Linux geeks who have command line access to their server. Any help on how to make these changes would be appreciated.



Here is their answer:



Please try applying the following patch (before making any changes, please make a backup copy of the mentioned files in the patch):


```php

diff --git a/app/controllers/frontend/checkout.php b/app/controllers/frontend/checkout.php

index 4d02909…2afd38a 100644

— a/app/controllers/frontend/checkout.php

+++ b/app/controllers/frontend/checkout.php

@@ -321,7 +321,10 @@

if (!empty($_REQUEST['update_steps'])) {

$_REQUEST['update_step'] = 'step_four';

  •   	fn_checkout_update_steps($cart, $auth, $_REQUEST);
  •   	list($status, $redirect_params) = fn_checkout_update_steps($cart, $auth, $_REQUEST);
  •   	if (!$status) {
  •   		return array(CONTROLLER_STATUS_REDIRECT, 'checkout.checkout?' . http_build_query($redirect_params));
  •   	}
    }
    $status = fn_checkout_place_order($cart, $auth, $_REQUEST);

@@ -336,7 +339,7 @@

if ($mode == 'update_steps') {

  •   $redirect_params = fn_checkout_update_steps($cart, $auth, $_REQUEST);
  •   list($status, $redirect_params) = fn_checkout_update_steps($cart, $auth, $_REQUEST);
    return array(CONTROLLER_STATUS_REDIRECT, 'checkout.checkout?' . http_build_query($redirect_params));

diff --git a/app/functions/fn.cart.php b/app/functions/fn.cart.php

index e95508e…ec9e855 100644

— a/app/functions/fn.cart.php

+++ b/app/functions/fn.cart.php

@@ -7510,7 +7510,7 @@ function fn_get_shipping_hash($product_groups)

  • @param array $cart Cart
  • @param array $auth Auth
  • @param array $params Params
    • @return array
    • @return array array(status, redirect_params)

      */

      function fn_checkout_update_steps(&$cart, &$auth, $params)

      {

      @@ -7603,7 +7603,7 @@ function fn_checkout_update_steps(&$cart, &$auth, $params)

      $redirect_params['guest_checkout'] = 1;

      }
  •   		return $redirect_params;
  •   		return array(false, $redirect_params);
    }
    }

@@ -7630,7 +7630,7 @@ function fn_checkout_update_steps(&$cart, &$auth, $params)

fn_set_notification('E', __('error'), __('vat_id_number_is_not_valid'));

$cart['user_data']['b_vat_id'] = '';

  •   		return $redirect_params;
  •   		return array(false, $redirect_params);
    }
    } elseif (isset($user_data['b_vat_id'])) {
    $user_data['b_vat_id'] = '';

@@ -7685,10 +7685,10 @@ function fn_checkout_update_steps(&$cart, &$auth, $params)

$redirect_params['edit_step'] = 'step_three';

  •   return $redirect_params;
  •   return array(false, $redirect_params);
    }
  • return $redirect_params;
  • return array(true, $redirect_params);

    }

    /**

    ```

It's just a DIFF file showing the changes that need to be made to the files



app/controllers/frontend/checkout.php

app/functions/fn.cart.php b/app/functions/fn.cart.php



The DIFF file compares two versions of the same file.



Lines with a - in front are from the old file

Lines with a + in front are from the new file



http://www.git-tower…ed-topics/diffs

OK thanks David.



I'm a bit confused as to why Helpdesk couldn't do this for me. Why are they asking me to “try” this? Either it works or it doesn't. I gave them FTP and cart backend access.



I'm not sure I understand your line:



[color=#282828][font=arial, verdana, tahoma, sans-serif]app/functions/fn.cart.php b/app/functions/fn.cart.php[/font][/color]



[color=#282828][font=arial, verdana, tahoma, sans-serif]What does that mean? [/font][/color]

[color=#282828][font=arial, verdana, tahoma, sans-serif]So to make this work I need to find a “diff” program that works on a Mac and then try to figure out how to use it to make these changes on my files?[/font][/color]

My bad. Cut and paste error:



They are asking you to make changes to these two files



[color=#282828][font=arial, verdana, tahoma, sans-serif]app/controllers/frontend/checkout.php[/font][/color]

[color=#282828][font=arial, verdana, tahoma, sans-serif]app/functions/fn.cart.php [/font][/color]

OK thanks.



Am I supposed to be able to just look at this code and know what changes to make where, or do I need special software?

Unfortunately cs-cart support assumes everyone has some sort of programming knowledge.



I agree, they should at least send you the updated files. But their standard approach is to fix bugs with DIFF files until the next update is released.



Best thing to do is use FTP to download the two files to your local computer. Use notepad to make the necessary changes and use FTP to re-upload to server.

You say this is their “standard approach,” but it's the FIRST time I've ever seen this from CS-Cart Helpdesk. I've been using CS-Cart since 2009 and in that time have lodged 97 tickets with their Helpdesk, and this is the FIRST time I have ever seen this.


[quote][color=#282828][font=arial, verdana, tahoma, sans-serif]Best thing to do is use FTP to download the two files to your local computer. Use notepad to make the necessary changes and use FTP to re-upload to server.[/quote][/font][/color]



[color=#282828][font=arial, verdana, tahoma, sans-serif]This is what I've always done in the past. However, from the code as given, I have no idea how to tell what goes where.[/font][/color]

If you have ssh access to your site, do:


$ cd /home/my_cpanel_user/public_html
$ cp [color=#282828][font=arial, verdana, tahoma, sans-serif]app/controllers/frontend/checkout.php [color=#282828][font=arial, verdana, tahoma, sans-serif]app/controllers/frontend/checkout.php.orig[/font][/color][/font][/color]
[color=#282828][font=arial, verdana, tahoma, sans-serif][color=#282828][font=arial, verdana, tahoma, sans-serif]$ cp [color=#282828][font=arial, verdana, tahoma, sans-serif]app/functions/fn.cart.php [color=#282828][font=arial, verdana, tahoma, sans-serif]app/functions/fn.cart.php.orig[/font][/color][/font][/color][/font][/color][/font][/color]
$ patch < diff_file_provided_by_helpdesk.txt




Surprised they don't have a 'patch' mode for the 'tools' controller so helpdesk and/or merchants could apply diff-based patches.

Thanks Tony. I'm sure it's possible to SSH into my site but once again, this is something I have never done and don't really know how to do. I publish and sell books. I'll have to ask Helpdesk to do this for me I guess.

Just ask them to apply the patch.

They figured out that Alt-Team's reCaptcha addon is causing this problem. I have disabled that addon and guest checkout now works fine.

[quote name='Triplets' timestamp='1436630992' post='222555']

Unfortunately cs-cart support assumes everyone has some sort of programming knowledge.



I agree, they should at least send you the updated files. But their standard approach is to fix bugs with DIFF files until the next update is released.



Best thing to do is use FTP to download the two files to your local computer. Use notepad to make the necessary changes and use FTP to re-upload to server.

[/quote]

[quote name='kingsleypress' timestamp='1436638988' post='222565']

You say this is their “standard approach,” but it's the FIRST time I've ever seen this from CS-Cart Helpdesk. I've been using CS-Cart since 2009 and in that time have lodged 97 tickets with their Helpdesk, and this is the FIRST time I have ever seen this.



[/font][/color]



[color=#282828][font=arial, verdana, tahoma, sans-serif]This is what I've always done in the past. However, from the code as given, I have no idea how to tell what goes where.[/font][/color]

[/quote]

I suppose the current case was related to the fact that they could not reproduce this problem on default CS-Cart installation. So they supposed that the problem is in 3rd party add-on/modification.



As for regular bugs, I'm agree that tech support should apply the fixes by themselves - so is you face such case in future please let me know.