HowTo: Solution to Errors when Configuring OsCommerce with PayPal or Upgrading OsCommerce to PHP5

configureA couple weeks ago I was in charge of configuring an OsCommerce account with PayPal Module. Unfortunately, when searching on the internet I came to find out that there wasn’t a lot of documentation on the web about this subject. So I had to spend a few more minutes trying to figure out some things that I wasn’t familiar with. Fortunately, I didn’t run into many problems, since I had configured OsCommerce a little while ago already, and I only had to take care of configuring PayPal.

However, there were a couple problems that  I noticed there wasn’t a lot of help documentation available online, so here I leave you a pretty short and specific post which I think is going to be very helpful for those who are looking to fix some problems while configuring their OsCommerce with Paypal or upgrading.

Problem:

Shipping Modules not showing up in OsCommerce Admin Module

Solution:

On the live server  login to the Admin page, and go to Tools > Server Info. Search for “DOCUMENT_ROOT” then copy and paste the value for that field into admin/configure.php and add the catalog directory onto the end of it, like this:

define(‘DIR_FS_CATALOG’, ‘/home2/www/public_html/catalog/’);

This fixed both the images folder issue and the modules issue. I have tested installing/removing modules and it’s all working ok.

Problem:

Error When Clicking on Customers in the OsCommerce Admin page.

Warning: array_merge() [function.array-merge]: Argument #1 is not an array in /home/xxxxxx/public_html/admin/customers.php on line 733

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/xxxxxx/public_html/admin/customers.php on line 733

Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/xxxxxx/public_html/admin/customers.php on line 735

Warning: reset() [function.reset]: Passed variable is not an array or object in /home/xxxxxx/public_html/admin/includes/classes/object_info.php on line 17

Warning: Variable passed to each() is not an array or object in /home/xxxxxx/public_html/admin/includes/classes/object_info.php on line 18

Solution:

This problem usually happens when you upgrade your OsCommerce site to PHP5 version.  So , if you are using PHP version 5, then this might be the answer.

Find these lines:

$customer_info = array_merge($country, $info, $reviews);

$cInfo_array = array_merge($customers, $customer_info);

and change them to:

$customer_info = array_merge((array)$country, (array)$info, (array)$reviews);

$cInfo_array = array_merge((array)$customers, (array)$customer_info);

I hope you find this short tutorial useful. When I run into this problems I wished I would have found a post like this, so here it is in a nutshell just for you. Until next time!

← Previous post

Next post →

3 Comments

  1. You have made a nice effort, strive to continue!

  2. I’ve finally gave up on OSCommerce. I tried it but was starting to be put off by its security issues, complex code & slow release cycles. As an alternative option, I tried Opencart & Magento but ended up using DLGuard (http://tinyurl.com/dlguardlearn) for its multiple payment processor support, security and automation. I put up a full review at sell eBooks and software online.

  3. Thanks for making my morning a little bit better with this great article!!

Leave a Reply

Load More