Post by websteer » Thu Mar 26, 2009 9:54 pm

Hi all I am new to this software. Got it install version 1. something everything is fine apart from when a new customer goes to logh in the following error is presented:

Code: Select all

Notice: unserialize() [function.unserialize]: Argument is not a string in /var/www/vhosts/mywebsite.co.uk/httpdocs/system/library/customer.php on line 66

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/mywebsite.co.uk/httpdocs/system/library/customer.php:66) in /var/www/vhosts/mywebsite.co.uk/httpdocs/system/engine/controller.php on line 23
Can someone please advise?

Thank you in advance!

David

Newbie

Posts

Joined
Thu Mar 26, 2009 9:45 pm

Post by Daniel » Thu Mar 26, 2009 11:53 pm

replace the code with this:

Code: Select all


			if (($query->row['cart']) && (is_string($query->row['cart']))) {
				$cart = unserialize($query->row['cart']);
				
				foreach ($cart as $key => $value) {
					if (!array_key_exists($key, $this->session->data['cart'])) {
						$this->session->data['cart'][$key] = $value;
					} else {
						$this->session->data['cart'][$key] += $value;
					}
				}			
			}
I'm going to include this in the next version.

User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by websteer » Fri Mar 27, 2009 10:07 pm

Hi Daniel
Thank you for the prompt reply...

Which code do I replace?

Thanks in advance.

David

Newbie

Posts

Joined
Thu Mar 26, 2009 9:45 pm

Post by phpuk » Fri Mar 27, 2009 10:45 pm

Hi,

I believe the code you need to change is system/library/customer.php on line 66

Change it from:

Code: Select all

			
foreach ((array)@unserialize($query->row['cart']) as $key => $value) {
	if (!array_key_exists($key, $this->session->data['cart'])) {
		$this->session->data['cart'][$key] = $value;
	} else {
		$this->session->data['cart'][$key] += $value;
	}
}
to:

Code: Select all

if (($query->row['cart']) && (is_string($query->row['cart']))) {
	$cart = unserialize($query->row['cart']);
	foreach ($cart as $key => $value) {
		if (!array_key_exists($key, $this->session->data['cart'])) {
			$this->session->data['cart'][$key] = $value;
		} else {
			$this->session->data['cart'][$key] += $value;
		}
	}         
}

Global Moderator

Posts

Joined
Wed Mar 25, 2009 10:57 am

Post by websteer » Sat Mar 28, 2009 2:44 am

Thanks guys that is perfect. Great support.

O0

Newbie

Posts

Joined
Thu Mar 26, 2009 9:45 pm
Who is online

Users browsing this forum: No registered users and 3 guests