I posted a question previously about integrating FedEx shipping with a shopping cart, and it was suggested that I try Shippo.
I use the following code to get the rates:
$rates = Shippo_Shipment::get_shipping_rates(array('id'=> $shipment["object_id"]));
$json = json_decode($rates, true);
//var_dump($json);
foreach ($json["results"] as $key)
{
echo $key["amount"] . " - " . $key["servicelevel_name"] ."<br>";
}
This returns the rates fine, but the problem is that when I refresh the page to reload the rates, it doesn't return the same results.
The rates will stay the same, but sometimes it returns only 3 results, and sometimes it returns up to 7 different results.
I need to make sure it is consistently returning the same results. The following shows what will be returned after refreshing:
10.32 - Ground<br>
20.13 - 2 Day A.M.<br>
57.04 - Express Saver<br>
54.75 - First Overnight<br>
26.64 - Standard Overnight<br>
17.86 - 2 Day<br>
10.32 - Ground<br>
54.75 - First Overnight<br>
28.62 - Priority Overnight<br>
26.64 - Standard Overnight<br>
54.75 - First Overnight<br>
28.62 - Priority Overnight<br>
20.13 - 2 Day A.M.<br>
17.86 - 2 Day<br>
16.94 - Express Saver<br>
10.32 - Ground<br>
54.75 - First Overnight<br>
28.72 - Priority Overnight<br>
10.32 - Ground<br>