Categories

Featured templates

osCommerce Warning: array_merge() error fix

Alex Ross September 27, 2011
Rating: 5.0/5. From 1 vote.
Please wait...

This tutorial will show you how to fix the following warning at your admin panel: Warning: array_merge()… It usually looks like:

1. First of all, you need to look at the file mentioned file in the warning message. As you can see in the example it is:

/home/mgreen/public_html/adrian/osc/admin/customers.php

Open the mentioned file and find the following text (there can be several lines with this text):

array_merge()

In the example file customers.php you will find the following code:

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

2. You need to update all the code with array_merge. Add (array) text before each of $ symbols. So, it should become:

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

You should do the same for all code with array_merge.

Note: The behaviour of array_merge() was modified in PHP 5. Unlike PHP 4, array_merge() now only accepts parameters of type array. However, you can use typecasting to merge other types.

3. Here is the list of files which should be edited in such cases:

  • /catalog/admin/
  • banner_manager.php
  • categories.php
  • configuration.php
  • customers.php
  • manufacturers.php
  • orders.php
  • orders_status.php
  • reviews.php
  • specials.php
  • /catalog/admin/includes/clases/
  • emails.php
  • /catalog/admin/includes/functions/
  • compatibility.php
  • general.php
  • /catalog/includes/clases/
  • emails.php
  • http_client.php
  • /catalog/includes/functions/
  • compatibility.php
  • /catalog/includes/modules/payment/
  • paypal_uk_direct.php
  • paypal_uk_express.php
This entry was posted in OsCommerce Tutorials and tagged array_merge(), osCommerce. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket