Jump to content
Sign in to follow this  
devoknows

Couldn't find constant UPSXML_--none--

Recommended Posts

Hello,

 

I'm configuring an osCommerce install for a client, and he uses ups to ship -- only ups, and almost always ground, so he wanted me to disable all the other shipping methods. Should be no problem, as I have installed upsxml v 1.3.5 for him. However, whenever I select any of the shipping options (to remove them from consideration) and apply, osC pumps out the following error:

 

Warning: constant() [function.constant]: Couldn't find constant UPSXML_--none-- in /home/beerwine/public_html/store/includes/modules/shipping/upsxml.php on line 2171

 

So instead of using this method, I've disabled the undesired shipping methods by commenting them out in the store/languages/english/modules/shipping/upsxml.php file. So instead of the one error when I submit, I get a cascade of errors when I edit. Not the most elegant solution, but it'll do for now. However, if anyone has any advice as to why this is happening and what I can do to actually fix it instead of hacking around it, please let me know.

 

For reference, the install itself was seamless.

 

Thanks in advance,

Devo

Share this post


Link to post
Share on other sites
Warning: constant() [function.constant]: Couldn't find constant UPSXML_--none-- in /home/beerwine/public_html/store/includes/modules/shipping/upsxml.php on line 2171

Very, very strange because this is exactly coded not to happen in the function at the bottom outside of the class upsxml.php line 1010 about:

  function get_multioption_upsxml($values) {
	 if (tep_not_null($values)) {
		 $values_array = explode(',', $values);
		 foreach ($values_array as $key => $_method) {
		   if ($_method == '--none--') {
			 $method = $_method;
		   } else {
			 $method = constant('UPSXML_' . trim($_method));
		   }
		   $readable_values_array[] = $method;
		 }
		 $readable_values = implode(', ', $readable_values_array);
		 return $readable_values;
	 } else {
	   return '';
	 }
 }

There are only 1039 lines in that file so I don't see how you can get an error on line 2171 by the way.

 

This contribution has its own support thread in the General Contribution Support forum.

Share this post


Link to post
Share on other sites

SOLUTION. I just did an install of this module and ran into the same issue. The problem is that the code is expecting a definition for --none-- and there isnt any.

 

If you add this definition to the language file you will no longer get these warnings.

 

Goto: /includes/languages/english/modules/shipping/upsxml.php

Add: define('UPSXML_--none--', 'None');

 

Whalah...

Edited by befreestudios

Share this post


Link to post
Share on other sites

Burton, your solution - define('UPSXML_--none--', 'None');  WORKED!!!!! 

 

You are AWESOME!

 

Thanks!

 

Dianne

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×