Zen Cart Logo
Forums / All Other Contributions/Addons / Stock By Attributes V4.4

Stock By Attributes V4.4

Locked

Views: 1,727

Results 1 to 15 of 15
This thread is locked. New replies are disabled.
18 May 2007, 4:58 PM
#1
asterix avatar

asterix

Zen Follower

Join Date:
Aug 2005
Posts:
168
Plugin Contributions:
0

Stock By Attributes V4.4

Once an item is in my cart (latest Zen version) and click on checkout, I get the following error:

Fatal error: Cannot redeclare class order in /home/simpatix/public_html/store/includes/classes/order.php on line 20

Can anyone help?

Thannks a bunch!!! :)

19 May 2007, 1:28 AM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Stock By Attributes V4.4

Sounds like something is calling the orders class twice ...

Do you have any add-ons or changes to your site that might account for this?

21 May 2007, 4:48 PM
#3
asterix avatar

asterix

Zen Follower

Join Date:
Aug 2005
Posts:
168
Plugin Contributions:
0

Re: Stock By Attributes V4.4

I have a captcha mod, Paul's v.1.3.7, that's it.

How can I fix it?

Thanks for taking the time to respond. ;)

22 May 2007, 1:42 PM
#4
asterix avatar

asterix

Zen Follower

Join Date:
Aug 2005
Posts:
168
Plugin Contributions:
0

Re: Stock By Attributes V4.4

I restored all the files updated by this mod and tried to check out and it worked so the problem is caused by that mod (no offense intended).

I still get:
Fatal error: Cannot redeclare class order in /home/simpatix/public_html/store/includes/classes/order.php on line 20

Can anyone help??? :)

When I import the SQL file, I get the following error too:

##CODE##
Error
SQL query:

INSERT INTO configuration( configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function )
VALUES (

'Show stock when low', 'STOCK_SHOW_LOW_IN_CART', 'false', 'When customer places more items in cart than are available, show the available amount on the shopping cart page:', '9', '6', NULL , now( ) , NULL , "zen_cfg_select_option(array('true', 'false'),"
);

MySQL said:

#1062 - Duplicate entry 'STOCK_SHOW_LOW_IN_CART' for key 2
##CODE##

23 May 2007, 1:23 PM
#5
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Stock By Attributes V4.4

asterix:

I restored all the files updated by this mod and tried to check out and it worked so the problem is caused by that mod (no offense intended).None taken, since the problems are unlikely to be with the mod, but with the way in which it's being implemented here. :laugh:
Have you by chance "backed up" your old order.php file in the classes directory, before putting the stock by attributes version in there. If so, this would explain why the class gets defined twice - you would need to store your backup somewhere else so that it doesn't get used accidentally.

The SQL error is because you have installed stock by attributes before, so the switches are already in your database - no need to put them in again, indeed the configuration table structure won't let you.

23 May 2007, 1:28 PM
#6
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: Stock By Attributes V4.4

you can also name the orders.php file thats been backed up to
orders.phpOLD and it will not load accidently

23 May 2007, 4:32 PM
#7
asterix avatar

asterix

Zen Follower

Join Date:
Aug 2005
Posts:
168
Plugin Contributions:
0

Re: Stock By Attributes V4.4

Thank you so much for the responses. :)

All the original files were renamed "...OLD.php" so I renamed "ordersOLD.php" "orders.phpOLD" but the problem remains.

We're talking about "admin/orders.php", right?

Here's the URL of the one item that has an attribute set up:
http://www.simpaticohamptons.com/store/index.php?main_page=product_info&products_id=18&zenid=afdfdf8ae8e2bf92d3b3b32427bca2a7

What do you think?

23 May 2007, 4:50 PM
#8
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Stock By Attributes V4.4

asterix:

We're talking about "admin/orders.php", right?No. We're talking about the "includes/classes/order.php" file referenced in your fatal error message.

23 May 2007, 4:54 PM
#9
asterix avatar

asterix

Zen Follower

Join Date:
Aug 2005
Posts:
168
Plugin Contributions:
0

Re: Stock By Attributes V4.4

I'm so sorry but I removed the old "order.php" file (renamed "order.phpOLD" after your last post) and I still get that error...

You can try for yourself. What could it be then?

23 May 2007, 5:01 PM
#10
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Stock By Attributes V4.4

Yes, but it's still in the classes directory and available for inclusion. I know that many senior Zen Cart users advise keeping renamed backups close to their original location. Personally, I'd always recommend against it (based on having started my career in software maintenance and having solved far, far too many problems where users have accidentally doubled up on stylesheets, classes, module, classes, etc.)

IMO you siute should contain only files that are actually in use, anything else is a potential problem, or a confusion when you're making changes. Indeed I don't back up original files at all, as I can always go back to the original Zen Cart release package to get them if I need them.

23 May 2007, 7:11 PM
#11
asterix avatar

asterix

Zen Follower

Join Date:
Aug 2005
Posts:
168
Plugin Contributions:
0

Re: Stock By Attributes V4.4

Currently, the only order.php file in the /includes/classes/ folder is the one from your mod so I don't understand what you mean...

What should I do?

24 May 2007, 12:51 PM
#12
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Stock By Attributes V4.4

Go to Admin > Tools > Developers Tool Kit

Find "Look-up Classes or things in Classes files"

In the box immediately below it, enter> class order extends basethen select "All classes files - Catalog" from the drop down menu and click on the search button at the end of the row.

What result does that give you?

24 May 2007, 1:02 PM
#13
asterix avatar

asterix

Zen Follower

Join Date:
Aug 2005
Posts:
168
Plugin Contributions:
0

Re: Stock By Attributes V4.4

###CODE###
Searching 42 files ... for: class order extends base

.../store/includes/classes/order.php

Line #19 : class order extends base {

Match Lines found: 1
###CODE###

Does that help?

24 May 2007, 1:11 PM
#14
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Stock By Attributes V4.4

It deepens the puzzle. I'm surprised that it found 42 files there, that's a lot more than in a clean install of Zen Cart, but it hasn't found the 2nd instantiation of that class so we'll need to widen our search.

Please try the same search but in the bottom set of boxes i.e. "Look-up in all files" and select "All files - Catalog/Admin" ... we'll throw everything into this one.

24 May 2007, 1:38 PM
#15
asterix avatar

asterix

Zen Follower

Join Date:
Aug 2005
Posts:
168
Plugin Contributions:
0

Re: Stock By Attributes V4.4

Same result but with 903 results.

Keep in mind that I have the Captcha mod installed.

The strange part is that the cart worked when I removed all the SBA 4.4 files...