wpsc_shipwire_methods

Located in: shipwire_functions.php

Functions that call this hook: fetch_fresh_quotes() ()

Arguments Accepted: $methods, $quotes

Version Introduced: 3.8.9

Description: Filter the methods returns – the $methods array and $quotes object are both passed to the filter

Code in context:

[php highlight=”559″ firstline=”541″]

public static function fetch_fresh_quotes() {

$quotes = simplexml_load_string( self::send_shipping_request( self::get_shipping_xml() ) );

$methods = array();

$quotes = is_object( $quotes ) ? $quotes->Order->Quotes->Quote : $methods;

if ( ! is_object( $quotes ) )

return $methods;

foreach ( $quotes as $quote ) {

$service = (string) $quote[‘method’];

$service = convert_code_to_service( $service );

$cost = (string) $quote->Cost;

$methods[$service] = $cost;

}

$methods = apply_filters( ‘wpsc_shipwire_methods’, $methods, $quotes );

set_transient( self::get_cache_key(), $methods, apply_filters( ‘wpsc_shipwire_rates_cache_expiration’, 60 * 60 ) );

return $methods;

}

[/php]