Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

New UPS XML Shipping Module available


Recommended Posts

Hey Corinne,

 

I was looking at your site and you have your whole catalog running SSL. You really only want the customer and checkout pages running in SSL. I guess it's not a big deal to leave it this way since your site seems to run pretty quickly but I thought I would mention it.

 

Hi again, John,

Our site is actually divided up into two parts. We have a normal HTML part and then we have the osCommerce cart. The way our ISP has things set up, its just much easier to put the whole cart onto the SSL cert. It doesn't seem like there are any problems with it. I think it just means the whole thing is secure. Thanks for the input, though.

 

Corinne

Link to comment
Share on other sites

Sorry, I didn't look through every post of this thread but is there a way to remove certain UPS options. We do not offer some like Next Day Air AM delivery, 3 day select, etc.

 

How do I turn these off?

In your admin you go to modules, then shipping, click on the round i button at the end of the line that says "United Parcel Service (XML)", click on the Edit button, scroll-down the page using the widget on the right side of the screen, or the arrow button in the right-hand lower corner and find the part that says (almost at the bottom of the page):
Disallowed Shipping Methods

Select the UPS services not to be offered.

Now with your mouse, you click in the square boxes before the shipping methods you do not want to offer. Then you scroll down even further, cllick the update button and voila, you accomplished removing certain UPS Options.
Link to comment
Share on other sites

Will this code (or something like it) work?

			  if (tep_db_num_rows($attribute_weight_query)) {
			 while ($attributes_weight_array = tep_db_fetch_array($attribute_weight_query)) { 
			$attributes_total_weight +=  $attributes_weight_array['options_values_weight'] - $products_weight;

Am I at least on the right track?

That part looks OK to me although I can't fathom why you would put the total product weight in the attribute instead of just the difference in weight. I guess you had your reasons.
Link to comment
Share on other sites

That part looks OK to me although I can't fathom why you would put the total product weight in the attribute instead of just the difference in weight. I guess you had your reasons.

 

Hi Jan,

The reason we did it that way is because the weight and packaging of our products varies so much that its easier for us just to put in the total shipping weight than try and figure out how much we have to add to each one.

 

Anyway, it didn't work. I KNOW that we need to subtract the original product weight, but I don't know how. Here's the whole "get_products" function again. Maybe I defined "$products_weight" in the wrong place, but I did it the same way the "function caclulate()" has it.

 

	function get_products() {
  global $languages_id;

  if (!is_array($this->contents)) return false;
//BOF Price Break Module
  $pf = new PriceFormatter;
//EOF Price Break Module

  $products_array = array();
  reset($this->contents);
  while (list($products_id, ) = each($this->contents)) {
//BOF Price Break Module
	if ($products = $pf->loadProduct($products_id, $languages_id)) {
	  $products_price = $pf->computePrice($this->contents[$products_id]['qty']);
//EOF Price Break Module
	  $products_weight = $product['products_weight'];  //UPS XML

//BOF phpmom.com advanced attribute price //hadir
	  $attributes_price = 0;

	  if (isset($this->contents[$products_id]['attributes'])) {
		reset($this->contents[$products_id]['attributes']);
		while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {
		  $attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'");
		  $attribute_price = tep_db_fetch_array($attribute_price_query);
		  if ($attribute_price['price_prefix'] == '') {
			$attributes_price += ($attribute_price['options_values_price']-$products_price);
		  } elseif ($attribute_price['price_prefix'] == '+') {
			$attributes_price += $attribute_price['options_values_price'];
		  } elseif ($attribute_price['price_prefix'] == '-') {
		   $attributes_price -= $attribute_price['options_values_price'];
		  }
		}
	  }
//EOF phpmom.com advanced attribute price//hadir 

// BOF: UPS XML Rates & Services ? Attributes Fix
// determine total weight of attributes to add to weight of product					
	  $attributes_total_weight = 0;
	  if (isset($this->contents[$products_id]['attributes'])) {
		  reset($this->contents[$products_id]['attributes']);
		  $where = ' AND ((';
		  while (list($option, $value) = each($this->contents[$products_id]['attributes'])) {
			 $where .= 'options_id=' . $option . ' AND options_values_id=' . $value . ') OR (';
		  }
		  $where=substr($where, 0, -5) . ')';
		  $attribute_weight_query = tep_db_query('SELECT options_values_weight FROM ' . TABLE_PRODUCTS_ATTRIBUTES . ' WHERE products_id=' . (int)$products_id . $where);
		  if (tep_db_num_rows($attribute_weight_query)) {
			 while ($attributes_weight_array = tep_db_fetch_array($attribute_weight_query)) { 
			$attributes_total_weight +=  $attributes_weight_array['options_values_weight']-$products_weight;
			 }
		  } // end if (tep_db_num_rows($attribute_weight_query))
	  } // end if (isset($this->contents[$products_id]['attributes']))
// EOF: UPS XML Rates & Services ? Attributes Fix

	  $products_array[] = array('id' => $products_id,
								'name' => $products['products_name'],
								'model' => $products['products_model'],
								'image' => $products['products_image'],
								'price' => $products_price,
								'quantity' => $this->contents[$products_id]['qty'],
// BOF: UPS XML Rates & Services ? Attributes Fix
								'weight' => $products['products_weight'] + $attributes_total_weight,
// EOF: UPS XML Rates & Services ? Attributes Fix
// BOF: UPS XML Rates & Services
								'length' => $products['products_length'],
								'width' => $products['products_width'],
								'height' => $products['products_height'],
								'ready_to_ship' => $products['products_ready_to_ship'],
// EOF: UPS XML Rates & Services
								'final_price' => ($products_price + $attributes_price),
//BOF phpmom.com advanced attribute price
								'attributes_price' => $attributes_price,
//EOF phpmom.com advanced attribute price
								'tax_class_id' => $products['products_tax_class_id'],
								'attributes' => (isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : ''));
	}
  }

  return $products_array;
}

 

Maybe my syntax is off. Do I need parentheses around the

Thanks again for your help.

Corinne

Link to comment
Share on other sites

Anyway, it didn't work.

That is because of $product['products_weight'] should have been $products['products_weight'] here:

//EOF Price Break Module
	  $products_weight = $product['products_weight'];  //UPS XML

Of course you could have used that here:

				$attributes_total_weight +=  $attributes_weight_array['options_values_weight']-$products_weight;

instead of using a new variable. So:

				$attributes_total_weight +=  $attributes_weight_array['options_values_weight']-$products['products_weight'];

Link to comment
Share on other sites

Any suggestions?
Better do not use exec(), it really is a last resort. Using exec=0 will give more meaningfull error message from cURL. It often is the, I think, 60 error. In that case look in the module itself for instructions how to remedy that (uncommenting a few lines). Certain ISV's (GoDaddy is one) use a proxy for cURL. You need instructions for that how to setup UPSXML in that case. For GoDaddy it is in this thread I believe.
Link to comment
Share on other sites

has anyone found anything new out about my problem?
You haven't given any new information so how should anyone find out more? My crystal ball has a crack in it so it is with the glass blower :)

 

My best guess is you are feeding the UPSXML module the 10,000 cards as one product weighing 32 pounds. That wouldn't work the way you want it.

Link to comment
Share on other sites

You haven't given any new information so how should anyone find out more? My crystal ball has a crack in it so it is with the glass blower :)

 

My best guess is you are feeding the UPSXML module the 10,000 cards as one product weighing 32 pounds. That wouldn't work the way you want it.

ive answered all questions you have asked me, how do i not make it have 32 lbs then? suggestions?

Link to comment
Share on other sites

That is because of $product['products_weight'] should have been $products['products_weight'] here:

//EOF Price Break Module
	  $products_weight = $product['products_weight'];  //UPS XML

Of course you could have used that here:

				$attributes_total_weight +=  $attributes_weight_array['options_values_weight']-$products_weight;

instead of using a new variable. So:

				$attributes_total_weight +=  $attributes_weight_array['options_values_weight']-$products['products_weight'];

 

 

Jan, you are amazing at this! It worked! The correct weight is now shown! Yea!

 

BUT....there is now another problem. I guess this is what you call debugging.

 

The UPS quotes are off for the products that are ready-to-ship AND from the pulldown menu. Its quoting significantly high. I did several orders and it was averaging about $15.00 too much (not always the same amount off). In my tests, the rates were dead on for regular items and for items from a pulldown menu. Any thoughts?

 

By the way, the e-mail error messages have stopped. Maybe these kinds of cURL and transit errors are just symptoms of other errors and not indications of independent cURL and transit errors. FYI, they looked like this:

Error from cURL: Error [6]: Couldn't resolve host 'www.ups.com'
experienced by customer with id 2 on 2006-08-07 14:04:24

UPSXML TimeInTransit Error: :  experienced by customer with id 2 on
2006-08-07 14:04:24

 

Corinne

Link to comment
Share on other sites

ive answered all questions you have asked me, how do i not make it have 32 lbs then?
You tried but in one of the posts the output was truncated because you didn't use code blocks [ code ] [ /code ] (without the spaces) around it. So I don't know for sure that you are feeding the shipping modules with a product of 32 pounds. You don't seem to want to tell us that but you still want people here to solve your problem.

 

I don't know what other products you have, why you chose for dimension support (if you don't use it and set your max box weight to 16 with the tarra settings to zero, see admin section, the standard osC code will split it in two boxes of 16 lbs) etc. so pretty hard to advise you something isn't it.

Link to comment
Share on other sites

The UPS quotes are off for the products that are ready-to-ship AND from the pulldown menu. Its quoting significantly high. I did several orders and it was averaging about $15.00 too much (not always the same amount off). In my tests, the rates were dead on for regular items and for items from a pulldown menu. Any thoughts?
Better enable logging (see top of the upsxml.php shipping file around line 88 for instructions, best is to use a full path in my opinion). Then you know what is actually sent to UPS (how many boxes, weight). Any items that are not ready-to-ship are given the osC standard treatment: tare is added according to your admin settings.

 

By the way, the e-mail error messages have stopped. Maybe these kinds of cURL and transit errors are just symptoms of other errors and not indications of independent cURL and transit errors. FYI, they looked like this:

Error from cURL: Error [6]: Couldn't resolve host 'www.ups.com'
experienced by customer with id 2 on 2006-08-07 14:04:24

UPSXML TimeInTransit Error: :  experienced by customer with id 2 on
2006-08-07 14:04:24

No clue. The strange thing is of course that cURL cannot resolve www.ups.com for the TimeInTransit but fractions of a second later it is no problem when querying the same server for rates...
Link to comment
Share on other sites

Better enable logging (see top of the upsxml.php shipping file around line 88 for instructions, best is to use a full path in my opinion). Then you know what is actually sent to UPS (how many boxes, weight). Any items that are not ready-to-ship are given the osC standard treatment: tare is added according to your admin settings.

 

Hey, Jan!

The logging really helped. It turns out that the problem was a combination of a couple of things. First, the cases of cassette albums are oversized and I didn't think they were (My bad!). That accounted for about $10.00 of the extra $15.00.

 

The second thing I'm not sure if its a bug or just how the module is supposed to work. I had checked the box for insurance, which means that there will be extra charges for this. The order was about $106.00, so the insurance charge should have been $1.50. For whatever reason, when UPS sends back the info, it is charging $1.50 PER BOX and not $1.50 for the entire order. Is this fixable? Its nice to have a little cushion on the shipping charges, but I still would like to be as accurate as possible on our quotes.

 

Thanks again for your continued help! :thumbsup:

Corinne

Link to comment
Share on other sites

Corinne,

The second thing I'm not sure if its a bug or just how the module is supposed to work. I had checked the box for insurance, which means that there will be extra charges for this. The order was about $106.00, so the insurance charge should have been $1.50. For whatever reason, when UPS sends back the info, it is charging $1.50 PER BOX and not $1.50 for the entire order. Is this fixable? Its nice to have a little cushion on the shipping charges, but I still would like to be as accurate as possible on our quotes.
Hmm, the insurance fix (I didn't do that ! ) was not such a good fix after all. I always was puzzled why every box would get as an associated value the value of the total order, but I assumed that was the way it was supposed to be. Apparently not.

 

Indeed the UPS documentation for developers states for that value (Shipment/Package/PackageServiceOptions/InsuredValue/MonetaryValue):

The monetary value for the declared value amount associated with the package. Max value of 50,000.00 USD.

 

A rough quick fix (haven't tried it though) would be to divide the $this->pkgvalue on line 707 by $this->items_qty like this:

<MonetaryValue>". number_format(($this->pkgvalue/$this->items_qty), 2, '.', '')."</MonetaryValue>\n".

Of course with a ready-to-ship item this is inaccurate, so the code should be changed to keep track of the value added to the boxes too. That will take some time I'm afraid but not un-doable I believe.

Link to comment
Share on other sites

I wanted to know what the major differances are between this UPS XML and the standard UPS mod?
Not so much really. The standard UPS mod has less features but you might not want to use those features anyway. What I heard over the years is that UPS XML tends to give more accurate rates than the standard UPS module. You can install them both and compare the rates so you can see for yourself.

 

UPS seems to have said that the API that the standard UPS mod uses would be taken down in time, but so far it has never happened and I have never seen any further announcements as when this would happen. You could ask UPS what they prefer you use.

Link to comment
Share on other sites

Ok. How hard is it to add this mod to your store?

 

If I install I should use : UPS XML Rates and Services v1.2.3

also this: UPS XML InsuredValue MonetaryValue Add-on

?

 

Does it use your acount to get rates ? So if you ship more lower rates?

 

Thanks

Link to comment
Share on other sites

Ok. How hard is it to add this mod to your store?
IMO not hard at all. One sql change and adding one or two functions and then you can upload files and change the things in admin as far as I can recollect.

 

If I install I should use : UPS XML Rates and Services v1.2.3

also this: UPS XML InsuredValue MonetaryValue Add-on?

Well, the contributor should have added it to the file and uploaded the new package as UPS v. 1.2.4 :)

 

Looks good to me. Haven't seen that before.

Does it use your acount to get rates ? So if you ship more lower rates?
That is not clear. You would think so because it needs an account and two passwords (regular and developer key) but somewhere in this thread is someone who told us that the rates returned were not the discounted ones of his company. So I'm not sure.
Link to comment
Share on other sites

tried doing a search within this topic but couldnt find the answers to these.

how do i go about removing everything after United Parcel Service in the Delivery Information page? Better yet, can i just replace this whole line with UPS?

 

United Parcel Service (XML) (1 pkg x 1 lbs total) United Parcel Service (XML)

 

when you get to the confirmation page under shipping and billing method it shows:

 

United Parcel Service (XML) (1 pkg x 1 lbs total) (UPS Ground):

 

how do i just keep United Parcel Service (UPS Ground). basically i want to remove the # of package and total weight if possible. Thanks in advance for any help.

Link to comment
Share on other sites

tried doing a search within this topic but couldnt find the answers to these.
It has come up, but I agree that it might be difficult to find.
how do i go about removing everything after United Parcel Service in the Delivery Information page? Better yet, can i just replace this whole line with UPS?

 

United Parcel Service (XML) (1 pkg x 1 lbs total) United Parcel Service (XML)

 

when you get to the confirmation page under shipping and billing method it shows:

 

United Parcel Service (XML) (1 pkg x 1 lbs total) (UPS Ground):

 

how do i just keep United Parcel Service (UPS Ground). basically i want to remove the # of package and total weight if possible.

Edit this piece of code around line 300 in /modules/shipping/upsxml.php:

		$upsQuote = $this->_upsGetQuote();
	if ((is_array($upsQuote)) && (sizeof($upsQuote) > 0)) {
		if ($this->dimensions_support > 0) {
			$this->quotes = array('id' => $this->code, 'module' => $this->title . ' (' . $this->boxCount . ($this->boxCount > 1 ? ' pkg(s), ' : ' pkg, ') . round($totalWeight,0) . ' ' . strtolower($this->unit_weight) . ' total)');
		} else {
			$this->quotes = array('id' => $this->code, 'module' => $this->title . ' (' . $shipping_num_boxes . ($this->boxCount > 1 ? ' pkg(s) x ' : ' pkg x ') . round($shipping_weight,0) . ' ' . strtolower($this->unit_weight) . ' total)');
		}

the $this->title is United Parcel Service (XML)

Link to comment
Share on other sites

I am trying to install this mod now and not sure on this statement in the readme.txt file for install

 

 

If you have already installed USPS Methods or UPS Choice, you can skip this step

 

I have the standard UPS installed now so does this apply to me?

 

I do not use USPS.

 

I though you have to uninstall the default mod before installing this.

 

I just want to make sure I do this right since this site is live now, and can have no down time.

 

Thanks

Link to comment
Share on other sites

I have just installed this mod ok, But now when I goto Admin/Modules/Shipping then I install it that goes ok but when I click edit I get this error:

 

 

Fatal error: Call to undefined function: tep_cfg_select_multioption() in /home/bp/public_html/re/catalog/admin/modules.php(212) : eval()'d code on line 1

 

 

How do I fix this?

 

 

Please help fast.

Link to comment
Share on other sites

Greetings all,

 

 

I've recently installed this great contribution and have had no major issues or problems until now.

 

Our store is located in Ontario Canada. So specific options such as origin and currency reflects this in the UPS XML Shipping Admin setttings.

 

Here's the problem. When I test this shipping module against an international order, it seems to work fine ... only offering what is available. Same thing with US orders.

 

But when I test the module against Canadian orders, it adds an additional option. This option is not displayed with a name or date. The only thing that shows up is the radio button and price. This option falls somewhere in between Standard and Express ... costs more than standard but less than express.

 

If I select this option continue through the checkout process, the confirmation page will display that the Standard option was actually selected (even though the phantom was). It seems to default back to the cheaper option. If I disable any option that shows up as cheaper through the admin ... it actually will display this phantom option as being selected on the confirmation page by listing the price and nothing else (no option name). Similarily, when I disable all options from the admin (so that no UPS option is displayed) this phantom option is still selectable as a shipping option and is still displayed in the confirmation page is being selected.

 

Has anyone run into this before? Any idea what this is and why it is desiplaying? How to correct this?

 

 

Any suggestions, informationa and advice would be greatly appreciated.

 

Thanks for a great contribution,

Olimess

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