Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Select Shipping witrh military APO/ FPO

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-29-2010, 10:29 AM
 
mrerotic mrerotic is offline
 

eXpert
  
Join Date: Feb 2009
Posts: 264
 

Default Select Shipping witrh military APO/ FPO

Ok I added the correct miltary "AE", "AP", "AA" to my states for user to select. However I have real time shipping enabled and upon checkout I get the following error in the cart:
PHP Code:
UPS Realtime shipping rate calculation service returned the following error:AP is not a valid state for the specified shipment. (errorcode111286
</DIV>
Is there anyway to disable UPS since they dont ship for APO/FPO if the users state is "AE", "AA" or "AP"? Please let me know.
__________________
x-cart 4.2.3
AlteredCart Smart Search
Auto Featured Products Mod (Personal Mod)
BCSE Product Importer Pro & Drop Shipper Pro
CDSEO Pro
CMS EZRecommends
EE slider login (Personal Mod)
Next Prev Link Mod (Customized)
ShadowBox Detailed Images (Personal Mod)
Shop By Price (Customized)
Social Media (Personal Mod)
Switch Layout View (Personal Mod)
Special Offers
Testimonials (Personal Mod)
Whats New (Customized)
Reply With Quote
  #2  
Old 11-29-2010, 02:25 PM
 
mrerotic mrerotic is offline
 

eXpert
  
Join Date: Feb 2009
Posts: 264
 

Default Re: Select Shipping witrh military APO/ FPO

I was able to fix this. All APO/FPO are only shipped via USPS so therefore I only wanted rates to show from USPS for all military addresses. I had to edit the myshipper.php and shipping.php to allow for this to work. If anyone needs the edits, feel free to let me know and I will post them.
__________________
x-cart 4.2.3
AlteredCart Smart Search
Auto Featured Products Mod (Personal Mod)
BCSE Product Importer Pro & Drop Shipper Pro
CDSEO Pro
CMS EZRecommends
EE slider login (Personal Mod)
Next Prev Link Mod (Customized)
ShadowBox Detailed Images (Personal Mod)
Shop By Price (Customized)
Social Media (Personal Mod)
Switch Layout View (Personal Mod)
Special Offers
Testimonials (Personal Mod)
Whats New (Customized)
Reply With Quote
  #3  
Old 01-06-2011, 08:26 AM
 
borisge borisge is offline
 

Newbie
  
Join Date: Nov 2010
Posts: 5
 

Default Re: Select Shipping witrh military APO/ FPO

I would appreciate this edit. I have a customer who commonly ships to APO and only just found that the UPS Address Validator tends to freak out if someone enters an APO address, not allowing checkout. I'm not certain that your problem is the same as mine, but it certainly wouldn't hurt to see how you did it.
__________________
X-cart version: 4.4.1
Modules: nothing of note
Reply With Quote
  #4  
Old 01-10-2011, 09:48 AM
 
borisge borisge is offline
 

Newbie
  
Join Date: Nov 2010
Posts: 5
 

Default Re: Select Shipping witrh military APO/ FPO

What I ended up doing was just modifying include/register.php so the if-statement that runs the validator also checks to see if you're trying to validate an APO:

PHP Code:
if (!@$error && $current_area == "C" && !empty($active_modules["UPS_OnLine_Tools"]) && $s_state != "AA" && $s_state !="AE" && $s_state != "AP" && $s_city != "APO"

If any other cases pop up in which it shouldn't be run, I'll probably modify this code to reflect that.
__________________
X-cart version: 4.4.1
Modules: nothing of note
Reply With Quote
  #5  
Old 03-18-2011, 06:41 AM
 
HookahMaster HookahMaster is offline
 

Member
  
Join Date: Oct 2006
Posts: 18
 

Default Re: Select Shipping witrh military APO/ FPO

I am having this same issue. I can not get it to work correctly. I am now getting this message:

UPS Realtime shipping rate calculation service returned the following error:
AE is not a valid state for the specified shipment. (errorcode: 111286)
Unfortunately, we are unable to provide you with a shipping cost estimate for this order.

Can someone help?

Thanks
__________________
webmaster@saharasmoke.com
X-cart v4.3.1[unix]
X-cart v4.1.9[unix]
X-cart v4.1.8[unix]
X-cart v4.1.6[unix]
Reply With Quote
  #6  
Old 03-21-2011, 12:33 PM
 
mrerotic mrerotic is offline
 

eXpert
  
Join Date: Feb 2009
Posts: 264
 

Default Re: Select Shipping witrh military APO/ FPO

Ok I'm trying to remember how I did this but here are the edits that I can remember. If your having issues after adding these let me know what the issue is and make sure you do the edits I have provided.

Open /shipping/shipping.php
Find the following:
Code:
func_https_ctl('IGNORE');

After add the following:
Code:
$military = array("AP","AE","AA"); if (in_array($userinfo['s_state'], $military)){ $shipmilitary = "Y"; $smarty->assign("military","Y"); }

Find:
Code:
$intershipper_rates = func_shipper($data['items'], $userinfo, $data['seller_address'], 'N', $cart);

Replace with:
Code:
$intershipper_rates = func_shipper($data['items'], $userinfo, $data['seller_address'], 'N', $cart, $shipmilitary);

Find:
Code:
if (!empty($active_modules["UPS_OnLine_Tools"]) && $config["Shipping"]["use_intershipper"] != "Y") {

Replace with:
Code:
if (!empty($active_modules["UPS_OnLine_Tools"]) && $config["Shipping"]["use_intershipper"] != "Y" && !$shipmilitary) {

Find:
Code:
if (!empty($active_modules["UPS_OnLine_Tools"]) && $config["Shipping"]["realtime_shipping"] == "Y" && $config["Shipping"]["use_intershipper"] != "Y") {

Replace with:
Code:
if (!empty($active_modules["UPS_OnLine_Tools"]) && $config["Shipping"]["realtime_shipping"] == "Y" && $config["Shipping"]["use_intershipper"] != "Y" && !$shipmilitary) {

SAVE THIS FILE & UPLOAD.

Open /shipping/myshipper.php

Find:
Code:
function func_shipper ($items, $userinfo, $orig_address, $debug="N", $cart=false) {

Replace with:
Code:
function func_shipper ($items, $userinfo, $orig_address, $debug="N", $cart=false, $shipmilitary=false) {

Find:
Code:
$ups_rates_only = (!empty($active_modules["UPS_OnLine_Tools"]) && $current_carrier == "UPS");

Replace with:
Code:
$ups_rates_only = (!empty($active_modules["UPS_OnLine_Tools"]) && $current_carrier == "UPS" && !$shipmilitary);

Find:
Code:
if ($ups_rates_only) { $alt_ship_mods[] = "AP"; } else { $ship_mods[] = "AP"; }

Replace with:
Code:
//if ($ups_rates_only) { $alt_ship_mods[] = "AP"; //} else { $ship_mods[] = "AP"; //} if ($shipmilitary){ x_session_register("current_carrier","USPS"); }

Find:
Code:
$mods = array("USPS", "CPC", "ARB", "FEDEX");

Replace with:
Code:
$mods = array("USPS", "CPC", "ARB", "FEDEX", "UPS");

Find:
Code:
elseif (!empty($active_modules["UPS_OnLine_Tools"]) && $current_carrier != "UPS") {

Replace with:
Code:
elseif (!empty($active_modules["UPS_OnLine_Tools"]) && $current_carrier != "UPS" && !$shipmilitary) {

SAVE & UPLOAD

Login to your x-cart admin area and under "Management" click on "States" and add the following to the list under (United State of America):
Code:
Code State ----- ----- AE Armed Forces (AE) AA Armed Forces Americas (AA) AP Armed Forces Pacific (AP)

LAST follow the instructions in post #1 that this user has provided.
http://forum.x-cart.com/showthread.php?t=51646

Once you have done all of this you are DONE. ENJOY...
__________________
x-cart 4.2.3
AlteredCart Smart Search
Auto Featured Products Mod (Personal Mod)
BCSE Product Importer Pro & Drop Shipper Pro
CDSEO Pro
CMS EZRecommends
EE slider login (Personal Mod)
Next Prev Link Mod (Customized)
ShadowBox Detailed Images (Personal Mod)
Shop By Price (Customized)
Social Media (Personal Mod)
Switch Layout View (Personal Mod)
Special Offers
Testimonials (Personal Mod)
Whats New (Customized)
Reply With Quote
  #7  
Old 03-21-2011, 12:43 PM
 
mrerotic mrerotic is offline
 

eXpert
  
Join Date: Feb 2009
Posts: 264
 

Default Re: Select Shipping witrh military APO/ FPO

I believe this was all I did to get it working. Make sure you have real-time rates enabled for USPS. This addition will ONLY allow shipping using USPS to all military P.O. Box addresses. All other real-time shipping carriers will not be shown.

X-cart needs to integrate something like this for military shipping.

This has been tested and works in x-cart version 4.2.x. Not sure on any other version.

Let me know and Ill do my best to help if your having issues.
__________________
x-cart 4.2.3
AlteredCart Smart Search
Auto Featured Products Mod (Personal Mod)
BCSE Product Importer Pro & Drop Shipper Pro
CDSEO Pro
CMS EZRecommends
EE slider login (Personal Mod)
Next Prev Link Mod (Customized)
ShadowBox Detailed Images (Personal Mod)
Shop By Price (Customized)
Social Media (Personal Mod)
Switch Layout View (Personal Mod)
Special Offers
Testimonials (Personal Mod)
Whats New (Customized)
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 11:30 PM.

   

 
X-Cart forums © 2001-2020