Hello:

I have created a patch for the Ubercart Product Quote (uc_product_quote) module to include support for UPS module.

Attached are two patches:

  • uc_product_quote.patch This patch will update the uc_product_quote module to enable support for the UPS module (uc_ups)
  • uc_ups.patch This patch will update the uc_ups.module to enable support for use with the Ubercart Product Quote module

After applying both patches, you will be able to add UPS service specific quotes. This patch has been tested thoroughly and implemented on a live store.

Warning
These patches enable services on a "per product" basis, I have been unsuccessful at enable "per class" services at all. Before and after the patches I've been unable to filter services "per class".

Any comments, concerns, or fixes, just let me know.

Comments

DGvNp0niToyRspXaaqx3PiQBMn66QXyAq5yrNHpz’s picture

StatusFileSize
new1.71 KB
new1.28 KB

It seems that I didn't previously attach the patches or didn't post properly. Apologies for the inconvenience.

vosechu’s picture

Assigned: DGvNp0niToyRspXaaqx3PiQBMn66QXyAq5yrNHpz » Unassigned
StatusFileSize
new2.99 KB

Wonderful work JoshuaPowell. I've adapted the UPS code to work for the general case, it appears that it was using the uc_product_quotes which didn't work on my system so I've updated to use uc_class_quotes for both the fedex and ups versions.

Let me know if you see any flaws in my logic. Hopefully we can get this pushed into UC core.

vosechu’s picture

Ah, I didn't read the bottom half of your comment. I hadn't realized that there was a per product option as well which I would have clearly broken here. I'll amend and repost in a little bit.

vosechu’s picture

StatusFileSize
new6.53 KB

Okay, here's the new patch that addresses the per-product and per-class shipping options for UPS. This also fixes a couple problems with the Fedex version and some documentation which I guess should probably be different patches but I'm eager to see if this patch breaks other people.

jdexo’s picture

There is an issue with the UNION in SELECT queries in Drupal. Please refer to http://drupal.org/node/599664 .

sco_tt’s picture

voesech, is your patch in addition to uc_ups.patch listed above?

vosechu’s picture

@sco_tt yes, you have to apply both my patch and the uc_ups.patch.

@jdexo in comment 2 on the page you posted the OP figured it out just fine. Have you not been able to use my patch because of this problem? For reference, this is running in production on one of our sites right now and working just fine.

jdexo’s picture

@vosechu Sorry, I do not want to lead into misunderstanding, but I just ment that using UNION in your last patch in comment #4 849846-ups-update.patch (function uc_product_quote_services) will not work in drupal (provided that I correctly understand that patches should by applied sequentially up from post #1 till post #4).
Does your production use per-class quoting along with per-product quoting?
If I am somewhere mistaken, please, correct me.
Thank you.

vosechu’s picture

Production uses both per class and per product. Unions are fine in Drupal but that issue you posted was sorta misguided. The OP figured out that he had a syntax problem in the next comment.

graytoby’s picture

I doesn't work for me. It returns not only the shipping methods that I select but also quotes from USPS. After disabling and uninstalling and restoring ups module files it doesn't restore default settings, ubercart still shows only restricted shipping methods. I have to restore database to make it work normally.

vosechu’s picture

Spongecat,

I'm sorry to hear that. Are you able to track down why this might be happening? The project we were using this on wasn't using USPS and I can't really test it without an account (nor do I have the time at the moment) but I'm very interested to see if you can find a fix and/or review code if you need someone to bounce ideas off of.

graytoby’s picture

I actually gave up on this module for now. I was testing it on a live website and constant playing with database restore is not a good idea.

DGvNp0niToyRspXaaqx3PiQBMn66QXyAq5yrNHpz’s picture

@vosechu #4

Awesome, thanks for fixing the "per class" option, that was really hanging me up and causing me some problems. I didn't need it immediately, so I couldn't put the time into further troubleshooting.

Thanks again,
Joshua