Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How can I instruct FedEx module to package/ship each item separately?


windprod_doc

Recommended Posts

My client ships Christmas trees, ornaments, and accessories.

As a rule, each item must be packaged separately. There doesn't seem to be any admin provision for this.

Am I missing something? Is there a way of accomplishing this?

UPSXML can do that (with adding dimensions support). Perhaps you can port that to the FedEx shipping module?
Link to comment
Share on other sites

  • 1 month later...
My client ships Christmas trees, ornaments, and accessories.

As a rule, each item must be packaged separately. There doesn't seem to be any admin provision for this.

Am I missing something? Is there a way of accomplishing this?

 

I would also like to have FedEx Ground shipping calculated for each item seperately. Has anyone attempted this with any success?

 

Example

 

item1 56 pounds

item2 56 poumds

item3 3 pounds

 

Fedex returns 3 x 38.333333 for rate calculation. Confusing to the customer and not accurate.

 

anyone able to take this on? ...

-Dave

Link to comment
Share on other sites

I would also like to have FedEx Ground shipping calculated for each item seperately. Has anyone attempted this with any success?

 

Example

 

item1 56 pounds

item2 56 poumds

item3 3 pounds

 

Fedex returns 3 x 38.333333 for rate calculation. Confusing to the customer and not accurate.

 

anyone able to take this on? ...

 

 

if i remember rightly (i ran into this early on), this might be a result of setting a maximum weight for shipment?

 

been so long since i posted this without reply that i can't remember where, but start with the fedex module first.

looks to me as if the weight limit was someone's way of finessing the nultiple-pacakage issue for their own needs.

 

if you DO get a separate-package solution, please let me know!

 

d

Link to comment
Share on other sites

I tested the shpping maximum weight... If I set it to null or 0, this error occurs:

 

Warning: Division by zero in /var/www/pti/includes/classes/shipping.php on line 87

Warning: Division by zero in /var/www/pti/includes/classes/shipping.php on line 88

Warning: Division by zero in /var/www/pti/includes/modules/shipping/fedex1.php on line 78

 

If I set it to a very high number, then it just combines it all into "1" item...

 

Federal Express (1 x 115lbs)

 

 

The relevent code that needs to be reworked:

 

	function quote($method = '', $module = '') {
  global $total_weight, $shipping_weight, $shipping_quoted, $shipping_num_boxes;

  $quotes_array = array();

  if (is_array($this->modules)) {
	$shipping_quoted = '';
	$shipping_num_boxes = 1;
	$shipping_weight = $total_weight;

	if (SHIPPING_BOX_WEIGHT >= $shipping_weight*SHIPPING_BOX_PADDING/100) {
	  $shipping_weight = $shipping_weight+SHIPPING_BOX_WEIGHT;
	} else {
	  $shipping_weight = $shipping_weight + ($shipping_weight*SHIPPING_BOX_PADDING/100);
	}

	if ($shipping_weight > SHIPPING_MAX_WEIGHT) { // Split into many boxes
	  $shipping_num_boxes = ceil($shipping_weight/SHIPPING_MAX_WEIGHT);
	  $shipping_weight = $shipping_weight/$shipping_num_boxes;
	}

	$include_quotes = array();

	reset($this->modules);
	while (list(, $value) = each($this->modules)) {
	  $class = substr($value, 0, strrpos($value, '.'));
	  if (tep_not_null($module)) {
		if ( ($module == $class) && ($GLOBALS[$class]->enabled) ) {
		  $include_quotes[] = $class;
		}
	  } elseif ($GLOBALS[$class]->enabled) {
		$include_quotes[] = $class;
	  }
	}

	$size = sizeof($include_quotes);
	for ($i=0; $i<$size; $i++) {
	  $quotes = $GLOBALS[$include_quotes[$i]]->quote($method);
	  if (is_array($quotes)) $quotes_array[] = $quotes;
	}
  }

  return $quotes_array;
}

 

 

My php skills are close to 0 :( or I would give it a shot. Any help appreciated.

-Dave

Link to comment
Share on other sites

  • 2 months later...

just use the $order global in your shipping module that holds all the products.

 

so your loop should be like

$multi_array = array();
for( $i=0, $j=count($order->products); $i<$j; $i++ ) {
// get fedex quotes here and add to the total
}

 

not sure which fedex module you're using but there should be setweight function which you will move into the loop and keep a record of the total as well as the weight in an array. So within the loop you could have something like

 

$multi_array[$i]['weight'] = $order->products[$i]['weight']

$this->_setWeight($multi_array[$i]['weight']);

$fedexQuote = $this->_getQuote();

 

And the fedexQuote is another array that holds the individual ones for each product. So you keep it in the mthods array (cost element).

Link to comment
Share on other sites

The contribution is Fedex Direct 2.04 by Steve Fatula Fedex Direct 2.04

 

the file is catalog/includes/modules/shipping/fedex1.php

 

I REALLY appreciate your response enigma1, but do not have a clue how to properly implement what you just said :) actually, I grasp what you are saying, just dont have any experience with php and dont want to break more than I fix.

 

rather than posting a mass of code here, If you have the time to look at the fedex1.php and post back a cutnpaste edit I am sure many people will be grateful. This has been a thorn in an otherwise awesome contribution for etailers who sell heavier items that must be shipped/rated individually.

 

Thanks!

-Dave

Link to comment
Share on other sites

This has been a thorn in an otherwise awesome contribution for etailers who sell heavier items that must be shipped/rated individually.
Given the fact that UPSXML already has this (so it wouldn't be that hard to implement it in the FedEx shipping module) it reminded me of this interesting post.
Link to comment
Share on other sites

JanZ, you more than most have been very helpful to me, as well as to many others I am sure. I'm not sure why you referenced that post, but I do realized how much free support goes on around here, and I certainly wasnt bitching. I have sent donations to many of the contributors as I saw warranted. If I had anything more than novice osc skills I wouldnt ask for help. truth is Ive never written code in my life, and osc was my first intro to php. I am learnig as I go, but I honestly wouldnt have a clue how to edit fedex1.php as mentioned above. I can read and cutnpaste like a champ though. I appreciate every ounce of support I get around here. If you have time to help me tweak out this fedex issue I really do appreciate it. If I can offer a small donation for the help, I'd be glad to do it. I will take a look at upsxml and see if I can grasp what needs to be editied. Thanks for the post.

 

Dave

-Dave

Link to comment
Share on other sites

I'm not sure why you referenced that post, but I do realized how much free support goes on around here, and I certainly wasnt bitching.
I didn't mean to say your were bitching. However, if you lose money with this it would make sense to hire someone to fix this for you. There are people (even on this forum) who make a living doing that (and no, I'm not of them).
If you have time to help me tweak out this fedex issue I really do appreciate it.
Just out of curiosity I downloaded that FedEx contribution and to me it seems this module takes the $shipping_weight (which is the total weight divided by the number of boxes after osC has looked at the maximum weight you pack per box and tare and padding) and sends that off to FedEx go get a rate. Then it multiplies that by the number of boxes to get the total cost. That might be off quite a bit, I'm not familiar with how FedEx calculates it's rates (and perhaps I'm not reading the code right).

 

To implement the ready-to-ship feature you would need to query the FedEx server for those items and then again (if needed) for the items that can be packed together. If that is the correct way of doing it I don't know. There does not seem to be information on the FedEx website available (at least for visitors) that describes this particular way of getting rates.

 

Just like UPS they seem to have an XML interface also, not to dissimilar to the UPS one I think. Perhaps it makes more sense to invest developer time in that.

Link to comment
Share on other sites

  • 5 months later...
My client ships Christmas trees, ornaments, and accessories.

As a rule, each item must be packaged separately. There doesn't seem to be any admin provision for this.

Am I missing something? Is there a way of accomplishing this?

 

I have the solution for this now. If anyone needs this capability, you can message me.

 

-dave

-Dave

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