Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

New UPS XML Shipping Module available


Recommended Posts

I'm having an issue with the dimensional support part of the UPS XML module. It does not seem to be calculating my shipments correctly. For example, I have a product that measures 17x10x8 (and is input that way in the product listing), and it is saying I can fit 3 of them into a box that measures 22x18x12. If I checkout with 4 of them it does split it into 2 shipments which would be correct. It seems like it is slightly working, but for some reason it is listing one too many item in every shipment. 2 would fit into that box, but not 3. The same problem goes with other products as well. Any ideas on this?

Edited by SVTour98
Link to comment
Share on other sites

I'm having an issue with the dimensional support part of the UPS XML module. It does not seem to be calculating my shipments correctly. For example, I have a product that measures 17x10x8 (and is input that way in the product listing), and it is saying I can fit 3 of them into a box that measures 22x18x12. If I checkout with 4 of them it does split it into 2 shipments which would be correct. It seems like it is slightly working, but for some reason it is listing one too many item in every shipment. 2 would fit into that box, but not 3. The same problem goes with other products as well. Any ideas on this?

You really think a couple of hundreds line of code can go through an extensive amount of fitting to see if it really fits in that box? Packing like that is a subject of academic research (stacking of boxes on pallets, railway carts, containers). Besides that, this has to be done plus UPS has to be contacted twice (once for transit times and once for rates) before PHP times out (usually 30 seconds).

 

So what happens is that the code aligns products and boxes according to dimensions (largest to smallest) and sees if the dimensions make it possible to fit in a box. Then it only looks at volume and weight for fitting. Real 3D fitting is not done. It still is an approximation, but a better one than standard osC does (total weight plus some tare divided by the maximum weight you will ship per box is this amount of boxes).

 

Feel free to add the 3D fitting to the module :)

Link to comment
Share on other sites

Thanks in advance for the help and I apologize if this issue has already been resolved, it's just difficult to find anything in an 81 page thread.

 

In the admin section I get this error when i click on the UPSXML module:

 

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/deepfocu/public_html/store/admin/modules.php(345) : eval()'d code on line 1

 

So I opened modules.php found line 345...

eval('$keys .= ' . $value['set_function'] . "'" . $value['value'] . "', '" . $key . "');");

So my question is, do I take out one of the ) or add one? And where?

 

Thanks!

Link to comment
Share on other sites

In the admin section I get this error when i click on the UPSXML module:

 

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/deepfocu/public_html/store/admin/modules.php(345) : eval()'d code on line 1

 

So I opened modules.php found line 345...

eval('$keys .= ' . $value['set_function'] . "'" . $value['value'] . "', '" . $key . "');");

So my question is, do I take out one of the ) or add one? And where?

None of that. You have to go back to the readme.txt that came with the package and re-read step 5. There are a couple of things you have to do with either the field "set_function" or the upsxml.php file itself (a little bit more involved). This error has no effect on the module on the catalog side by the way.

Link to comment
Share on other sites

None of that. You have to go back to the readme.txt that came with the package and re-read step 5. There are a couple of things you have to do with either the field "set_function" or the upsxml.php file itself (a little bit more involved). This error has no effect on the module on the catalog side by the way.

 

Done, Everything is working fine related to that last issue i posted about BUT now trying to make a duplicate product I get this is the error, which leads me to believe that i missed something else.

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' products_length, products_width, products_height, products_ready_to_ship, produ' at line 1

select products_quantity, products_model, products_image, products_price, products_date_available, products_weight, , products_length, products_width, products_height, products_ready_to_ship, products_tax_class_id, manufacturers_id from products where products_id = '45'

[TEP STOP]

 

What step did i miss? I went back and checked the readme but I wouldn't be surprised if i missed something. Thanks again!

Edited by Jeremy Rasmussen
Link to comment
Share on other sites

What step did i miss? I went back and checked the readme but I wouldn't be surprised if i missed something.

None, there is a bug in the admin/categories.php that is in the package. There should not be two comma's right after another:

products_weight, , products_length

The idea was to fix it in the next release on which I'm working (will take a couple of weeks). No new functionality but easier to install and the packaging code in a separate class.

Link to comment
Share on other sites

Not sure if anyone can help on this or not, but when I put my information into the admin config and click update, much of my information will not save (username, key, password, city/state, etc.- anything with a text input) but the radio button changes do save. Anyone had this issue and fixed it? I've tried setting all the files to 777 even to get it to take but it will not.

 

Any help would be most appreciated!

Link to comment
Share on other sites

Not sure if anyone can help on this or not, but when I put my information into the admin config and click update, much of my information will not save (username, key, password, city/state, etc.- anything with a text input) but the radio button changes do save. Anyone had this issue and fixed it? I've tried setting all the files to 777 even to get it to take but it will not.

 

Any help would be most appreciated!

Sounds like the problem that was fixed in RC1. Try this fix (post number 2). Setting files 777 is potentially risky and since these settings go into the database it wouldn't have helped anyway.

Link to comment
Share on other sites

some of the products i sell are to big that we get dimensional errors sent to our e-mail address when people go to the shipping options. the problem is the email just shows the customer id and that the package was to huge. we want to know what item it was that they were trying to get so we can fix the dimensional errors. is there a way? also how do we know which customer is the customer id that the e-mail was talking about?

Link to comment
Share on other sites

some of the products i sell are to big that we get dimensional errors sent to our e-mail address when people go to the shipping options. the problem is the email just shows the customer id and that the package was to huge. we want to know what item it was that they were trying to get so we can fix the dimensional errors. is there a way? also how do we know which customer is the customer id that the e-mail was talking about?

In the latest download of UPSXML there are additional instructions to store the results of the packaging routines in a database table and a page to look them up. That last one is not working 100% correctly yet, I found some strange things when navigating the results but nothing "fatal".

 

The customer_id is the customer_id from the table customers in your database. I don't remember if you can search in the admin for customer_id, but in phpMyAdmin surely.

Link to comment
Share on other sites

In the latest download of UPSXML there are additional instructions to store the results of the packaging routines in a database table and a page to look them up. That last one is not working 100% correctly yet, I found some strange things when navigating the results but nothing "fatal".

 

The customer_id is the customer_id from the table customers in your database. I don't remember if you can search in the admin for customer_id, but in phpMyAdmin surely.

 

the error message doesn't state what product it is. does the new one that stores the packaging routines in a database table show what product is giving the error?

 

as far as customer_id you are correct phpMyAdmin shows that information. that is good enough. i just need a solution for the packaging errors :)

Link to comment
Share on other sites

the error message doesn't state what product it is. does the new one that stores the packaging routines in a database table show what product is giving the error?

It shows which products went in which box (or were set to/are ready-to-ship) after the packaging routine, so you should be able to find that information back (if you know which products that particular customer ordered, I guess not). The bug on the admin page for it is that if you go back from a later page to the first page it asks your confirmation to delete all entries (and you haven't selected any so nothing will happen even if you click OK). Haven't had the time to sort that out.

Link to comment
Share on other sites

It shows which products went in which box (or were set to/are ready-to-ship) after the packaging routine, so you should be able to find that information back (if you know which products that particular customer ordered, I guess not). The bug on the admin page for it is that if you go back from a later page to the first page it asks your confirmation to delete all entries (and you haven't selected any so nothing will happen even if you click OK). Haven't had the time to sort that out.

 

i actually don't kno about this whole "box" thing. i don't setup boxes on oscommerce. all i do is use dimensional settings & the weight features from UPSXML. in regards to the error, the error is

 

111050: Package exceeds the maximum size total constraints of 130 inches (length + girth, where girth is 2 x width plus 2 x height). If you prefer to use ups as your shipping method, please contact (domain) via Email.

 

that's what i want to fix & figure out which product it is. some products (such as exhausts) exceed this constraint, so we want to edit the package that needs to be fixed.

Link to comment
Share on other sites

i actually don't kno about this whole "box" thing. i don't setup boxes on oscommerce. all i do is use dimensional settings & the weight features from UPSXML. in regards to the error, the error is

 

111050: Package exceeds the maximum size total constraints of 130 inches (length + girth, where girth is 2 x width plus 2 x height). If you prefer to use ups as your shipping method, please contact (domain) via Email.

 

that's what i want to fix & figure out which product it is. some products (such as exhausts) exceed this constraint, so we want to edit the package that needs to be fixed.

 

Just a side note to your request, the total girth of a standard package at UPS is 130 inches... anything larger than that is considered an over sized package, which they will ship it just costs more. so if you look at your catalog and find any products that the width and height times two equal 130 or more inches you are over sized. The formula for girth: (W + H) x 2 = X

Link to comment
Share on other sites

Can anyone tell me about a couple of possibilities why this error keeps popping up? In particular the warning about an active session? I'm getting this error when you attempt to go to checkout-shipping and, I assume, where the UPSXML connection is wrong. But what to do? And what exactly is a sesskey mod ini setting?

 

0 -

 

select c.categories_id, cd.categories_name, c.parent_id from categories c, categories_description cd where c.categories_id = cd.categories_id and cd.language_id="1" order by sort_order, cd.categories_name

 

[TEP STOP]

 

0 -

 

select count(*) as total from sessions where sesskey = '27419ea245fc4bab52eb243cdb63d11c'

 

[TEP STOP]

 

 

Warning: Unknown(): A session is active. You cannot change the session module's ini settings at this time. in Unknown on line 0

 

I've had the Shipping page and UPSXML mod working well prior to this. The big change is that I have added the CCGV mod and because I couldn't get it to run on the previous database (mySQL5) I had to change the database back to run with mySQL 4.1 This obviously has a lot of the database settings changed. But maybe I've missed one? And now the connection to UPS is closing because of that? Everything else except the checkout_shipping seems to work OK on the new database.

 

As always, thanks in advance for the help. I'm sorry if this is not enough information for anyone to start with the guessing. I will be more than happy to provide any other info needed.

Link to comment
Share on other sites

Can anyone tell me about a couple of possibilities why this error keeps popping up? In particular the warning about an active session? I'm getting this error when you attempt to go to checkout-shipping and, I assume, where the UPSXML connection is wrong. But what to do? And what exactly is a sesskey mod ini setting?

 

0 -

 

select c.categories_id, cd.categories_name, c.parent_id from categories c, categories_description cd where c.categories_id = cd.categories_id and cd.language_id="1" order by sort_order, cd.categories_name

 

[TEP STOP]

 

0 -

 

select count(*) as total from sessions where sesskey = '27419ea245fc4bab52eb243cdb63d11c'

 

[TEP STOP]

Warning: Unknown(): A session is active. You cannot change the session module's ini settings at this time. in Unknown on line 0

 

I've had the Shipping page and UPSXML mod working well prior to this. The big change is that I have added the CCGV mod and because I couldn't get it to run on the previous database (mySQL5) I had to change the database back to run with mySQL 4.1 This obviously has a lot of the database settings changed. But maybe I've missed one? And now the connection to UPS is closing because of that? Everything else except the checkout_shipping seems to work OK on the new database.

I don't see a connection with UPSXML and/or a shipping module. When I search Google for this error, it seems to be mentioned several times, but there does not seem to be a common source of the error.

 

Since you also include a query that seems to be coming from the categories box it might have to do with a slow site (too many queries?) where you lose connection with the database.

 

Pretty illogical to downgrade a MySQL5 database to MySQ4 because a contribution is not MySQL5 ready by the way. Better upgrade that contribution then.

Link to comment
Share on other sites

I don't see a connection with UPSXML and/or a shipping module. When I search Google for this error, it seems to be mentioned several times, but there does not seem to be a common source of the error.

 

Since you also include a query that seems to be coming from the categories box it might have to do with a slow site (too many queries?) where you lose connection with the database.

 

Pretty illogical to downgrade a MySQL5 database to MySQ4 because a contribution is not MySQL5 ready by the way. Better upgrade that contribution then.

 

I completely agree about the downgrade. CCGV doesn't have an upgrade to mySQL5. And there is no way that my very limited knowledge can make it happen without direction. I am very close to just getting rid of the mod and putting everything, including the previously working database, back to what it was before.

 

I just want to try a couple of things before I do. I don't know if the amount/slowness of queries is the problem as it was working before and, honestly, I have no idea how to check for that. The error emails and UPSXML error log tell me that the problems start with the connection to UPS. The research/googling that I have done all point to what is probably a slightly corrupted database (working for everything but connections to UPS). I'm hoping for someone maybe to point out a way to check what UPSXML settings/functions/etc. have to do with the database. Or how to run an internal check on the database to make sure everything transferred correctly. Or is there a way to clear a session key through clearing the tables? Or...?

Link to comment
Share on other sites

I don't know if the amount/slowness of queries is the problem as it was working before and, honestly, I have no idea how to check for that.

Actually, there is a setting in the admin (Configuration -> Logging -> Display the Page Parse Time) which if you set it to true should write the time to parse the page and the number of queries it took on the bottom of the page. That should give an indication (I think it is about 70 for a default shop on index.php).

 

The error emails and UPSXML error log tell me that the problems start with the connection to UPS.

Could be.

The research/googling that I have done all point to what is probably a slightly corrupted database (working for everything but connections to UPS). I'm hoping for someone maybe to point out a way to check what UPSXML settings/functions/etc. have to do with the database.

No clue really in this connection. You did make the field set_function in the table configuration text in this database too?

 

Or is there a way to clear a session key through clearing the tables? Or...?

In phpMyAdmin:

truncate sessions;

That empties the table without deleting the table (doesn't hurt in a shop you are setting up, otherwise customers would lose their carts).

Link to comment
Share on other sites

Thank you thank you thank you.

 

I'm still doing test runs but I do believe that truncating sessions cleared things up.

 

Too bad there wasn't a way to show (pay) gratitude around here, cause I so very much appreciate the time that Jan and others help with the troubleshooting.

Link to comment
Share on other sites

I have installed version 1.2.9 of this contribution, including dimension support, and it is all working wonderfully. Except...

 

It is taking an agonizing 13 seconds each time the curl request to the UPS server is executed. I inserted timing code and determined that it is the curl_exec that is taking the time and not the rest of the code. What's worse is that you see this 13 second delay twice, once on first loading the shipping page and then again when continuing to the payment page, since the process code gets the quotes again!

 

UPS tells me that when they tested using the query I sent them, it took only 2 seconds to get a response. I am using similar code in an Authorize.NET AIM module and it takes no time at all.

 

Usually I'm pretty good at figuring these things out, but this one has me stumped. I thought I could hack together an HTML page to simulate the POST, but I'm drawing a blank at how to get the XML request in there.

 

Any ideas for what I can look at would be welcomed. My store is running on a dedicated 1&1 server in New Jersey.

 

Oh, there is one small bug I found. If you enable negotiated rates but UPS isn't sending them to you, one gets garbage for the quote rather than just defaulting to the regular rate. I can probably come up with a fix for that but I want to try to get past this 13-second gap first. Thanks.

Link to comment
Share on other sites

Does anyone have a suggestion on this?

 

When going through the transaction process, the final price of the shipping methods seems to be backwards:

 

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

UPS Worldwide Express, 2007-10-30 $12.00CA

UPS Worldwide Expedited, 2007-10-31 $13.00CA

UPS Standard, 2007-11-06 $16.00CA

 

I would think that Standard and Express amounts would be reversed... Does that make sense? How can I correct this error?

 

Thanks in advance!

 

~Roq

Link to comment
Share on other sites

It is taking an agonizing 13 seconds each time the curl request to the UPS server is executed. I inserted timing code and determined that it is the curl_exec that is taking the time and not the rest of the code. What's worse is that you see this 13 second delay twice, once on first loading the shipping page and then again when continuing to the payment page, since the process code gets the quotes again!

I never noticed that in my tests and frankly I don't think the curl_exec is done on the payment page (simple check would be to enable logging the request and go to the payment page which I can't remember I did or not. Then it would show up twice in the logs).

The shipping modules are loaded on that page so perhaps it has something to do with xmldocument.

 

xmldocument is the file that parses the xml code, I don't trust it because I can't understand it. I want to replace it with the code that Harald used in osC3 and kymation/Jim Keebaugh is using with some refinement in BAXGlobal Shipping Module.

 

UPS tells me that when they tested using the query I sent them, it took only 2 seconds to get a response. I am using similar code in an Authorize.NET AIM module and it takes no time at all.
Perhaps the verify peer stuff (checking the certificate) isn't helping either...

 

There is an xml file and some lines in upsxml.php to use (if you uncomment them) that uses the file to parse that xml file to simulate getting a UPS request. But if the loading of xmldocument.php takes that long, you won't see a difference I guess.

Oh, there is one small bug I found. If you enable negotiated rates but UPS isn't sending them to you, one gets garbage for the quote rather than just defaulting to the regular rate. I can probably come up with a fix for that but I want to try to get past this 13-second gap first.

That was something I wanted to do after I moved UPSXML to the other xml parsing code. I couldn't figure out this xmldocument code so I left it for later.

Link to comment
Share on other sites

I never noticed that in my tests and frankly I don't think the curl_exec is done on the payment page (simple check would be to enable logging the request and go to the payment page which I can't remember I did or not. Then it would show up twice in the logs).

It's not done on the payment page, but in the "action=process" code of the shipping page when you submit the page. It reloads all the shipping modules, asks for quotes again, and then redirects to the payment page. You can see this more clearly if you enable the feature of storing boxes used - you'll find double entries for each order.

 

One of these days I'll study the process code to see why it is doing the re-quote. I think that if the submit passed a bit more information, this would not be required. Anyway, it's not directly relevant to UPSXML so it's not worth discussing further here.

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