cgchris99 Posted July 19, 2003 Posted July 19, 2003 UPS XML module - getting ups shipment ID? In the standard ups module you can eliminate unwanted shipping methods by a reference to the ups ID. ie. 1DM is Next Day Air 1DML is Next Day Air Letter GND is ground etc. etc. I don't see this in the XML module. Anyone know how I can eliminate unwanted shipping methods for UPS? Quote
pvallen Posted July 20, 2003 Posted July 20, 2003 If you are referring to removing certain UPS package services from the array of quoted rates, here is how I did it for UPS XML Rates and Services v1.01 posted Torin Walker on July 11. For reference, these instructions apply to v1.01 of contribution: http://www.oscommerce.com/community/contributions,1323 This requires the following four changes to catalog/includes/modules/shipping/upsxml.php At original line 118 are a series of arrays of services. The following is the one or US origin: 'US Origin' => array( '01' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_01, '02' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_02, '03' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_03, '07' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_07, '08' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_08, '11' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_11, '12' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_12, '13' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_13, '14' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_14, '54' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_54, '59' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_59, '65' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_65 ), Simply comment out the UPS package services you do not want to quote/provide. So, if all you want to provide is UPS Ground from a US origin, change the above to: 'US Origin' => array( // '01' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_01, // '02' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_02, '03' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_03, // '07' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_07, // '08' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_08, // '11' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_11, // '12' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_12, // '13' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_13, // '14' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_14, // '54' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_54, // '59' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_59, // '65' => MODULE_SHIPPING_UPSXML_SERVICE_CODE_US_ORIGIN_65 ), Removing package services for other shipping origins should be obvious. Second, at original line number 650, you should find: for ($i = 0; $i < count($ratedShipments); $i++) { Place the following line ABOVE this line: $j = 0; Third, at original line number 652 you should find: if (!($serviceCode && $totalCharge)) { continue; } Place the following lines BELOW the these lines: $title = $this->service_codes[$this->origin][$serviceCode]; if ( !isset($title) ) { continue; } Fourth (and last), at original line 669, you should find: $aryProducts[$i] = array($title => $totalCharge); Replace this line with the following line: $aryProducts[$j++] = array($title => $totalCharge); Note: this last change replaces "$i" with "$j++". Good luck, Paul Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.