s0laris Posted September 30, 2002 Share Posted September 30, 2002 I cannot seem to fix this problem. I get the following after pressing the continue button on checkout_payment.php: Fatal error: Cannot redeclare class order_total in /home/acb/htdocs/catalog/includes/classes/order_total.php on line 13 I did a grep -ir "class order_total" and only see one instance of it declared. I did install the creditclass system, but have tried it with and without it activated and get the same error.. Any Ideas? Link to comment Share on other sites More sharing options...
Ian Posted September 30, 2002 Share Posted September 30, 2002 Mike, The most common cause for this error is storing a code file in the languages direstory. The two most likely culprits are /includes/languages/english/classes/order_total.php /includes/languages/english/modules/order_total/ot_gv.php Trust me, I'm an Accountant. Link to comment Share on other sites More sharing options...
s0laris Posted September 30, 2002 Author Share Posted September 30, 2002 Hell O have the ot_gv.php as you mentioned in that dir but the order_total.php is in /catalog/includes/classes what should I do? Link to comment Share on other sites More sharing options...
Ian Posted September 30, 2002 Share Posted September 30, 2002 Sorry, ignore the classes/order_total.php Have you checked to see what the ot_gv.php file contains? Trust me, I'm an Accountant. Link to comment Share on other sites More sharing options...
s0laris Posted September 30, 2002 Author Share Posted September 30, 2002 That files just contains: <?php /* $Id: ot_gv.php,v 1.1 2002/08/17 10:45:25 wilt Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2002 osCommerce Released under the GNU General Public License */ define('MODULE_ORDER_TOTAL_GV_TITLE', 'Gift Vouchers'); define('MODULE_ORDER_TOTAL_GV_DESCRIPTION', 'Gift Vouchers'); define('SHIPPING_NOT_INCLUDED', ' [shipping not included]'); define('TAX_NOT_INCLUDED', ' [Tax not included]'); define('MODULE_ORDER_TOTAL_GV_USER_PROMPT', 'Tick to use Gift Voucher account balance -> '); ?> I dont know why it is complaining about the class redeclaration. I dod a grep -ir search for class order_total and only found it in one file. I am not a php expert and I know the error is legot or it wouldnt happen.. just not sure how to debug it Link to comment Share on other sites More sharing options...
Ian Posted September 30, 2002 Share Posted September 30, 2002 You could try doing a grep in the languages subdirectory for "application_top.php" Trust me, I'm an Accountant. Link to comment Share on other sites More sharing options...
s0laris Posted September 30, 2002 Author Share Posted September 30, 2002 Grep searches the contents of any all files for matching text. so I looked for the declaration of class order_total and only one file reported the class declaration. That is why I am perplexed as to it complaining that it has been declared already. Is there perhaps a PHP command that needs to release some memory that is not happening and thus when the order_total is called again it says the fatal error? Link to comment Share on other sites More sharing options...
s0laris Posted September 30, 2002 Author Share Posted September 30, 2002 Also, in a previous version of OSCOMMERCE/Gift Voucher, I was able to type in the email of a NEW person I wanted to send a voucher to, now it only provides a drop down list of existing customers.. Can I have it so I can send out to non registered emails again? Link to comment Share on other sites More sharing options...
Ian Posted September 30, 2002 Share Posted September 30, 2002 Mike cd /catalog/includes/languages/english grep -r application_top.php * I'll consider adding a manual email box to admin. Temporary workround Create a customer account for yourself. Use phpmyadmin to find the id for that account Use phpmyadmin to add an entry to the gv_customer account with the customer_id and a large amount. You can then go to your catalog page login for that customer and use the send to friend link in the gv box. Trust me, I'm an Accountant. Link to comment Share on other sites More sharing options...
s0laris Posted September 30, 2002 Author Share Posted September 30, 2002 I think I will reinstall it all over again from scratch and re install the creditclass.gift module system again :( I just dont have time to wait and try different things.. Link to comment Share on other sites More sharing options...
s0laris Posted October 1, 2002 Author Share Posted October 1, 2002 Ian I downloaded the most current 2.2 release, installed it I painstakengly added the creditclass 3.0 system and editied all the changes. I still get the same fatal error.. something has changed with the core system to cause this phenomena. Link to comment Share on other sites More sharing options...
Ian Posted October 1, 2002 Share Posted October 1, 2002 Mike, Sorry for the delay in answering, but I've been in conversation(email) with someone else having exactly the same problem. In the end he found that he had not edited checkout_confirmation.php properly. My changes to this file meant you had to comment out the original entry for the order_total class and then add that entry further up the code file. Obviously if you forget to comment out the original entry, you will then have two calls to iniatialise the order total class and hence the error. Is this a possibility with your setup? Trust me, I'm an Accountant. Link to comment Share on other sites More sharing options...
s0laris Posted October 1, 2002 Author Share Posted October 1, 2002 I commented out // require(DIR_WS_CLASSES . 'order_total.php'); // require(DIR_WS_CLASSES . 'order.php'); // $order = new order; // $order_total_modules = new order_total; this was after the ICW added code. Now it doesnt give me the error! BUT... if I pay 100% of the sale with gift voucher, it still goes to the paypal screen requesting pament.. ALmost there!! Link to comment Share on other sites More sharing options...
Ian Posted October 1, 2002 Share Posted October 1, 2002 First thing, Have you set include tax, include shipping in the admin->modules->order_total->gv If not then Gift Voucher will not be applied to full cost and there will be a balance to pay. Have you made appropriate changes to catalog/includes/classes/payment.php as per install files. Trust me, I'm an Accountant. Link to comment Share on other sites More sharing options...
s0laris Posted October 1, 2002 Author Share Posted October 1, 2002 Thanks I am sure it is one of those things. I do not have shipping or tax on my sales, so I will check that out. Thanks for all your help Ian. you are OsCommerce greatest asset! Link to comment Share on other sites More sharing options...
Ian Posted October 1, 2002 Share Posted October 1, 2002 I very much doubt that :crazy: Trust me, I'm an Accountant. Link to comment Share on other sites More sharing options...
Trusten Posted October 1, 2002 Share Posted October 1, 2002 same thing happened to me with the error. ok, this is what happened, i brought in an old database, and i did a fresh install, using that same database instead of the sampel one. It seemed to go fine, but i got that error, so what i did, was go back to the install folder, and UPGRADED. And what that did was actually change my database. I don't think the problem is in the code, I think the problem is in the database. Regardless of which, it worked perfectly after that. try that Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.