Specters Posted July 19, 2010 Posted July 19, 2010 Hi A few days ago I noticed several error messages were being delivered from my web store. I checked the back end and found this error message under UPS Module: Warning: constant() [function.constant]: Couldn't find constant UPSXML_Array in /home/content/s/p/e/specterstudios/html/store/catalog/includes/modules/shipping/upsxml.php on line 1016 I checked the server and the file is still present. This is the first time I have had a repetitive error like this. The store allows you to get to the checkout shipping screen but only refreshes when it reaches the shipping screen instead of moving to payment. Please does anyone have any suggestions? Thank you!
Jan Zonjee Posted July 19, 2010 Posted July 19, 2010 A few days ago I noticed several error messages were being delivered from my web store. I checked the back end and found this error message under UPS Module: Warning: constant() [function.constant]: Couldn't find constant UPSXML_Array in /home/content/s/p/e/specterstudios/html/store/catalog/includes/modules/shipping/upsxml.php on line 1016 This is what the readme.txt from the contribution mentions (line number is different, this is from 1.3.3. though): NOTE1: if you fail to do this step you will get the following error message when editing UPS XML in the admin: Warning: constant() [function.constant]: Couldn't find constant UPSXML_Array in /path/to/your/shop_root/includes/modules/shipping/upsxml.php on line 991 That error must have been there for a while. Although it doesn't have any relevance to errors on the catalog side....
Specters Posted July 19, 2010 Author Posted July 19, 2010 This is what the readme.txt from the contribution mentions (line number is different, this is from 1.3.3. though): NOTE1: if you fail to do this step you will get the following error message when editing UPS XML in the admin: Warning: constant() [function.constant]: Couldn't find constant UPSXML_Array in /path/to/your/shop_root/includes/modules/shipping/upsxml.php on line 991 That error must have been there for a while. Although it doesn't have any relevance to errors on the catalog side.... Thank you for replying. Jan I pretty much inherited this store. What does the readme.txt say to do to avoid this error?
Jan Zonjee Posted July 19, 2010 Posted July 19, 2010 What does the readme.txt say to do to avoid this error? It's about adding a few lines of code needed for the UPSXML (and a few other contributions): In catalog/admin/modules.php ***************************************** Find This code somewhere around line 48: ***************************************** if (tep_not_null($action)) { switch ($action) { case 'save': while (list($key, $value) = each($HTTP_POST_VARS['configuration'])) { *********************************************** INSERT THE FOLLOWING CODE AFTER THE ABOVE LINE: *********************************************** if (is_array($value) ) { $value = implode( ", ", $value); $value = ereg_replace (", --none--", "", $value); } **************************** SO IT SHOULD LOOK LIKE THIS: **************************** if (tep_not_null($action)) { switch ($action) { case 'save': while (list($key, $value) = each($HTTP_POST_VARS['configuration'])) { if (is_array($value) ) { $value = implode( ", ", $value); $value = ereg_replace (", --none--", "", $value); } tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $value . "' where configuration_key = '" . $key . "'"); } tep_redirect(tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $HTTP_GET_VARS['module'])); break; case 'install':
Specters Posted July 19, 2010 Author Posted July 19, 2010 It's about adding a few lines of code needed for the UPSXML (and a few other contributions): In catalog/admin/modules.php ***************************************** Find This code somewhere around line 48: ***************************************** if (tep_not_null($action)) { switch ($action) { case 'save': while (list($key, $value) = each($HTTP_POST_VARS['configuration'])) { *********************************************** INSERT THE FOLLOWING CODE AFTER THE ABOVE LINE: *********************************************** if (is_array($value) ) { $value = implode( ", ", $value); $value = ereg_replace (", --none--", "", $value); } **************************** SO IT SHOULD LOOK LIKE THIS: **************************** if (tep_not_null($action)) { switch ($action) { case 'save': while (list($key, $value) = each($HTTP_POST_VARS['configuration'])) { if (is_array($value) ) { $value = implode( ", ", $value); $value = ereg_replace (", --none--", "", $value); } tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $value . "' where configuration_key = '" . $key . "'"); } tep_redirect(tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $HTTP_GET_VARS['module'])); break; case 'install': I found the file and added the code and switched it out on the server. Oscommerce didn't blow up but the error is still present and it didn't seem to like the change and altered the environment of the admin screen to a very basic template. I just switched it back to the original file. Do you have any other suggestions? I'm not even sure which version of OScommerce I have it was installed in 2008 but some of the script says 2003.
Jan Zonjee Posted July 20, 2010 Posted July 20, 2010 I found the file and added the code and switched it out on the server. Oscommerce didn't blow up but the error is still present and it didn't seem to like the change and altered the environment of the admin screen to a very basic template. Just edit the UPSXML settings and save them once or twice. There is no bogus info in the database and needs to be refreshed by resaving the settings.
Specters Posted July 20, 2010 Author Posted July 20, 2010 Just edit the UPSXML settings and save them once or twice. There is no bogus info in the database and needs to be refreshed by resaving the settings. Hmm Question I thought I was suppose to edit the modules.php file. Is there additional code I should add to the UPSXML.php file to edit it? Thank you again for help!
Jan Zonjee Posted July 20, 2010 Posted July 20, 2010 Hmm Question I thought I was suppose to edit the modules.php file. Yes, you are. And no, I'm not talking about editing code, just changing some settings like removing shipping options to offer and then save.
Specters Posted July 20, 2010 Author Posted July 20, 2010 Yes, you are. And no, I'm not talking about editing code, just changing some settings like removing shipping options to offer and then save. I gave it another try and the new script was accepted! I also went into the admin screen under shipping and edited some of my choices and updated those choices. Although the error message has disappeared the website still won't allow me to get past the initial shipping screen. It refreshing the page when I choose continue: Is there anything else I can try? Once continue was clicked the screen use to proceed to shipping options and then to payment.
Jan Zonjee Posted July 20, 2010 Posted July 20, 2010 Is there anything else I can try? Once continue was clicked the screen use to proceed to shipping options and then to payment. Perhaps you now disabled all the shipping options that UPS offered on this shipment? Download the contribution, read the readme.txt and see how you can enable logging. Then you can see what your site sends to UPS and the reply of UPS. This error message is pretty much useless for debugging. UPS sends much more detailed error info (if there is indeed an error).
Specters Posted July 20, 2010 Author Posted July 20, 2010 Perhaps you now disabled all the shipping options that UPS offered on this shipment? Download the contribution, read the readme.txt and see how you can enable logging. Then you can see what your site sends to UPS and the reply of UPS. This error message is pretty much useless for debugging. UPS sends much more detailed error info (if there is indeed an error). Where can I download the contribution? I am unfamiliar with the setup of this website.
Jan Zonjee Posted July 20, 2010 Posted July 20, 2010 Where can I download the contribution? It's on our addon site.
wrightp01 Posted January 18, 2011 Posted January 18, 2011 Special note to Jan, Thanks for all the help you are providing for Ups installation and trouble shooting. I have been reading the suggestions you have made for others as I change from Os 2.2.1 to Os 2.3.1 and have found several solutions. Your service has not gone unnoticed.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.