Community Forums

Can anyone help please?

Bug reports here

Can anyone help please?

Postby websteer » Thu Mar 26, 2009 1: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
websteer
 
Posts: 16
Joined: Thu Mar 26, 2009 1:45 pm

Re: Can anyone help please?

Postby Daniel » Thu Mar 26, 2009 3: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
Daniel
Administrator
 
Posts: 5185
Joined: Fri Nov 03, 2006 10:57 am

Re: Can anyone help please?

Postby websteer » Fri Mar 27, 2009 2:07 pm

Hi Daniel
Thank you for the prompt reply...

Which code do I replace?

Thanks in advance.

David
websteer
 
Posts: 16
Joined: Thu Mar 26, 2009 1:45 pm

Re: Can anyone help please?

Postby phpuk » Fri Mar 27, 2009 2: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;
      }
   }         
}
phpuk
Global Moderator
 
Posts: 457
Joined: Wed Mar 25, 2009 2:57 am

Re: Can anyone help please?

Postby websteer » Fri Mar 27, 2009 6:44 pm

Thanks guys that is perfect. Great support.

O0
websteer
 
Posts: 16
Joined: Thu Mar 26, 2009 1:45 pm


Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 13 guests

Hosted by Arvixe Web Hosting