Author Topic: USPS v5 - Bundled and Unbundled shipping  (Read 244937 times)

lowmips

  • Global Moderator
  • Full Member
  • *
  • Posts: 1464
    • lowmips.com
Re: USPS v5 - Bundled and Unbundled shipping
« Reply #585 on: March 19, 2012, 13:01:18 pm »
XML POST:
Code: [Select]
http://Production.ShippingAPIs.com/ShippingAPI.dll?API=RateV4&XML=<RateV4Request USERID="###REMOVED###" ><Revision /><Package ID="0"><Service>All</Service><ZipOrigination>43119</ZipOrigination><ZipDestination>43119</ZipDestination><Pounds>0</Pounds><Ounces>2</Ounces><Container /><Size>REGULAR</Size><Machinable>FALSE</Machinable> </Package></RateV4Request>
XML RESULT:
Code: [Select]
<?xml version="1.0"?>
<RateV4Response><Package ID="0"><ZipOrigination>43119</ZipOrigination><ZipDestination>43119</ZipDestination><Pounds>0</Pounds><Ounces>2</Ounces><Size>REGULAR</Size><Machinable>FALSE</Machinable><Zone>1</Zone><Postage CLASSID="3"><MailService>Express Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt;</MailService><Rate>12.95</Rate></Postage><Postage CLASSID="2"><MailService>Express Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Hold For Pickup</MailService><Rate>12.95</Rate></Postage><Postage CLASSID="55"><MailService>Express Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Flat Rate Boxes</MailService><Rate>39.95</Rate></Postage><Postage CLASSID="56"><MailService>Express Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Flat Rate Boxes Hold For Pickup</MailService><Rate>39.95</Rate></Postage><Postage CLASSID="13"><MailService>Express Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Flat Rate Envelope</MailService><Rate>18.95</Rate></Postage><Postage CLASSID="27"><MailService>Express Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Flat Rate Envelope Hold For Pickup</MailService><Rate>18.95</Rate></Postage><Postage CLASSID="30"><MailService>Express Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Legal Flat Rate Envelope</MailService><Rate>18.95</Rate></Postage><Postage CLASSID="31"><MailService>Express Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Legal Flat Rate Envelope Hold For Pickup</MailService><Rate>18.95</Rate></Postage><Postage CLASSID="1"><MailService>Priority Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt;</MailService><Rate>5.20</Rate></Postage><Postage CLASSID="22"><MailService>Priority Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Large Flat Rate Box</MailService><Rate>15.45</Rate></Postage><Postage CLASSID="17"><MailService>Priority Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Medium Flat Rate Box</MailService><Rate>11.35</Rate></Postage><Postage CLASSID="28"><MailService>Priority Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Small Flat Rate Box</MailService><Rate>5.35</Rate></Postage><Postage CLASSID="16"><MailService>Priority Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Flat Rate Envelope</MailService><Rate>5.15</Rate></Postage><Postage CLASSID="44"><MailService>Priority Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Legal Flat Rate Envelope</MailService><Rate>5.30</Rate></Postage><Postage CLASSID="29"><MailService>Priority Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Padded Flat Rate Envelope</MailService><Rate>5.30</Rate></Postage><Postage CLASSID="38"><MailService>Priority Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Gift Card Flat Rate Envelope</MailService><Rate>5.15</Rate></Postage><Postage CLASSID="42"><MailService>Priority Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Small Flat Rate Envelope</MailService><Rate>5.15</Rate></Postage><Postage CLASSID="40"><MailService>Priority Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Window Flat Rate Envelope</MailService><Rate>5.15</Rate></Postage><Postage CLASSID="0"><MailService>First-Class Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Parcel</MailService><Rate>1.95</Rate></Postage><Postage CLASSID="0"><MailService>First-Class Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Letter</MailService><Rate>0.85</Rate></Postage><Postage CLASSID="0"><MailService>First-Class Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Postcards</MailService><Rate>0.32</Rate></Postage><Postage CLASSID="15"><MailService>First-Class Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Large Postcards</MailService><Rate>0.45</Rate></Postage><Postage CLASSID="4"><MailService>Parcel Post&lt;sup&gt;&amp;reg;&lt;/sup&gt;</MailService><Rate>5.20</Rate></Postage><Postage CLASSID="6"><MailService>Media Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt;</MailService><Rate>2.47</Rate></Postage><Postage CLASSID="7"><MailService>Library Mail</MailService><Rate>2.35</Rate></Postage></Package></RateV4Response>

You should be seeing the Priority mail and Express mail options, as they are being returned.  Can you post your uspsv5.cfg.php (remove your user credentials first)?
Visit my website at www.lowmips.com
View my newsletters Here (sign up for newsletters on the front page of my website)

SPyKER

  • Beginner
  • *
  • Posts: 9
Re: USPS v5 - Bundled and Unbundled shipping
« Reply #586 on: March 19, 2012, 14:12:31 pm »
Here is the uspsv5.cfg.php:
Code: [Select]
<?php
if( !defined'_VALID_MOS' ) && !defined'_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' ); 

define ('USPS_SHOW_DEBUG''');
define ('USPS_USERNAME''###RETRACTED###');
define ('USPS_SERVER''Production.ShippingAPIs.com');
define ('USPS_PATH''/ShippingAPI.dll');
define ('USPS_PROXYSERVER''');
define ('USPS_PACKAGESIZE''REGULAR');
define ('USPS_TAX_CLASS''0');
define ('USPS_HANDLINGFEE''.50');
define ('USPS_PADDING''15%');
define ('USPS_INTLHANDLINGFEE''5.00');
define ('USPS_MACHINABLE''0');
define ('USPS_SHOW_DELIVERY_QUOTE''1');
define ('USPS_REPORTERRORS''1');
define ('USPS_STANDARDSHIPPING''0');
define ('USPS_PREFIX''USPS');
define ('USPS_SHIP0''0');
define ('USPS_SHIP1''1');
define ('USPS_SHIP2''0');
define ('USPS_SHIP3''0');
define ('USPS_SHIP4''0');
define ('USPS_SHIP5''0');
define ('USPS_SHIP6''0');
define ('USPS_SHIP7''0');
define ('USPS_SHIP8''0');
define ('USPS_SHIP9''1');
define ('USPS_SHIP10''0');
define ('USPS_SHIP11''0');
define ('USPS_SHIP12''0');
define ('USPS_SHIP13''0');
define ('USPS_SHIP14''0');
define ('USPS_SHIP15''0');
define ('USPS_SHIP16''0');
define ('USPS_SHIP17''0');
define ('USPS_SHIP18''0');
define ('USPS_SHIP19''0');
define ('USPS_SHIP20''0');
define ('USPS_SHIP21''0');
define ('USPS_SHIP22''0');
define ('USPS_SHIP23''0');
define ('USPS_SHIP0_UPCHARGE''');
define ('USPS_SHIP1_UPCHARGE''');
define ('USPS_SHIP2_UPCHARGE''');
define ('USPS_SHIP3_UPCHARGE''');
define ('USPS_SHIP4_UPCHARGE''');
define ('USPS_SHIP5_UPCHARGE''');
define ('USPS_SHIP6_UPCHARGE''');
define ('USPS_SHIP7_UPCHARGE''');
define ('USPS_SHIP8_UPCHARGE''');
define ('USPS_SHIP9_UPCHARGE''');
define ('USPS_SHIP10_UPCHARGE''');
define ('USPS_SHIP11_UPCHARGE''');
define ('USPS_SHIP12_UPCHARGE''');
define ('USPS_SHIP13_UPCHARGE''');
define ('USPS_SHIP14_UPCHARGE''');
define ('USPS_SHIP15_UPCHARGE''');
define ('USPS_SHIP16_UPCHARGE''');
define ('USPS_SHIP17_UPCHARGE''');
define ('USPS_SHIP18_UPCHARGE''');
define ('USPS_SHIP19_UPCHARGE''');
define ('USPS_SHIP20_UPCHARGE''');
define ('USPS_SHIP21_UPCHARGE''');
define ('USPS_SHIP22_UPCHARGE''');
define ('USPS_SHIP23_UPCHARGE''');
define ('USPS_SHIP0_COMMIT''Overnight, most locations');
define ('USPS_SHIP1_COMMIT''Overnight, most locations');
define ('USPS_SHIP2_COMMIT''Overnight, most locations');
define ('USPS_SHIP3_COMMIT''Overnight, most locations');
define ('USPS_SHIP4_COMMIT''Overnight, most locations');
define ('USPS_SHIP5_COMMIT''Overnight, most locations');
define ('USPS_SHIP6_COMMIT''1 - 3 Days');
define ('USPS_SHIP7_COMMIT''1 - 3 Days');
define ('USPS_SHIP8_COMMIT''1 - 3 Days');
define ('USPS_SHIP9_COMMIT''1 - 3 Days');
define ('USPS_SHIP10_COMMIT''1 - 3 Days');
define ('USPS_SHIP11_COMMIT''1 - 3 Days');
define ('USPS_SHIP12_COMMIT''2 - 9 Days');
define ('USPS_SHIP13_COMMIT''2 - 9 Days');
define ('USPS_SHIP14_COMMIT''2 - 9 Days');
define ('USPS_SHIP15_COMMIT''2 - 9 Days');
define ('USPS_SHIP16_COMMIT''2 - 9 Days');
define ('USPS_SHIP17_COMMIT''');
define ('USPS_SHIP18_COMMIT''');
define ('USPS_SHIP19_COMMIT''');
define ('USPS_SHIP20_COMMIT''');
define ('USPS_SHIP21_COMMIT''');
define ('USPS_SHIP22_COMMIT''');
define ('USPS_SHIP23_COMMIT''');
define ('USPS_INTL0''0');
define ('USPS_INTL1''0');
define ('USPS_INTL2''0');
define ('USPS_INTL3''0');
define ('USPS_INTL4''1');
define ('USPS_INTL5''0');
define ('USPS_INTL6''0');
define ('USPS_INTL7''1');
define ('USPS_INTL8''0');
define ('USPS_INTL9''0');
define ('USPS_INTL10''0');
define ('USPS_INTL11''0');
define ('USPS_INTL12''0');
define ('USPS_INTL13''0');
define ('USPS_INTL14''0');
define ('USPS_INTL15''0');
define ('USPS_INTL16''0');
define ('USPS_INTL17''0');
define ('USPS_INTL18''0');
define ('USPS_INTL19''0');
define ('USPS_INTL20''0');
define ('USPS_INTL0_UPCHARGE''');
define ('USPS_INTL1_UPCHARGE''');
define ('USPS_INTL2_UPCHARGE''');
define ('USPS_INTL3_UPCHARGE''');
define ('USPS_INTL4_UPCHARGE''');
define ('USPS_INTL5_UPCHARGE''');
define ('USPS_INTL6_UPCHARGE''');
define ('USPS_INTL7_UPCHARGE''');
define ('USPS_INTL8_UPCHARGE''');
define ('USPS_INTL9_UPCHARGE''');
define ('USPS_INTL10_UPCHARGE''');
define ('USPS_INTL11_UPCHARGE''');
define ('USPS_INTL12_UPCHARGE''');
define ('USPS_INTL13_UPCHARGE''');
define ('USPS_INTL14_UPCHARGE''');
define ('USPS_INTL15_UPCHARGE''');
define ('USPS_INTL16_UPCHARGE''');
define ('USPS_INTL17_UPCHARGE''');
define ('USPS_INTL18_UPCHARGE''');
define ('USPS_INTL19_UPCHARGE''');
define ('USPS_INTL20_UPCHARGE''');
define ('USPS_SHIP0_TEXT''Express Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Hold For Pickup');
define ('USPS_SHIP1_TEXT''Express Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt;');
define ('USPS_SHIP2_TEXT''Express Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Sunday/Holiday Delivery');
define ('USPS_SHIP3_TEXT''Express Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Flat Rate Envelope');
define ('USPS_SHIP4_TEXT''Express Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Flat Rate Envelope Hold For Pickup');
define ('USPS_SHIP5_TEXT''Express Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Sunday/Holiday Delivery Flat Rate Envelope');
define ('USPS_SHIP6_TEXT''Express Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Legal Flat Rate Envelope');
define ('USPS_SHIP7_TEXT''Express Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Legal Flat Rate Envelope Hold For Pickup');
define ('USPS_SHIP8_TEXT''Express Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Sunday/Holiday Delivery Legal Flat Rate Envelope');
define ('USPS_SHIP9_TEXT''Priority Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt;');
define ('USPS_SHIP10_TEXT''Priority Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Large Flat Rate Box');
define ('USPS_SHIP11_TEXT''Priority Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Medium Flat Rate Box');
define ('USPS_SHIP12_TEXT''Priority Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Small Flat Rate Box');
define ('USPS_SHIP13_TEXT''Priority Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Flat Rate Envelope');
define ('USPS_SHIP14_TEXT''Priority Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Legal Flat Rate Envelope');
define ('USPS_SHIP15_TEXT''Priority Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Padded Flat Rate Envelope');
define ('USPS_SHIP16_TEXT''Priority Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Gift Card Flat Rate Envelop');
define ('USPS_SHIP17_TEXT''Priority Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Small Flate Rate Envelope');
define ('USPS_SHIP18_TEXT''Priority Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Window Flat Rate Envelope');
define ('USPS_SHIP19_TEXT''First-Class Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Parcel');
define ('USPS_SHIP20_TEXT''First-Class Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; Large Envelope');
define ('USPS_SHIP21_TEXT''Parcel Post&lt;sup&gt;&amp;reg;&lt;/sup&gt;');
define ('USPS_SHIP22_TEXT''Media Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt;');
define ('USPS_SHIP23_TEXT''Library Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt;');
define ('USPS_INTL0_TEXT''Global Express Guaranteed&lt;sup&gt;&amp;reg;&lt;/sup&gt; (GXG)**');
define ('USPS_INTL1_TEXT''Global Express Guaranteed&lt;sup&gt;&amp;reg;&lt;/sup&gt; Non-Document Rectangular');
define ('USPS_INTL2_TEXT''Global Express Guaranteed&lt;sup&gt;&amp;reg;&lt;/sup&gt; Non-Document Non-Rectangular');
define ('USPS_INTL3_TEXT''USPS GXG&lt;sup&gt;&amp;trade;&lt;/sup&gt; Envelopes**');
define ('USPS_INTL4_TEXT''Express Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; International');
define ('USPS_INTL5_TEXT''Express Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; International Flat Rate Envelope');
define ('USPS_INTL6_TEXT''Express Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; International Legal Flat Rate Envelope');
define ('USPS_INTL7_TEXT''Priority Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; International');
define ('USPS_INTL8_TEXT''Priority Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; International Large Flat Rate Box');
define ('USPS_INTL9_TEXT''Priority Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; International Medium Flat Rate Box');
define ('USPS_INTL10_TEXT''Priority Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; International Small Flat Rate Box**');
define ('USPS_INTL11_TEXT''Priority Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; International DVD Flat Rate Box**');
define ('USPS_INTL12_TEXT''Priority Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; International Large Video Flat Rate Box**');
define ('USPS_INTL13_TEXT''Priority Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; International Flat Rate Envelope**');
define ('USPS_INTL14_TEXT''Priority Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; International Legal Flat Rate Envelope**');
define ('USPS_INTL15_TEXT''Priority Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; International Padded Flat Rate Envelope**');
define ('USPS_INTL16_TEXT''Priority Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; International Gift Card Flat Rate Envelope**');
define ('USPS_INTL17_TEXT''Priority Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; International Small Flat Rate Envelope**');
define ('USPS_INTL18_TEXT''Priority Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; International Window Flat Rate Envelope**');
define ('USPS_INTL19_TEXT''First-Class Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; International Package**');
define ('USPS_INTL20_TEXT''First-Class Mail&lt;sup&gt;&amp;reg;&lt;/sup&gt; International Large Envelope**');
?>

lowmips

  • Global Moderator
  • Full Member
  • *
  • Posts: 1464
    • lowmips.com
Re: USPS v5 - Bundled and Unbundled shipping
« Reply #587 on: March 19, 2012, 14:43:42 pm »
I've tested a checkout using the same setup as you (weight, zip codes, module config) and had no issues.  I'm not sure if it was an issue with my module archive, maybe some old versions of the files were in there.  I've rebuilt the archive and uploaded it to the first post in this thread.  Try downloading it and copy over the files.   Reconfigure the module, save the settings a few times, and try again.

Reggie
Visit my website at www.lowmips.com
View my newsletters Here (sign up for newsletters on the front page of my website)

SPyKER

  • Beginner
  • *
  • Posts: 9
Re: USPS v5 - Bundled and Unbundled shipping
« Reply #588 on: March 20, 2012, 01:18:27 am »
Hmmm. I overwrote the files with the new download and no change. I just went into the mySQL and ran statements to make sure all weights are set, the the weight UOM is ounces. Previously, I was testing with only a single product I had made sure was set properly.

I'm going to try the other module to see if it works better for me. I won't have a need for unbundling, but I can override that.


SPyKER

  • Beginner
  • *
  • Posts: 9
Re: USPS v5 - Bundled and Unbundled shipping
« Reply #589 on: March 20, 2012, 01:40:12 am »
No change. The XML Results still show the correct rates, but it looks like the shipping module can't read them.

lowmips

  • Global Moderator
  • Full Member
  • *
  • Posts: 1464
    • lowmips.com
Re: USPS v5 - Bundled and Unbundled shipping
« Reply #590 on: March 20, 2012, 02:36:49 am »
Not sure what to tell you Spyker...again, I tried the exact same checkout with the latest module and it worked for me.  Very weird.
Are you any good with PHP? Maybe throw a few debug echo's in there to see what's going on.
Visit my website at www.lowmips.com
View my newsletters Here (sign up for newsletters on the front page of my website)

SPyKER

  • Beginner
  • *
  • Posts: 9
Re: USPS v5 - Bundled and Unbundled shipping
« Reply #591 on: March 20, 2012, 02:50:30 am »
Maybe throw a few debug echo's in there to see what's going on.

Yeah, that's what I've been looking into. It seems to get to the point of pulling the XML, but then has a problem with the get_rates_array after the XML is returned. I'm focusing on this bit of code to start:
Code: [Select]
uspsv5::debugLog($debug_str);
$this->rates = $this->uspsv5->get_rates_array(
$this->source['country'],
$this->source['zip'],
$this->destination['country'],
$this->destination['zip'],
$this->weight,
$this->value,
$declare_dims,$this->dimensions_arr['length'], $this->dimensions_arr['width'], $this->dimensions_arr['height']
);

if ($this->rates == null){
uspsv5::debugLog("Package::query_rates() - Rate query returned null results.");
return false;
}

lowmips

  • Global Moderator
  • Full Member
  • *
  • Posts: 1464
    • lowmips.com
Re: USPS v5 - Bundled and Unbundled shipping
« Reply #592 on: March 20, 2012, 12:54:30 pm »
Let me suggest in the get_rates_array() function, right before this line:

Code: [Select]
if (in_array($serviceName, $usps_ship_active)){echo $serviceName.'<br/>';

and right before this line further up:
Code: [Select]
for ($i = 0; $i < $matchingNodes->getLength(); $i++) {
echo '<pre>'.var_export( $usps_ship_active,true).'</pre>';
Visit my website at www.lowmips.com
View my newsletters Here (sign up for newsletters on the front page of my website)

SPyKER

  • Beginner
  • *
  • Posts: 9
Re: USPS v5 - Bundled and Unbundled shipping
« Reply #593 on: March 21, 2012, 01:20:43 am »
Those returned the following:
Code: [Select]
array (
  0 => 'Express Mail<sup>&reg;</sup>',
  'Express Mail<sup>&reg;</sup>' =>
  array (
    0 => 'Overnight, most locations',
    'upcharge' => '',
  ),
  1 => 'Priority Mail<sup>&reg;</sup>',
  'Priority Mail<sup>&reg;</sup>' =>
  array (
    0 => '1 - 3 Days',
    'upcharge' => '',
  ),
  2 => 'First-Class Mail<sup>&reg;</sup> Parcel',
  'First-Class Mail<sup>&reg;</sup> Parcel' =>
  array (
    0 => '',
    'upcharge' => '',
  ),
  3 => 'First-Class Mail<sup>&reg;</sup> Large Envelope',
  'First-Class Mail<sup>&reg;</sup> Large Envelope' =>
  array (
    0 => '',
    'upcharge' => '',
  ),
  4 => 'Parcel Post<sup>&reg;</sup>',
  'Parcel Post<sup>&reg;</sup>' =>
  array (
    0 => '',
    'upcharge' => '',
  ),
  5 => 'Media Mail<sup>&reg;</sup>',
  'Media Mail<sup>&reg;</sup>' =>
  array (
    0 => '',
    'upcharge' => '',
  ),
  6 => 'Library Mail<sup>&reg;</sup>',
  'Library Mail<sup>&reg;</sup>' =>
  array (
    0 => '',
    'upcharge' => '',
  ),
)

Express Maillt;supgt;amp;reg;lt;/supgt;
Express Maillt;supgt;amp;reg;lt;/supgt; Hold For Pickup
Express Maillt;supgt;amp;reg;lt;/supgt; Flat Rate Boxes
Express Maillt;supgt;amp;reg;lt;/supgt; Flat Rate Boxes Hold For Pickup
Express Maillt;supgt;amp;reg;lt;/supgt; Flat Rate Envelope
Express Maillt;supgt;amp;reg;lt;/supgt; Flat Rate Envelope Hold For Pickup
Express Maillt;supgt;amp;reg;lt;/supgt; Legal Flat Rate Envelope
Express Maillt;supgt;amp;reg;lt;/supgt; Legal Flat Rate Envelope Hold For Pickup
Priority Maillt;supgt;amp;reg;lt;/supgt;
Priority Maillt;supgt;amp;reg;lt;/supgt; Large Flat Rate Box
Priority Maillt;supgt;amp;reg;lt;/supgt; Medium Flat Rate Box
Priority Maillt;supgt;amp;reg;lt;/supgt; Small Flat Rate Box
Priority Maillt;supgt;amp;reg;lt;/supgt; Flat Rate Envelope
Priority Maillt;supgt;amp;reg;lt;/supgt; Legal Flat Rate Envelope
Priority Maillt;supgt;amp;reg;lt;/supgt; Padded Flat Rate Envelope
Priority Maillt;supgt;amp;reg;lt;/supgt; Gift Card Flat Rate Envelope
Priority Maillt;supgt;amp;reg;lt;/supgt; Small Flat Rate Envelope
Priority Maillt;supgt;amp;reg;lt;/supgt; Window Flat Rate Envelope
First-Class Maillt;supgt;amp;reg;lt;/supgt; Parcel
First-Class Maillt;supgt;amp;reg;lt;/supgt; Letter
First-Class Maillt;supgt;amp;reg;lt;/supgt; Postcards
First-Class Maillt;supgt;amp;reg;lt;/supgt; Large Postcards
Parcel Postlt;supgt;amp;reg;lt;/supgt;
Media Maillt;supgt;amp;reg;lt;/supgt;
Library Mail

lowmips

  • Global Moderator
  • Full Member
  • *
  • Posts: 1464
    • lowmips.com
Re: USPS v5 - Bundled and Unbundled shipping
« Reply #594 on: March 21, 2012, 01:33:07 am »
add a '<pre>' and '</pre>' to the serviceName echo.  It looks like they are different, but I think it's just a display interpretation thing.  If they are not exactly the same, that could be the issue (although I doubt it).
Visit my website at www.lowmips.com
View my newsletters Here (sign up for newsletters on the front page of my website)

SPyKER

  • Beginner
  • *
  • Posts: 9
Re: USPS v5 - Bundled and Unbundled shipping
« Reply #595 on: March 21, 2012, 01:54:52 am »
Looks the same. I think it's the interperter.
Code: [Select]
array (
  0 => 'Express Mail<sup>&reg;</sup> Hold For Pickup',
  'Express Mail<sup>&reg;</sup> Hold For Pickup' =>
  array (
    0 => 'Overnight, most locations',
    'upcharge' => '',
  ),
  1 => 'Express Mail<sup>&reg;</sup>',
  'Express Mail<sup>&reg;</sup>' =>
  array (
    0 => 'Overnight, most locations',
    'upcharge' => '',
  ),
  2 => 'Express Mail<sup>&reg;</sup> Sunday/Holiday Delivery',
  'Express Mail<sup>&reg;</sup> Sunday/Holiday Delivery' =>
  array (
    0 => 'Overnight, most locations',
    'upcharge' => '',
  ),
  3 => 'Express Mail<sup>&reg;</sup> Flat Rate Envelope',
  'Express Mail<sup>&reg;</sup> Flat Rate Envelope' =>
  array (
    0 => 'Overnight, most locations',
    'upcharge' => '',
  ),
  4 => 'Express Mail<sup>&reg;</sup> Flat Rate Envelope Hold For Pickup',
  'Express Mail<sup>&reg;</sup> Flat Rate Envelope Hold For Pickup' =>
  array (
    0 => 'Overnight, most locations',
    'upcharge' => '',
  ),
  5 => 'Express Mail<sup>&reg;</sup> Sunday/Holiday Delivery Flat Rate Envelope',
  'Express Mail<sup>&reg;</sup> Sunday/Holiday Delivery Flat Rate Envelope' =>
  array (
    0 => 'Overnight, most locations',
    'upcharge' => '',
  ),
  6 => 'Express Mail<sup>&reg;</sup> Legal Flat Rate Envelope',
  'Express Mail<sup>&reg;</sup> Legal Flat Rate Envelope' =>
  array (
    0 => '1 - 3 Days',
    'upcharge' => '',
  ),
  7 => 'Express Mail<sup>&reg;</sup> Legal Flat Rate Envelope Hold For Pickup',
  'Express Mail<sup>&reg;</sup> Legal Flat Rate Envelope Hold For Pickup' =>
  array (
    0 => '1 - 3 Days',
    'upcharge' => '',
  ),
  8 => 'Express Mail<sup>&reg;</sup> Sunday/Holiday Delivery Legal Flat Rate Envelope',
  'Express Mail<sup>&reg;</sup> Sunday/Holiday Delivery Legal Flat Rate Envelope' =>
  array (
    0 => '1 - 3 Days',
    'upcharge' => '',
  ),
  9 => 'Priority Mail<sup>&reg;</sup>',
  'Priority Mail<sup>&reg;</sup>' =>
  array (
    0 => '1 - 3 Days',
    'upcharge' => '',
  ),
  10 => 'Priority Mail<sup>&reg;</sup> Large Flat Rate Box',
  'Priority Mail<sup>&reg;</sup> Large Flat Rate Box' =>
  array (
    0 => '1 - 3 Days',
    'upcharge' => '',
  ),
  11 => 'Priority Mail<sup>&reg;</sup> Medium Flat Rate Box',
  'Priority Mail<sup>&reg;</sup> Medium Flat Rate Box' =>
  array (
    0 => '1 - 3 Days',
    'upcharge' => '',
  ),
  12 => 'Priority Mail<sup>&reg;</sup> Small Flat Rate Box',
  'Priority Mail<sup>&reg;</sup> Small Flat Rate Box' =>
  array (
    0 => '2 - 9 Days',
    'upcharge' => '',
  ),
  13 => 'Priority Mail<sup>&reg;</sup> Flat Rate Envelope',
  'Priority Mail<sup>&reg;</sup> Flat Rate Envelope' =>
  array (
    0 => '2 - 9 Days',
    'upcharge' => '',
  ),
  14 => 'Priority Mail<sup>&reg;</sup> Legal Flat Rate Envelope',
  'Priority Mail<sup>&reg;</sup> Legal Flat Rate Envelope' =>
  array (
    0 => '2 - 9 Days',
    'upcharge' => '',
  ),
  15 => 'Priority Mail<sup>&reg;</sup> Padded Flat Rate Envelope',
  'Priority Mail<sup>&reg;</sup> Padded Flat Rate Envelope' =>
  array (
    0 => '2 - 9 Days',
    'upcharge' => '',
  ),
  16 => 'Priority Mail<sup>&reg;</sup> Gift Card Flat Rate Envelop',
  'Priority Mail<sup>&reg;</sup> Gift Card Flat Rate Envelop' =>
  array (
    0 => '2 - 9 Days',
    'upcharge' => '',
  ),
  17 => 'Priority Mail<sup>&reg;</sup> Small Flate Rate Envelope',
  'Priority Mail<sup>&reg;</sup> Small Flate Rate Envelope' =>
  array (
    0 => '',
    'upcharge' => '',
  ),
  18 => 'Priority Mail<sup>&reg;</sup> Window Flat Rate Envelope',
  'Priority Mail<sup>&reg;</sup> Window Flat Rate Envelope' =>
  array (
    0 => '',
    'upcharge' => '',
  ),
  19 => 'First-Class Mail<sup>&reg;</sup> Parcel',
  'First-Class Mail<sup>&reg;</sup> Parcel' =>
  array (
    0 => '',
    'upcharge' => '',
  ),
  20 => 'First-Class Mail<sup>&reg;</sup> Large Envelope',
  'First-Class Mail<sup>&reg;</sup> Large Envelope' =>
  array (
    0 => '',
    'upcharge' => '',
  ),
  21 => 'Parcel Post<sup>&reg;</sup>',
  'Parcel Post<sup>&reg;</sup>' =>
  array (
    0 => '',
    'upcharge' => '',
  ),
  22 => 'Media Mail<sup>&reg;</sup>',
  'Media Mail<sup>&reg;</sup>' =>
  array (
    0 => '',
    'upcharge' => '',
  ),
  23 => 'Library Mail<sup>&reg;</sup>',
  'Library Mail<sup>&reg;</sup>' =>
  array (
    0 => '',
    'upcharge' => '',
  ),
)Express Maillt;supgt;amp;reg;lt;/supgt;

Express Maillt;supgt;amp;reg;lt;/supgt; Hold For Pickup

Express Maillt;supgt;amp;reg;lt;/supgt; Flat Rate Boxes

Express Maillt;supgt;amp;reg;lt;/supgt; Flat Rate Boxes Hold For Pickup

Express Maillt;supgt;amp;reg;lt;/supgt; Flat Rate Envelope

Express Maillt;supgt;amp;reg;lt;/supgt; Flat Rate Envelope Hold For Pickup

Express Maillt;supgt;amp;reg;lt;/supgt; Legal Flat Rate Envelope

Express Maillt;supgt;amp;reg;lt;/supgt; Legal Flat Rate Envelope Hold For Pickup

Priority Maillt;supgt;amp;reg;lt;/supgt;

Priority Maillt;supgt;amp;reg;lt;/supgt; Large Flat Rate Box

Priority Maillt;supgt;amp;reg;lt;/supgt; Medium Flat Rate Box

Priority Maillt;supgt;amp;reg;lt;/supgt; Small Flat Rate Box

Priority Maillt;supgt;amp;reg;lt;/supgt; Flat Rate Envelope

Priority Maillt;supgt;amp;reg;lt;/supgt; Legal Flat Rate Envelope

Priority Maillt;supgt;amp;reg;lt;/supgt; Padded Flat Rate Envelope

Priority Maillt;supgt;amp;reg;lt;/supgt; Gift Card Flat Rate Envelope

Priority Maillt;supgt;amp;reg;lt;/supgt; Small Flat Rate Envelope

Priority Maillt;supgt;amp;reg;lt;/supgt; Window Flat Rate Envelope

First-Class Maillt;supgt;amp;reg;lt;/supgt; Parcel

First-Class Maillt;supgt;amp;reg;lt;/supgt; Letter

First-Class Maillt;supgt;amp;reg;lt;/supgt; Postcards

First-Class Maillt;supgt;amp;reg;lt;/supgt; Large Postcards

Parcel Postlt;supgt;amp;reg;lt;/supgt;

Media Maillt;supgt;amp;reg;lt;/supgt;

Library Mail

lowmips

  • Global Moderator
  • Full Member
  • *
  • Posts: 1464
    • lowmips.com
Re: USPS v5 - Bundled and Unbundled shipping
« Reply #596 on: March 21, 2012, 14:17:20 pm »
OK, how about this...find the section where the $ship_service_active array is built:

Code: [Select]
if ($ship_option_text !== ""){
$usps_ship_active[] = $ship_option_text;
$usps_ship_active[$ship_option_text][0] = $ship_option_commit;

$usps_ship_active[$ship_option_text]['upcharge'] = $ship_option_upcharge;
}

put in an echo for $ship_option_text.  Then try using the htmlentities function to force $ship_option_text to be fully converted to entities.
Visit my website at www.lowmips.com
View my newsletters Here (sign up for newsletters on the front page of my website)

SPyKER

  • Beginner
  • *
  • Posts: 9
Re: USPS v5 - Bundled and Unbundled shipping
« Reply #597 on: March 23, 2012, 19:22:45 pm »
I added this before both instances that looked like your example:
Code: [Select]
htmlentities($ship_option_text);
echo $ship_option_text.'<br/>';

Got this:
Express Mail<sup>&reg;</sup> Hold For Pickup
Express Mail<sup>&reg;</sup>
Express Mail<sup>&reg;</sup> Sunday/Holiday Delivery
Express Mail<sup>&reg;</sup> Flat Rate Envelope
Express Mail<sup>&reg;</sup> Flat Rate Envelope Hold For Pickup
Express Mail<sup>&reg;</sup> Sunday/Holiday Delivery Flat Rate Envelope
Express Mail<sup>&reg;</sup> Legal Flat Rate Envelope
Express Mail<sup>&reg;</sup> Legal Flat Rate Envelope Hold For Pickup
Express Mail<sup>&reg;</sup> Sunday/Holiday Delivery Legal Flat Rate Envelope
Priority Mail<sup>&reg;</sup>
Priority Mail<sup>&reg;</sup> Large Flat Rate Box
Priority Mail<sup>&reg;</sup> Medium Flat Rate Box
Priority Mail<sup>&reg;</sup> Small Flat Rate Box
Priority Mail<sup>&reg;</sup> Flat Rate Envelope
Priority Mail<sup>&reg;</sup> Legal Flat Rate Envelope
Priority Mail<sup>&reg;</sup> Padded Flat Rate Envelope
Priority Mail<sup>&reg;</sup> Gift Card Flat Rate Envelop

and still have :
Debug: Package::query_rates() - Rate query returned null results.
Debug: Shipment::populate() - query_rates() failed.
Debug: uspsv5::list_rates() - shipment->populate() failed!
Notice: We are unable to ship via USPS at this time. System Error.

I'm wondering if any other modules installed might be messing with things?

lowmips

  • Global Moderator
  • Full Member
  • *
  • Posts: 1464
    • lowmips.com
Re: USPS v5 - Bundled and Unbundled shipping
« Reply #598 on: March 23, 2012, 19:25:41 pm »
I should have tested if the name matching was even working....right after this line:

Code: [Select]
if (in_array($serviceName, $usps_ship_active)){
add:
echo "found service $serviceName <br/>";

That should tell us if it's a matching issue or not, if it does not match the services you've selected and that are present in the reply.
Visit my website at www.lowmips.com
View my newsletters Here (sign up for newsletters on the front page of my website)

SPyKER

  • Beginner
  • *
  • Posts: 9
Re: USPS v5 - Bundled and Unbundled shipping
« Reply #599 on: March 24, 2012, 04:32:44 am »
It's a matching issue. Putting it after the line gave no results. So I looped the $usps_active_ship and displayed it, then placed your line ABOVE the if statement:

Code: [Select]
echo "Ship Active:";
foreach($usps_ship_active as $item) {
        echo $item."</br>";
}

for ($i = 0; $i < $matchingNodes->getLength(); $i++) {
$thisPostage = 0;

// get the service name
$currNode =& $matchingNodes->item($i);
$serviceName = $currNode->getElementsByTagName("MailService");
$serviceName = $serviceName->item(0);
$serviceName = $serviceName->getText();

echo "Found service $serviceName<br/>";

//if service in XML is contained in active service array add as option
if (in_array($serviceName, $usps_ship_active)){

Results:
Ship Active:Express Mail<sup>&reg;</sup>
Array
Priority Mail<sup>&reg;</sup>
Array
Found service Express Maillt;supgt;amp;reg;lt;/supgt;
Found service Express Maillt;supgt;amp;reg;lt;/supgt; Hold For Pickup
Found service Express Maillt;supgt;amp;reg;lt;/supgt; Flat Rate Boxes
Found service Express Maillt;supgt;amp;reg;lt;/supgt; Flat Rate Boxes Hold For Pickup
Found service Express Maillt;supgt;amp;reg;lt;/supgt; Flat Rate Envelope
Found service Express Maillt;supgt;amp;reg;lt;/supgt; Flat Rate Envelope Hold For Pickup
Found service Express Maillt;supgt;amp;reg;lt;/supgt; Legal Flat Rate Envelope
Found service Express Maillt;supgt;amp;reg;lt;/supgt; Legal Flat Rate Envelope Hold For Pickup
Found service Priority Maillt;supgt;amp;reg;lt;/supgt;
Found service Priority Maillt;supgt;amp;reg;lt;/supgt; Large Flat Rate Box
Found service Priority Maillt;supgt;amp;reg;lt;/supgt; Medium Flat Rate Box
Found service Priority Maillt;supgt;amp;reg;lt;/supgt; Small Flat Rate Box
Found service Priority Maillt;supgt;amp;reg;lt;/supgt; Flat Rate Envelope
Found service Priority Maillt;supgt;amp;reg;lt;/supgt; Legal Flat Rate Envelope
Found service Priority Maillt;supgt;amp;reg;lt;/supgt; Padded Flat Rate Envelope
Found service Priority Maillt;supgt;amp;reg;lt;/supgt; Gift Card Flat Rate Envelope
Found service Priority Maillt;supgt;amp;reg;lt;/supgt; Small Flat Rate Envelope
Found service Priority Maillt;supgt;amp;reg;lt;/supgt; Window Flat Rate Envelope
Found service First-Class Maillt;supgt;amp;reg;lt;/supgt; Parcel
Found service First-Class Maillt;supgt;amp;reg;lt;/supgt; Letter
Found service First-Class Maillt;supgt;amp;reg;lt;/supgt; Postcards
Found service First-Class Maillt;supgt;amp;reg;lt;/supgt; Large Postcards
Found service Parcel Postlt;supgt;amp;reg;lt;/supgt;
Found service Media Maillt;supgt;amp;reg;lt;/supgt;
Found service Library Mail


UPDATE: I put in this code right after the $serviceName code and it is working. It's a hack, so I'd still like to find the best solution.
Code: [Select]
$serviceName = str_replace('lt;supgt;amp;reg;lt;/supgt;','&lt;sup&gt;&amp;reg;&lt;/sup&gt;',$serviceName);