Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Array ( ) error displayed at last step of checkout_process.php


mglew

Recommended Posts

Hi,

 

I'm not sure how this has occurred. I've done a little error trapping, and have narrowed it down to catalog/includes/classes/order_total.php under process() - on the 3rd iteration of $GLOBALS[$class]->process()

 

The result is a blank screen with "Array ( ) " (without the quotes) displayed in the top left corner of the page.

 

I've tried Googling but can't find anything to do with the particular text...

 

Any ideas?

 

--

 

code with debug lines:

 

function process() {

printf("start ..."); //MG - bug occurs inside while loop after the 2nd iteration... Not sure what is happening...

$order_total_array = array();

if (is_array($this->modules)) {

reset($this->modules);

while (list(, $value) = each($this->modules)) {

printf("[a]"); //MG

$class = substr($value, 0, strrpos($value, '.'));

printf(""); //MG

if ($GLOBALS[$class]->enabled) {

printf("[c]"); //MG

$GLOBALS[$class]->output = array();

printf("[d]"); //MG

$GLOBALS[$class]->process();

printf("[e]"); //MG

for ($i=0, $n=sizeof($GLOBALS[$class]->output); $i<$n; $i++) {

 

and the output is:

 

start ...[a][c][d][e][a][c][d][e][a][c][d]Array ( ) [e][a][c][d][e][a][c][d][e][a][c][d][e][a][c][d][e]end of function process()

I guess this suggests that the process does not halt when it prints the Array ( ) text, but I guess determining why this text appears is my first step...

 

Mike

Link to comment
Share on other sites

I've also found that the catalog/orders_process.php is blocked from moving to catalog/orders_success.php for some reason. It gets to the tep_redirect(), and the contents of the command is pointing to the right place, it just doesn't redirect...

 

Any ideas?

 

Mike

Link to comment
Share on other sites

This is probably a broken Order Total module that is failing at the process stage. Have you added any new modules? If so, try removing that module and test again.

 

The redirect is failing because your test code outputs data, and the redirect can't happen after that occurs.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

No new modules have been added :( It was working previously... I've added a terms & conditions acceptance thing earlier in the process but not sure why that would cause this...

 

I'm a little stumped about where to go from here... I've put in place a text message and a click-here button to move the customers on from the error, but I want to sort out the cause of the error ideally...

Link to comment
Share on other sites

Ask your host if they have changed anything. An upgrade to the PHP version might have broken something that was previously working.

 

If not that, it could be that your Terms and Conditions addon is somehow conflicting. Try reverting to your backup files.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

That executes the process() method of the class. In this case the class is one of the order total modules. The modules are processed in the order of their sort order values, from lowest to highest. The error in the third pass indicates that it is the third module that is failing. You could try replacing that module with a clean copy, or disabling it if it is one you can get by without.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

It was a dodgy bit of code for the ot_tax.php module, put in by my (ex) developer for a voucher contribution she put in... Commented the extra code out, reran, no error... Fixed. I intend to replace the voucher functionality shortly, so thats fine.

 

Many thanks Jim. :)

 

Mike

Link to comment
Share on other sites

You're welcome. Bugs like this can be quite a challenge to find. I'm glad you found it, because I was running out of places to have you look.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...