|
|
|
|
![]() ![]() |
Jan 1 2007, 03:45 AM
Post
#1
|
|
|
Premium Member Group: Members Posts: 330 Joined: 2-February 06 Member No.: 11,040 |
I don't know where this topic is appropriate in so please move it if it's innapropriate for this place as this involves PHP and OSCommerce
Hi, I got an error stating the following: Warning: reset(): Passed variable is not an array or object in /home/content/j/w/s/jws8118/html/catalog/admin/includes/classes/object_info.php on line 17 Warning: Variable passed to each() is not an array or object in /home/content/j/w/s/jws8118/html/catalog/admin/includes/classes/object_info.php on line 18 Here's the source code: CODE <?php /* $Id: object_info.php,v 1.6 2003/06/20 16:23:08 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ class objectInfo { // class constructor function objectInfo($object_array) { reset($object_array); while (list($key, $value) = each($object_array)) { $this->$key = tep_db_prepare_input($value); } } } ?> More problems are that my client can't add products to his cart. He also cannot upload any new products to the categories. I'm asking the PHP programmers who have experience with OS Commerce and also those who know this to please help me with this problem. My client needs this problem fixed as soon as possible. I need solutions ASAP. Thank you. |
|
|
|
Jan 1 2007, 12:52 PM
Post
#2
|
|
|
The Modernator Group: Members Posts: 486 Joined: 6-August 06 From: The Interweb! Member No.: 15,021 |
Hmm i dont use OScommerce ...I use Vurtua mart ...i found it much better and much better to hack it for your needs and a lot of support on thier forums..
Have you tried the Os forums? Maybe try to backup the mysql db then remove Os commerce then reinstall with default values then replace the old db back in? that may work |
|
|
|
Jan 3 2007, 01:15 PM
Post
#3
|
|
|
Premium Member Group: Members Posts: 250 Joined: 6-July 06 From: The net (or at least that's what my family says) Member No.: 14,330 |
I have done a number of OSC sites myself, but my programming knowledge is weak.
Have you posted this on the OSC forum, or done a search for the error message on that forum. Just as a side note ... I have started using Zen Cart for my E-Commerce projects. It is based on OSC, but to compare, it's like OSC on steroids. |
|
|
|
Jan 8 2007, 04:00 AM
Post
#4
|
|
|
PESTICIDAL MANIAC Group: Members Posts: 626 Joined: 1-September 04 From: Auckland, New Zealand Member No.: 27 |
This may not be the right way to go about it as I don't know what information is being passed to this class, but you could do:
CODE class objectInfo { function objectInfo($object_array) { $object_array = is_array($object_array) ? $object_array : array($object_array); reset($object_array); while(list($key, $value) = each($object_array)) { $this->$key = tep_db_prepare_input($value); } } } That will just insure that $object_array is an array, so that these methods that expect arrays can still continue without any warnings, however, they're just warnings and can usually be ignored, you just have to make sure that your error_reporting doesn't display them. Cheers, MC |
|
|
|
Jan 9 2007, 04:52 PM
Post
#5
|
|
|
Premium Member Group: Members Posts: 330 Joined: 2-February 06 Member No.: 11,040 |
Thanks for the help. But we found out that it was because of the settings of the domain. The main domain's path had to be rerouted to the root folder.
|
|
|
|
Jun 2 2008, 08:22 AM
Post
#6
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 0 Joined: 1-November 07 Member No.: 25,869 |
Replying to demolaynyc
Hey! I have exactly the same problem... Can you please tell me more about this server setting and how to fix it up? 10x in advance! -reply by Sergey |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 13th October 2008 - 03:51 PM |