Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Help with UPS module setup


cllondon

Recommended Posts

I am new to OSCommerce. I am running v2.2 RC2. My website is http://www.cllondon.ca. I took over from the previous webmaster and ran in to this mess.

 

I cannot configure the shipping module for the life of me! I have been going at it for the last 8 hours without any luck. I have setup a UPS account and got a UPS Rates Access Key as well.

 

Initially the issue was that the site was charging ridiculous amounts to ship items. So I uninstalled the UPS module and tried to re-install. By that I mean, I simply clicked "- remove" in the Admin > Modules > Shipping and then click "Install". I did not upload any files or install a new add-on etc.

 

Now when I enter all the information, i.e. UPS Rates Acess Key, Address, etc etc and click save I get this error:

 

Warning: constant(): Couldn't find constant UPSXML_Array in /home/4/d/0/6622/6622/public_html/catalog/includes/modules/shipping/upsxml.php on line 1017

 

As an ordinary customer when I login to my account add an item to cart and click checkout I get the following error at the top:

 

Warning: constant(): Couldn't find constant UPSXML_Array in /home/4/d/0/6622/6622/public_html/catalog/includes/modules/shipping/upsxml.php on line 983

Warning: constant(): Couldn't find constant UPSXML_Array in /home/4/d/0/6622/6622/public_html/catalog/includes/modules/shipping/upsxml.php on line 983

Warning: constant(): Couldn't find constant UPSXML_Array in /home/4/d/0/6622/6622/public_html/catalog/includes/modules/shipping/upsxml.php on line 983

Warning: constant(): Couldn't find constant UPSXML_Array in /home/4/d/0/6622/6622/public_html/catalog/includes/modules/shipping/upsxml.php on line 983

Warning: constant(): Couldn't find constant UPSXML_Array in /home/4/d/0/6622/6622/public_html/catalog/includes/modules/shipping/upsxml.php on line 983

 

I read on several forums that I need to read the "readme.txt" file to properly re-install the add-on and/or follow step 3. Well..... I tried, I really tried, but I cannot figure it out for the life of me.

Edited by Jan Zonjee
Link to comment
Share on other sites

I read on several forums that I need to read the "readme.txt" file to properly re-install the add-on and/or follow step 3. Well..... I tried, I really tried, but I cannot figure it out for the life of me.

Unbelievable. How hard is it to change in catalog/admin/modules.php:

if (tep_not_null($action)) {
switch ($action) {
  case 'save':
	while (list($key, $value) = each($HTTP_POST_VARS['configuration'])) {

to:

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);
		}

I would de-install and install again after that to get the database in order again though.

Link to comment
Share on other sites

  • 4 weeks later...

Stumbles in from Google...

 

 

....so I'm installing Google checkout, and a replace "Block A" with "Block B" in modules.php instruction has extra code in "Block A". I assume its from another add on I added on. I Googled $value = implode and found this, and all threads referred to shipping modules. Apparently I have done what Jan Zonjee recommends above as part of my USPS add on.

 

So I have:

    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;

And the instructions say:

 

Replace:

     case 'save':
       while (list($key, $value) = each($HTTP_POST_VARS['configuration'])) {
         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;

With:

     case 'save':
       // *** BEGIN GOOGLE CHECKOUT ***
       require(DIR_FS_CATALOG . 'googlecheckout/inserts/admin/modules2.php');
       // *** END GOOGLE CHECKOUT ***
       tep_redirect(tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $HTTP_GET_VARS['module']));
       break;

 

 

I am nervous what will happen if I do that, I don't want to lose the implode stuff, but googlecheckout/inserts/admin/modules2.php seems to include the extra code:

 

// fix configuration no saving -
reset($HTTP_POST_VARS['configuration']);
// end fix    
while (list($key, $value) = each($HTTP_POST_VARS['configuration'])) {
 // Checks if module is of type google checkout and also verfies if this configuration is 
 // for the check boxes for the shipping options           
 if (is_array($value)) {
   $value = implode(", ", $value);
   $value = ereg_replace (", --none--", "", $value);
 }
 // Change this query to use gc_makeSqlString()
 tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = " . gc_makeSqlString($value) . " where configuration_key = " . gc_makeSqlString($key));
}

 

 

So I should just do the replace as instructed and relax and it's all good.

 

Right? No really, I'm asking, right?

 

Thanks,

Walter

My experience relates to osCommerce Online Merchant v2.2 RC2

Link to comment
Share on other sites

I am nervous what will happen if I do that, I don't want to lose the implode stuff, but googlecheckout/inserts/admin/modules2.php seems to include the extra code:

 

So I should just do the replace as instructed and relax and it's all good.

 

Right?

I think you're right. It looks like the Google thing adds the code needed to zap the --none-- from getting inserted as some module like USPS, UPS Choice, and UPSXML are using/doing.

Edited by Jan Zonjee
Link to comment
Share on other sites

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...