Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Couldn't find constant UPSXML_--none--


devoknows

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

Link to comment
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.

Link to comment
Share on other sites

  • 4 years later...

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
Link to comment
Share on other sites

  • 3 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...