Jump to content

cubicdissection

Members
  • Content count

    7
  • Joined

  • Last visited

1 Follower

Profile Information

  • Real Name
    Eric Fuller
  1. cubicdissection

    USPS Rate V4, Intl Rate V2 (official support thread)

    @@kymation Thank you very much for your help - downloaded your fixed module and it works great!
  2. cubicdissection

    USPS Rate V4, Intl Rate V2 (official support thread)

    It's the original line I posted: foreach ($Package['ExtraServices']['ExtraService'] as $key => $val)
  3. cubicdissection

    USPS Rate V4, Intl Rate V2 (official support thread)

    Thanks Jim, it's the original "Extraservices" line I pasted in my first post.
  4. cubicdissection

    USPS Rate V4, Intl Rate V2 (official support thread)

    Hi Jim, Thank you very much for your reply. Here's the whole file. I've tried messing with the Special Services to no avail. By default I have them all checked to no. I also created a new item with a weight of .0625 lbs so I could pinpoint at exactly which weight the error occurred. Adding that item, in any quantity, would not cause the error. However when I added quantities of the items I normally sell, it happened right around 4 lbs. Very confusing. Any ideas you have would be super appreciated, and thanks again for jumping in to help!!! <?php /* USPS Rate V4 Intl Rate V2 - v.1.7 Copyright (c) 2012 osCbyJetta Released under the GNU General Public License */ class usps { var $code, $title, $description, $icon, $enabled; function usps() { global $order; $this->code = 'usps'; $this->title = MODULE_SHIPPING_USPS_TEXT_TITLE; $this->description = MODULE_SHIPPING_USPS_TEXT_DESCRIPTION; $this->sort_order = MODULE_SHIPPING_USPS_SORT_ORDER; $this->icon = DIR_WS_ICONS . 'shipping_usps.gif'; $this->tax_class = MODULE_SHIPPING_USPS_TAX_CLASS; $this->enabled = ((MODULE_SHIPPING_USPS_STATUS == 'True') ? true : false); if ($this->enabled == true && (int)MODULE_SHIPPING_USPS_ZONE > 0) { $check_flag = false; $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_USPS_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id"); while ($check = tep_db_fetch_array($check_query)) { if ($check['zone_id'] < 1) $check_flag = true; elseif ($check['zone_id'] == $order->delivery['zone_id']) $check_flag = true; } if ($check_flag == false) $this->enabled = false; } } function quote($method = '') { global $order, $shipping_weight, $shipping_num_boxes, $currencies, $shipping; $iInfo = ''; $methods = array(); $shipping_weight = ($shipping_weight < 0.0625 ? 0.0625 : $shipping_weight); $this->pounds = (int)$shipping_weight; //In the following line, the digit 3 represents rounding shipping weight up to 3 decimal places - 01/27/13 a.forever edit $this->ounces = ceil(round(16 * ($shipping_weight - $this->pounds), 3)); $uspsQuote = $this->_getQuote(); if (isset($uspsQuote['Number'])) return false; if ($order->delivery['country']['iso_code_2'] == 'US') { $dExtras = array(); $dOptions = explode(', ', MODULE_SHIPPING_USPS_DMST_SERVICES); foreach ($dOptions as $key => $val) if(strlen($dOptions[$key]) > 1) if ($dOptions[$key+1] == 'C' || $dOptions[$key+1] == 'S' || $dOptions[$key+1] == 'Y') $dExtras[$dOptions[$key]] = $dOptions[$key+1]; } else { $iExtras = array(); $iOptions = explode(', ', MODULE_SHIPPING_USPS_INTL_SERVICES); foreach ($iOptions as $key => $val) if(strlen($iOptions[$key]) > 1) if ($iOptions[$key+1] == 'C' || $iOptions[$key+1] == 'S' || $iOptions[$key+1] == 'Y') $iExtras[$iOptions[$key]] = $iOptions[$key+1]; if (MODULE_SHIPPING_USPS_REGULATIONS == 'True') $iInfo = '<div id="iInfo">' . '<div id="showInfo" class="ui-state-error" style="cursor:pointer; text-align:center;" onclick="$(\'#showInfo\').hide();$(\'#hideInfo, #Info\').show();">' . MODULE_SHIPPING_USPS_TEXT_INTL_SHOW . '</div>' . '<div id="hideInfo" class="ui-state-error" style="cursor:pointer; text-align:center; display:none;" onclick="$(\'#hideInfo, #Info\').hide();$(\'#showInfo\').show();">' . MODULE_SHIPPING_USPS_TEXT_INTL_HIDE .'</div>' . '<div id="Info" class="ui-state-highlight" style="display:none; padding:10px; max-height:200px; overflow:auto;">' . '<b>Prohibitions:</b><br>' . nl2br($uspsQuote['Package']['Prohibitions']) . '<br><br><b>Restrictions:</b><br>' . nl2br($uspsQuote['Package']['Restrictions']) . '<br><br><b>Observations:</b><br>' . nl2br($uspsQuote['Package']['Observations']) . '<br><br><b>CustomsForms:</b><br>' . nl2br($uspsQuote['Package']['CustomsForms']) . '<br><br><b>ExpressMail:</b><br>' . nl2br($uspsQuote['Package']['ExpressMail']) . '<br><br><b>AreasServed:</b><br>' . nl2br($uspsQuote['Package']['AreasServed']) . '<br><br><b>AdditionalRestrictions:</b><br>' . nl2br($uspsQuote['Package']['AdditionalRestrictions']) .'</div>' . '</div>'; } if (isset($uspsQuote['Package']['Postage']) && tep_not_null($uspsQuote['Package']['Postage'])) $PackageSize = 1; else $PackageSize = ($order->delivery['country']['iso_code_2'] == 'US' ? sizeof($uspsQuote['Package']) : sizeof($uspsQuote['Package']['Service'])); for ($i=0; $i<$PackageSize; $i++) { $Services = array(); $hiddenServices = array(); $hiddenCost = 0; $handling = 0; $types = explode(', ', MODULE_SHIPPING_USPS_TYPES); if (isset($uspsQuote['Package'][$i]['Error']) && tep_not_null($uspsQuote['Package'][$i]['Error'])) continue; $Package = ($PackageSize == 1 ? $uspsQuote['Package']['Postage'] : ($order->delivery['country']['iso_code_2'] == 'US' ? $uspsQuote['Package'][$i]['Postage'] : $uspsQuote['Package']['Service'][$i])); if ($order->delivery['country']['iso_code_2'] == 'US') { if (tep_not_null($Package['SpecialServices']['SpecialService'])) foreach ($Package['SpecialServices']['SpecialService'] as $key => $val) if (isset($dExtras[$val['ServiceName']]) && tep_not_null($dExtras[$val['ServiceName']]) && ((MODULE_SHIPPING_USPS_RATE_TYPE == 'Online' && $val['AvailableOnline'] == 'true') || (MODULE_SHIPPING_USPS_RATE_TYPE == 'Retail' && $val['Available'] == 'true'))) { $val['ServiceAdmin'] = $dExtras[$val['ServiceName']]; $Services[] = $val; } $cost = MODULE_SHIPPING_USPS_RATE_TYPE == 'Online' && tep_not_null($Package['CommercialRate']) ? $Package['CommercialRate'] : $Package['Rate']; $type = ($Package['MailService']); } else { foreach ($Package['ExtraServices']['ExtraService'] as $key => $val) if (isset($iExtras[$val['ServiceName']]) && tep_not_null($iExtras[$val['ServiceName']]) && ((MODULE_SHIPPING_USPS_RATE_TYPE == 'Online' && $val['AvailableOnline'] == 'True') || (MODULE_SHIPPING_USPS_RATE_TYPE == 'Retail' && $val['Available'] == 'True'))) { $val['ServiceAdmin'] = $iExtras[$val['ServiceName']]; $Services[] = $val; } $cost = MODULE_SHIPPING_USPS_RATE_TYPE == 'Online' && tep_not_null($Package['CommercialPostage']) ? $Package['CommercialPostage'] : $Package['Postage']; $type = ($Package['SvcDescription']); } if ($cost == 0) continue; foreach ($types as $key => $val) if(!is_numeric($val) && $val == $type) { $minweight = $types[$key+1]; $maxweight = $types[$key+2]; $handling = $types[$key+3]; } foreach ($Services as $key => $val) { $sDisplay = $Services[$key]['ServiceAdmin']; if ($sDisplay == 'Y') $hiddenServices[] = array($Services[$key]['ServiceName'] => (MODULE_SHIPPING_USPS_RATE_TYPE == 'Online' ? $Services[$key]['PriceOnline'] : $Services[$key]['Price'])); } foreach($hiddenServices as $key => $val) foreach($hiddenServices[$key] as $key1 => $val1) $hiddenCost += $val1; if ((($method == '' && in_array($type, $types)) || $method == $type) && $shipping_weight < $maxweight && $shipping_weight > $minweight) $methods[] = array( 'id' => $type, 'title' => str_replace(array('RM', 'TM', '**'), array('®', '™', ''), $type), 'cost' => ($cost + $handling + $hiddenCost) * $shipping_num_boxes); } if (sizeof($methods) == 0) return false; if (sizeof($methods) > 1) { foreach($methods as $c=>$key) { $sort_cost[] = $key['cost']; $sort_id[] = $key['id']; } array_multisort($sort_cost, (MODULE_SHIPPING_USPS_RATE_SORTER == 'Ascending' ? SORT_ASC : SORT_DESC), $sort_id, SORT_ASC, $methods); } $this->quotes = array( 'id' => $this->code, 'module' => $this->title . ' ' . $this->pounds . ' lbs, ' . $this->ounces . ' oz', 'methods' => $methods, 'tax' => $this->tax_class > 0 ? tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']) : null, 'icon' => tep_not_null($this->icon) || tep_not_null($iInfo) ? (tep_not_null($this->icon) ? tep_image($this->icon, $this->title) : '') . (tep_not_null($iInfo) ? '<br>' . $iInfo : '') : null); return $this->quotes; } function _getQuote() { global $order, $shipping_weight; if ($order->delivery['country']['iso_code_2'] == 'US') { $ZipDestination = substr(str_replace(' ', '', $order->delivery['postcode']), 0, 5); $request = '<RateV4Request USERID="' . MODULE_SHIPPING_USPS_USERID . '">' . '<Revision>2</Revision>'; $package_count = 0; foreach(explode(', ', MODULE_SHIPPING_USPS_TYPES) as $request_type) { if(is_numeric($request_type) || preg_match('#International#' , $request_type)) continue; $FirstClassMailType = ''; $Container = 'VARIABLE'; if (preg_match('#First\-Class#', $request_type)) { if ($shipping_weight > 13/16) continue; else { $service = 'First-Class Mail'; if ($request_type == 'First-Class MailRM Letter') $FirstClassMailType = 'LETTER'; elseif ($request_type == 'First-Class MailRM Large Envelope') $FirstClassMailType = 'FLAT'; else $FirstClassMailType = 'PARCEL'; } } elseif ($request_type == 'Media MailRM') $service = 'MEDIA'; // In the following line, changed Parcel to Standard due to USPS service name change - 01/27/13 a.forever edit elseif ($request_type == 'Standard PostRM') $service = 'PARCEL'; elseif (preg_match('#Priority MailRM#', $request_type)) { $service = 'PRIORITY COMMERCIAL'; if ($request_type == 'Priority MailRM Flat Rate Envelope') $Container = 'FLAT RATE ENVELOPE'; elseif ($request_type == 'Priority MailRM Legal Flat Rate Envelope') $Container = 'LEGAL FLAT RATE ENVELOPE'; elseif ($request_type == 'Priority MailRM Padded Flat Rate Envelope') $Container = 'PADDED FLAT RATE ENVELOPE'; elseif ($request_type == 'Priority MailRM Small Flat Rate Box') $Container = 'SM FLAT RATE BOX'; elseif ($request_type == 'Priority MailRM Medium Flat Rate Box') $Container = 'MD FLAT RATE BOX'; elseif ($request_type == 'Priority MailRM Large Flat Rate Box') $Container = 'LG FLAT RATE BOX'; elseif ($request_type == 'Priority MailRM Regional Rate Box A') $Container = 'REGIONALRATEBOXA'; elseif ($request_type == 'Priority MailRM Regional Rate Box B') $Container = 'REGIONALRATEBOXB'; elseif ($request_type == 'Priority MailRM Regional Rate Box C') $Container = 'REGIONALRATEBOXC'; } elseif (preg_match('#Express MailRM#', $request_type)) { $service = 'EXPRESS COMMERCIAL'; if ($request_type == 'Express MailRM Flat Rate Envelope') $Container = 'FLAT RATE ENVELOPE'; elseif ($request_type == 'Express MailRM Legal Flat Rate Envelope') $Container = 'LEGAL FLAT RATE ENVELOPE'; elseif ($request_type == 'Express MailRM Flat Rate Boxes') $Container = 'FLAT RATE BOX'; } else continue; $request .= '<Package ID="' . $package_count . '">' . '<Service>' . $service . '</Service>' . ($FirstClassMailType != '' ? '<FirstClassMailType>' . $FirstClassMailType . '</FirstClassMailType>' : '') . '<ZipOrigination>' . SHIPPING_ORIGIN_ZIP . '</ZipOrigination>' . '<ZipDestination>' . $ZipDestination . '</ZipDestination>' . '<Pounds>' . $this->pounds . '</Pounds>' . '<Ounces>' . $this->ounces . '</Ounces>' . '<Container>' . $Container . '</Container>' . '<Size>REGULAR</Size>' . '<Machinable>TRUE</Machinable>' . '</Package>'; $package_count++; } $request .= '</RateV4Request>'; $request = 'API=RateV4&XML=' . urlencode($request); } else { $request = '<IntlRateV2Request USERID="' . MODULE_SHIPPING_USPS_USERID . '">' . '<Revision>2</Revision>' . '<Package ID="0">' . '<Pounds>' . $this->pounds . '</Pounds>' . '<Ounces>' . $this->ounces . '</Ounces>' . '<MailType>All</MailType>' . '<GXG>' . '<POBoxFlag>N</POBoxFlag>' . '<GiftFlag>N</GiftFlag>' . '</GXG>' . '<ValueOfContents>' . ($order->info['subtotal'] + $order->info['tax']) . '</ValueOfContents>' . '<Country>' . tep_get_country_name($order->delivery['country']['id']) . '</Country>' . '<Container>RECTANGULAR</Container>' . '<Size>LARGE</Size>' . '<Width>2</Width>' . '<Length>10</Length>' . '<Height>6</Height>' . '<Girth>0</Girth>' . '<OriginZip>' . SHIPPING_ORIGIN_ZIP . '</OriginZip>' . // In the following line, changed N to Y to activate optional commercial base pricing for international services - 01/27/13 a.forever edit '<CommercialFlag>Y</CommercialFlag>' . '<ExtraServices>' . '<ExtraService>0</ExtraService>' . '<ExtraService>1</ExtraService>' . '<ExtraService>2</ExtraService>' . '<ExtraService>3</ExtraService>' . '<ExtraService>5</ExtraService>' . '<ExtraService>6</ExtraService>' . '</ExtraServices>' . '</Package>' . '</IntlRateV2Request>'; $request = 'API=IntlRateV2&XML=' . urlencode($request); } $body = ''; $http = new httpClient(); if ($http->Connect('production.shippingapis.com', 80)) { $http->addHeader('Host', 'production.shippingapis.com'); $http->addHeader('User-Agent', 'osCommerce'); $http->addHeader('Connection', 'Close'); if ($http->Get('/shippingapi.dll?' . $request)) $body = preg_replace(array('/\<sup\>\&reg;\<\/sup\>/', '/\<sup\>\&trade;\<\/sup\>/', '/\" /', '/\",/', '/\"<br>/', '/<br>/'), array('RM', 'TM', '",', '" ', '"<br>', 'BREAK'), htmlspecialchars_decode($http->getBody())); // mail(STORE_OWNER_EMAIL_ADDRESS, STORE_OWNER, $body); $http->Disconnect(); return json_decode(json_encode(simplexml_load_string($body)),TRUE); } else return false; } function install() { tep_db_query("ALTER TABLE `configuration` CHANGE `configuration_value` `configuration_value` TEXT NOT NULL, CHANGE `set_function` `set_function` TEXT NULL DEFAULT NULL"); tep_db_query("update " . TABLE_CONFIGURATION . " SET configuration_value = 'true' where configuration_key = 'EMAIL_USE_HTML'"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable USPS Shipping', 'MODULE_SHIPPING_USPS_STATUS', 'True', 'Do you want to offer USPS shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Enter the USPS User ID', 'MODULE_SHIPPING_USPS_USERID', 'NONE', 'Enter the USPS USERID assigned to you.', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_USPS_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_USPS_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_USPS_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Shipping Methods (Domestic and International)', 'MODULE_SHIPPING_USPS_TYPES', '0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00, 0, 70, 0.00', '<b><u>Checkbox:</u></b> Select the services to be offered<br><b><u>Minimum Weight (lbs)</u></b>first input field<br><b><u>Maximum Weight (lbs):</u></b>second input field<br><br>USPS returns methods based on cart weights. These settings will allow further control (particularly helpful for flat rate methods) but will not override USPS limits', '6', '0', 'tep_cfg_usps_services(array(\'First-Class MailRM Letter\', \'First-Class MailRM Large Envelope\', \'First-Class MailRM Parcel\', \'Media MailRM\', \'Standard PostRM\', \'Priority MailRM\', \'Priority MailRM Flat Rate Envelope\', \'Priority MailRM Legal Flat Rate Envelope\', \'Priority MailRM Padded Flat Rate Envelope\', \'Priority MailRM Small Flat Rate Box\', \'Priority MailRM Medium Flat Rate Box\', \'Priority MailRM Large Flat Rate Box\', \'Priority MailRM Regional Rate Box A\', \'Priority MailRM Regional Rate Box B\', \'Priority MailRM Regional Rate Box C\', \'Express MailRM\', \'Express MailRM Flat Rate Envelope\', \'Express MailRM Legal Flat Rate Envelope\', \'Express MailRM Flat Rate Boxes\', \'First-Class MailRM International Letter**\', \'First-Class MailRM International Large Envelope**\', \'First-Class Package International ServiceTM**\', \'Priority MailRM International\', \'Priority MailRM International Flat Rate Envelope**\', \'Priority MailRM International Small Flat Rate Box**\', \'Priority MailRM International Medium Flat Rate Box\', \'Priority MailRM International Large Flat Rate Box\', \'Express MailRM International\', \'Express MailRM International Flat Rate Envelope\', \'Express MailRM International Flat Rate Boxes\', \'USPS GXGTM Envelopes**\', \'Global Express GuaranteedRM (GXG)**\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Extra Services (Domestic)', 'MODULE_SHIPPING_USPS_DMST_SERVICES', 'Certified MailRM, N, Insurance, N, Adult Signature Restricted Delivery, N, Registered without Insurance, N, Registered MailTM, N, Collect on Delivery, N, Return Receipt for Merchandise, N, Return Receipt, N, Certificate of Mailing, N, Express Mail Insurance, N, Delivery ConfirmationTM, N, Signature ConfirmationTM, N', 'Included in postage rates. Not shown to the customer.', '6', '0', 'tep_cfg_usps_extraservices(array(\'Certified MailRM\', \'Insurance\', \'Adult Signature Restricted Delivery\', \'Registered without Insurance\', \'Registered MailTM\', \'Collect on Delivery\', \'Return Receipt for Merchandise\', \'Return Receipt\', \'Certificate of Mailing\', \'Express Mail Insurance\', \'Delivery ConfirmationTM\', \'Signature ConfirmationTM\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Extra Services (International)', 'MODULE_SHIPPING_USPS_INTL_SERVICES', 'Registered Mail, N, Insurance, N, Return Receipt, N, Restricted Delivery, N, Pick-Up, N, Certificate of Mailing, N', 'Included in postage rates. Not shown to the customer.', '6', '0', 'tep_cfg_usps_extraservices(array(\'Registered Mail\', \'Insurance\', \'Return Receipt\', \'Restricted Delivery\', \'Pick-Up\', \'Certificate of Mailing\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Retail pricing or Online pricing?', 'MODULE_SHIPPING_USPS_RATE_TYPE', 'Online', 'Rates will be returned ONLY for methods available in this pricing type. Applies to prices <u>and</u> add on services', '6', '0', 'tep_cfg_select_option(array(\'Retail\', \'Online\'), ', now())"); tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Rates Sort Order:', 'MODULE_SHIPPING_USPS_RATE_SORTER', 'Ascending', 'Ascending: Low to High<br>Descending: High to Low', '6', '0', 'tep_cfg_select_option(array(\'Ascending\', \'Descending\'), ', now())"); } function keys() { return array('MODULE_SHIPPING_USPS_STATUS', 'MODULE_SHIPPING_USPS_USERID', 'MODULE_SHIPPING_USPS_TAX_CLASS', 'MODULE_SHIPPING_USPS_ZONE', 'MODULE_SHIPPING_USPS_SORT_ORDER', 'MODULE_SHIPPING_USPS_TYPES', 'MODULE_SHIPPING_USPS_DMST_SERVICES', 'MODULE_SHIPPING_USPS_INTL_SERVICES', 'MODULE_SHIPPING_USPS_RATE_TYPE', 'MODULE_SHIPPING_USPS_RATE_SORTER'); } function remove() { tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function check() { if (!isset($this->_check)) { $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_USPS_STATUS'"); $this->_check = tep_db_num_rows($check_query); } return $this->_check; } } ?>
  5. cubicdissection

    USPS Rate V4, Intl Rate V2 (official support thread)

    Is this thread still the active support thread for this addon?
  6. cubicdissection

    USPS Rate V4, Intl Rate V2 (official support thread)

    Sorry for the messy post - not sure where the font changes came from and it won't let me edit it :-/
  7. cubicdissection

    USPS Rate V4, Intl Rate V2 (official support thread)

    I'm having a bit of trouble with this module myself. Whenever an international customer tries to place an order with a weight above 4 lbs, I get this error: "Warning : Invalid argument supplied for foreach() in /home/cubicdis/public_html/test/catalog/includes/modules/shipping/usps.php on line 95" As seen here: http://www.cubicdissection.com/temp/firsterrorpage.jpg If I try to continue with the order, the second page completely stops working: "Warning: Invalid argument supplied for foreach() in /home/cubicdis/public_html/test/catalog/includes/modules/shipping/usps.php on line 95 Warning: Cannot modify header information - headers already sent by (output started at /home/cubicdis/public_html/test/catalog/includes/modules/shipping/usps.php:95) in/home/cubicdis/public_html/test/catalog/includes/functions/general.php on line 33" As seen here: http://www.cubicdissection.com/temp/seconderrorpage.jpg When I open the file and go to line 95 I see this code: foreach ($Package['ExtraServices']['ExtraService'] as $key => $val) Seems like it has something to do with the extra services, all of which I have checked as "no". Can anyone help with this?
×