VirtueMart Forum

VirtueMart 1.1.x [ Old version - no longer supported ] => Shipping VM 1.1 => USPS (U.S. Postal Service) VM 1 => Topic started by: bcohen0 on September 26, 2010, 02:36:06 AM

Title: USPS 4.2 exception when no domestic options selected in configuration
Post by: bcohen0 on September 26, 2010, 02:36:06 AM
Hello, In case anyone is interested, I discovered that when I shut off all the domestic options for usps4.2 I get an exception on line 318 because $usps_ship_active is null. I suspect the same thing would be seen for $usps_intl_active if you shut off all the international options.

Title: Re: USPS 4.2 exception when no domestic options selected in configuration
Post by: klattr1 on January 23, 2011, 00:23:53 AM
I am experiencing the same issue. I am only using FedEx for domestic shipping and only USPS for international shipping. I get the "Warning: in_array() expects parameter 2 to be array, null given..." error as well.

Anyone have fixes for this? The error goes away if I enable 1 USPS domestic shipping option but I really don't want that and would prefer FedEx to handle domestic shipping for many reasons.

Here's the line of code it's referencing:
if (in_array($serviceName, $usps_ship_active)){
Title: Re: USPS 4.2 exception when no domestic options selected in configuration
Post by: lowmips on June 29, 2012, 17:11:45 PM
You could try changing it to:


if (is_array($usps_ship_active) && in_array($serviceName, $usps_ship_active)){
Title: Re: USPS 4.2 exception when no domestic options selected in configuration
Post by: klattr1 on June 29, 2012, 17:55:02 PM
Reggie, that fixed it...thank god for people like you!
Title: Re: USPS 4.2 exception when no domestic options selected in configuration
Post by: lowmips on June 30, 2012, 00:13:00 AM
No problem, glad to help.