Jump to content
Sign in to follow this  
queasyprawn

Package/Ship Items Seperately?

Recommended Posts

Is it possible to have the shipping prices calculated seperately.  All of my products ship in their own box.

Try one of these contribution for Individual Product Shipping Prices.

http://www.oscommerce.com/community/contri...vidual+shipping


( WARNING )

I think I know what Im talking about.

BACK UP BACK UP BACK UP BACK UP

Share this post


Link to post
Share on other sites

I understand that UPS XML has a packaging option that enables you to calculate shipping more accurately. Again, from what I understand is that you can keep products that have their own packaging box as separate boxes for the UPS Shipping. Don't know what you mean with "Is it possible to have the shipping prices calculated seperately." because everything is supposed to go in one shipping and it doesn't give any prices for the separate packages.

Share this post


Link to post
Share on other sites
...because everything is supposed to go in one shipping and it doesn't give any prices for the separate packages.

Well, each product in the cart will ship in its own box. This affects the weight of each package and in return affects the price. The way it is now assumes I am shipping everything together in one package, which is not true,

Share this post


Link to post
Share on other sites

From what I understand enabling the dimensional support in UPS XML will give you the option to indicate that a product will be shipped in its own box (and therefore not be put together with other stuff in a box to the maximum weight you allow per box). I never used it, so I'm not infinately familiar with it.

Share this post


Link to post
Share on other sites
From what I understand enabling the dimensional support in UPS XML will give you the option to indicate that a product will be shipped in its own box (and therefore not be put together with other stuff in a box to the maximum weight you allow per box). I never used it, so I'm not infinately familiar with it.

How do I enable the dimensional support. I don't see that option in the admin.

Share this post


Link to post
Share on other sites
Is it possible to have the shipping prices calculated seperately.  All of my products ship in their own box.

 

If your individual products are always about the same weight you might be able to maniuplate osC through defining the Maximum package weight to ie. 1 kg. or 0.5 kg

In theory osC should then divide the products ordered over more packages with the appropriate shipping price tag to it.

Share this post


Link to post
Share on other sites
If your individual products are always about the same weight you might be able to maniuplate osC through defining the Maximum package weight to ie. 1 kg. or 0.5 kg

That might be a problem. They are not all the same weight. They range from 4lbs. to 20lbs.

Share this post


Link to post
Share on other sites
That might be a problem.  They are not all the same weight.  They range from 4lbs. to 20lbs.

 

Aah, I was afraid you would say that :-( It would have been an easy way to solve it but I am afraid this will now probably going to be a tough one. I am sorry I can't be of any more help in this. :(

Share this post


Link to post
Share on other sites

Thanks anyway wheeloftime

 

Maybe this will better help explain what I want to do...

 

Since I have just implemented UPSxml, thanks to JanZ, I now see this text when I check out.

 

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

 

No matter how many items I have it always has 1pkg. What I want to be able to do is have 1 package for each item in the cart. However, doing this would change how the price was calculated.

 

For example, 3 pkg's x 10lbs totat DOES NOT equal the proper shipping price. However, (1pkg x 4)+(1pkg x 4)+(1pkg x 2) DOES equal the price, or at least closer to it than shipping it all together.

 

Hopefully this makes what I want to do a little clearer. Can this be done?

Share this post


Link to post
Share on other sites

txcrew;

 

If the UPSXML module is set up properly WITH packaging support included, you should have a checkbox in your Admin where you add products that says something like "Ready to ship". This being checked for an item SHOULD result in a separate package being created for that item. You probably also need to be sure that the dimensions are indicated for each item and that you have at least one package defined in the packaging module.

 

If all of your items have this checkbox checked and someone orders 3 different items, you should see 3 packages in the UPSXML rate quotes. If someone orders 2 of the same item and you have set it up as "Ready to ship", you should see 2 packages in the rate quotes.


... if you want to REALLY see something that doesn't set up right out of the box without some tweaking,

try being a Foster Parent!

Share this post


Link to post
Share on other sites

Got everything installed and working correctly.

 

Is it normal that when I check the "Ready to ship" box in the products admin that it does not stay checked when I got back to edit it again?

 

I think this is causing incorrect shipping totals when I checkout.

Share this post


Link to post
Share on other sites

Okay, I ran some tests, here is the scenario:

 

Catalog has a prouduct:

 

Food Combo

 

weight: 25lbs

Length: 16

Width: 9

Height: 14

Ready to ship: unchecked (only because it doesn't stay checked)

 

 

Packaging Admin has 1 package:

 

Name: Food

Description: Cardboard

Length: 16.00

Width: 9.00

Height: 14.00

Empty Weight: 0.00

Maximum Weight:25.00

Cost/Pref:1

 

My Cart has:

3 x Food Combo's

 

 

When I checkout the shipping dialog box says this:

 

United Parcel Service (XML) (2 pkg(s), 50 lbs total)

 

 

when it should say:

United Parcel Service (XML) (3 pkg(s), 75 lbs total)

 

 

I don't understand why it wouldn't be counting one of the products in the shipping if it is counting the other two.

 

Any Ideas?

Share this post


Link to post
Share on other sites

I tried to find an error in the code this morning and I although I don't totally understand what it is doing (especially in the crucial function packProducts($productsArray)) it seems like nothing is wrong with it (at least I don't see it...).

 

There has been an issue with it, where if products that were ready-to-ship were put in the shopping cart after other products it was not dealt with properly. That appeared to be solved when the $productsArray was sorted before packProducts was called, with ready-to-ship items first.

 

I guess the only way to find the bug (because it looks like one) is to output the arrays to the screen on certain points. For example starting around line 443 you find:

        // Get the product array and expand multiple qty items.
       $productsRemaining = array();
       for ($i = 0; $i < count($productsArray); $i++) {
           $product = $productsArray[$i];
           for ($j = 0; $j < $productsArray[$i]['quantity']; $j++) {
               $productsRemaining[] = $product;
           }
       }
       // Worst case, you'll need as many boxes as products ordered.

You could add before that last comment:

echo '<pre>';
print_r($productsRemaining);
echo '</pre><br>';

to see if all the products made it into that array and how it looks like.

If that looks OK, you can put it a little further, immediately after:

$productsRemaining = array_slice($productsRemaining, 1);

Perhaps this will give us a clue what goes wrong.

Share this post


Link to post
Share on other sites
You could add before that last comment:

echo '<pre>';
print_r($productsRemaining);
echo '</pre><br>';

to see if all the products made it into that array and how it looks like.

If that looks OK, you can put it a little further, immediately after:

$productsRemaining = array_slice($productsRemaining, 1);

 

I added that code to and here are the results that came up:

Array
(
   [0] => Array
       (
           [id] => 34
           [name] => Plenty Hungry Combo
           [model] => 
           [image] => 
           [price] => 149.5000
           [quantity] => 3
           [weight] => 25.00
           [length] => 16.00
           [width] => 9.00
           [height] => 14.00
           [ready_to_ship] => 0
           [final_price] => 149.5
           [tax_class_id] => 0
           [attributes] => 
       )

   [1] => Array
       (
           [id] => 34
           [name] => Plenty Hungry Combo
           [model] => 
           [image] => 
           [price] => 149.5000
           [quantity] => 3
           [weight] => 25.00
           [length] => 16.00
           [width] => 9.00
           [height] => 14.00
           [ready_to_ship] => 0
           [final_price] => 149.5
           [tax_class_id] => 0
           [attributes] => 
       )

   [2] => Array
       (
           [id] => 34
           [name] => Plenty Hungry Combo
           [model] => 
           [image] => 
           [price] => 149.5000
           [quantity] => 3
           [weight] => 25.00
           [length] => 16.00
           [width] => 9.00
           [height] => 14.00
           [ready_to_ship] => 0
           [final_price] => 149.5
           [tax_class_id] => 0
           [attributes] => 
       )

)

 

it looks to be what I saw happenening earlier. As seen in the code.

[/code][ready_to_ship] => 0

 

Is it normal that when I check the "Ready to ship" box in the products admin that it does not stay checked when I got back to edit it again?

Share this post


Link to post
Share on other sites

ready_to_ship=> 0 is a problem, but it doesn't explain why the first or last package is not included in the shipping "list".

You can't check the box and not come back to edit? I mean, it could be that if you "post" the form in admin the changes go into the database, but if you get back to edit it again the code doesn't check for the status of ready_to_ship in the database (a bug) but if you edit and do not check the box again the ready_to_ship is changed to "0" (as it should be because the box isn't checked).

Share this post


Link to post
Share on other sites

I manually changed the value of product #34 to [ready_to_ship] => 1 in the database via phpmyadmin...however, I still get the same results in the cart.

Share this post


Link to post
Share on other sites

Good move, now we have to figure out where we lose the package. We know three packages go into packProducts($productsArray) but we don't know if they get out.

Can you insert

 echo '</pre>'; 
print_r($boxesToShip); 
echo '</pre>';

in between

            $boxesToShip = $this->packProducts($productsArray);

and

    // Quote for the number of boxes

somewhere around line 198?

Share this post


Link to post
Share on other sites

Added the code, here are the results:

 

 

Array
(
   [0] => Array
       (
           [id] => 34
           [name] => Plenty Hungry Combo
           [model] => 
           [image] => 
           [price] => 149.5000
           [quantity] => 3
           [weight] => 25.00
           [length] => 16.00
           [width] => 9.00
           [height] => 14.00
           [ready_to_ship] => 1
           [final_price] => 149.5
           [tax_class_id] => 0
           [attributes] => 
       )

   [1] => Array
       (
           [id] => 34
           [name] => Plenty Hungry Combo
           [model] => 
           [image] => 
           [price] => 149.5000
           [quantity] => 3
           [weight] => 25.00
           [length] => 16.00
           [width] => 9.00
           [height] => 14.00
           [ready_to_ship] => 1
           [final_price] => 149.5
           [tax_class_id] => 0
           [attributes] => 
       )

   [2] => Array
       (
           [id] => 34
           [name] => Plenty Hungry Combo
           [model] => 
           [image] => 
           [price] => 149.5000
           [quantity] => 3
           [weight] => 25.00
           [length] => 16.00
           [width] => 9.00
           [height] => 14.00
           [ready_to_ship] => 1
           [final_price] => 149.5
           [tax_class_id] => 0
           [attributes] => 
       )

)


Array ( [0] => Array ( [length] => 16.00 [width] => 9.00 [height] => 14.00 [current_weight] => 25.00 ) [1] => Array ( [length] => 16.00 [width] => 9.00 [height] => 14.00 [current_weight] => 25.00 ) )

 

Looks like only 2 are getting out.

Edited by txcrew

Share this post


Link to post
Share on other sites

This was interesting, I reduced my cart to just one item and look at the results:

Array
(
   [0] => Array
       (
           [id] => 34
           [name] => Plenty Hungry Combo
           [model] => 
           [image] => 
           [price] => 149.5000
           [quantity] => 1
           [weight] => 25.00
           [length] => 16.00
           [width] => 9.00
           [height] => 14.00
           [ready_to_ship] => 1
           [final_price] => 149.5
           [tax_class_id] => 0
           [attributes] => 
       )

)


Array ( )

Share this post


Link to post
Share on other sites

Just ran some more tests and somthing very odd just happened...

 

I removed all of the code that you me put into upsxml.php, truncated the sessions table and now, for some reason, it works just how its supposed to. 5 food combos and 5 boxes. I checked the price against the ups site and its exactly right.

 

However, if I want to make a package 'ready to ship' I have to do that through phpmyadmin. It still somehow does not post to the database from the admin. As a temp workaround, I set all pakcages ready to ship by default in phpmyadmin.

 

Things are starting to work slowly and in strange ways ;)

Share this post


Link to post
Share on other sites
I removed all of the code that you me put into upsxml.php, truncated the sessions table and now, for some reason, it works just how its supposed to. 5 food combos and 5 boxes.
I can't offer an explanation. The added code should only work on the things that come back from UPS after the packing and such has been done...

The fact that the code appears to lose the first package, but picks up the later ones.... :'(

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  

×