Knowledgebase: One Page Checkout
I'm receiving this error on the checkout page: "There was an error loading the shipping options, please try again. (You may need to refresh your browser.)"
Posted by Nick Poindexter on 04 March 2010 05:19 PM
This error is generally caused by either a PHP headers error, a cannot redeclare a function error, a PHP file containing whitespace or lines after the final ?>, or an installation error.


Go to admin/logs.php and view the PHP errors that occurred during the testing of the one page checkout. If using X-Cart 4.0.x you will need to view the x-errors_php.txt file in the /log directory on your server.

If you see any of the following errors make the listed changes.


1. Fatal error: Cannot redeclare sort_shipping()

Make the following edit:

shipping/shipping.php

Find the code near line 39:

x_load('cart');


After add:

function sort_shipping($a, $b) {
return $a["rate"] - $b["rate"];
}


Find this code near line 273 and DELETE it:

function sort_shipping($a, $b) {
return $a["rate"] - $b["rate"];
}




2. Warning: Cannot modify header information - headers already sent...

Please copy then entire error message into the knowledgebase search engine to view any matching articles: http://www.alteredcart.com/support.php?section=knowledgebase




No errors listed

If there aren't any errors listed related to the One Page Checkout you will need to check the PHP files that were edited during the installation and make sure there aren't any spaces or lines after the final ?>. You might also need to upload your .php files using binary mode if this problem occurs again. The source of the problem is likely one of the following files (but can be caused by others):

/init.php

and

/modules/Checkout_One/checkout_one_init.php

This is a conflict between Windows and Linux line breaks. Your FTP client will upload the file in ASCII mode and add double line breaks to the file.

For more information on finding this extra whitespace see this article.




One other cause can be missing this installation step to the /init.php file (this is a step from the original installation instructions):


Find this code near line 595:

$smarty->assign_by_ref("active_modules", $active_modules);


Immediately BEFORE insert this code:

// Checkout One :: www.alteredcart.com //
if ($active_modules['Checkout_One'])
include $xcart_dir."/modules/Checkout_One/checkout_one_init.php";
// End Checkout One //

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments: