12 replies [Last post]
izi
izi's picture
Offline
Getting busy with the Ubercode.
Joined: 08/08/2007
Juice: 63
Was this information Helpful?

I have mentioned this before, but I don't recall where it was left off so here goes:

One of the shops I'm maintaining would like to expand to international shipping (to pretty much anywhere). They want domestic users to get UPS quotes, and everyone else to get USPS quotes. Is there a system in place to handle this? Would it be a pain to make these options conditional?

StephenGWills's picture
Offline
Uber DonorBug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Not Kulvik
Joined: 08/07/2007
Juice: 414
Re: International vs. Domestic shipping options

I'm in on the bounty to make this happen!

cosmo83@drupal.org's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Not Kulvik
Joined: 08/08/2007
Juice: 236
Re: International vs. Domestic shipping options

It requires a bit of tweaking with the quote module check the location, or tyhe country and bring only those quotes.

Its a couple of hours work, but it will surely require patching the quote module,

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: Re: International vs. Domestic shipping options

Well, as it turns out, I was working on this today. About all I have left is actually restricting the shipping methods when the customer chooses their country. This is going to take a good bit of JavaScript, though, and that hasn't been working out for some people lately. I expect really hammering out all the problems will take more than just a couple of hours.

cosmo83@drupal.org's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Not Kulvik
Joined: 08/08/2007
Juice: 236
Re: Re: Re: International vs. Domestic shipping options

Well building it as a module will surely be a work, i was expecting to do this simply

by passing the country into it

function uc_quote_request_quotes($country){
...

if ($method = $methods[$_POST['method']] && $country=="bla..."){
$quote_data = call_user_func($method['quote']['callback'], $products, $details);
}
else{
$quote_data = call_user_func($method['quote']['callback'], $products, $details);
}

}

Correct me if Iam wrong.

cosmo83@drupal.org's picture
Offline
Bug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Not Kulvik
Joined: 08/08/2007
Juice: 236
Re: Re: Re: Re: International vs. Domestic shipping options

Iam assuming simpler cases, like if the country is this get this quotes, else get these quotes.

Building it into a module may involve some more work, selecting the shipping methods for what countries etc..

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: Re: Re: Re: Re: International vs. Domestic shipping options

Right now, the customer has to choose a method to get a quote, and then choose the options that are available. The way you're talking about, we would return all the options from all the appropriate methods at once. And then we figure out which option belongs to which method when they click the Submit button.

Hmm...that should work. Getting quotes from UPS, USPS, FedEx at once would take time, but could be done. That's an extreme case, though.

I also like not having to add nearly as much JS as my earlier idea. It'll definitely have to change the uc_quote module, but it shouldn't affect the method modules any.

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: Re: Re: Re: Re: Re: International vs. Domestic shipping opti

Alright, I've committed the changes to the quote module. You should be able to choose the countries for each shipping method in the Quote Methods Settings. It's a multi-select box, and leaving it blank is the same as selecting "--All--".

As of this message, make sure you have all the countries covered. The customer won't be able to check out, but they will be confused by the lack of shipping quotes.

Insurrectus's picture
Offline
Spreading the word - Ubercart for president.
Joined: 08/22/2007
Juice: 364
How Do I Apply This

Is this available to download in the current ubercart module? Or do I need to modify the code? If so what files need to be modified?

Thanks,
I

Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6846
Re: How Do I Apply This

Changes are made to the Bazaar repository. Using Bazaar, you can easily get the latest code and keep it up to date.

When we do make a new release, this change and all the others that have been made will be in it.

StephenGWills's picture
Offline
Uber DonorBug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Not Kulvik
Joined: 08/07/2007
Juice: 414
Re: International vs. Domestic shipping options

I don't have the whole solution to international shipping by any means but if you add:

'08' => t('UPS Worldwide Expedited'),

to the array of services in
uc_ups_module _uc_ups_service_list() one can achieve international shipping quotes from UPS.

StephenGWills's picture
Offline
Uber DonorBug FinderEarly adopter... addicted to alphas.Getting busy with the Ubercode.Not Kulvik
Joined: 08/07/2007
Juice: 414
Re: International vs. Domestic shipping options

with the addition of UPS WorldWide in the services array and a modification to quote.js that intercepts Military APO's and changes the detail["methods"] to "flatrate", we appear to be in business as far as shipping quotes go. I just have to repopulate the country/zone tables.

anyone interested, military APOs can be trapped in the quote.js script. Add code to the quoteCallback function that is like the following:

if ((APOzip == '09') || (APOzip == '96') || (APOzip == '34')) {
// you have a Mil addy
details["method"] = "flatrate";
} else {
// you don't
}

change "flatrate" to the method you want Mil to be handled by... USPS prob, but I'm in a hurry so flatrate will do for proof of concept.

urknownstranger's picture
Offline
Joined: 08/05/2010
Juice: 8
Domestic vs international

hi ,
did you got this problem solved. If yes the send me the procedure for me.

Thanks in advance