You'll need to 'bump up' an if-clause to re-parse the quotes, capturing the "Flat" value for later use when inserting that quote into the USPS card. The $i loop-level is on a per-shipping-module basis and the $j loop gathers the method(s) provided by the current shipping module.
Code:
<?php
} else {
$radio_buttons = 0;
for ($i = 0, $n = count($quotes); $i < $n; $i++) {
// bof: field set
// allows FedEx to work comment comment out Standard and Uncomment FedEx
// if (!empty($quotes[$i]['id']) || !empty($quotes[$i]['module'])) { // FedEx
if (!empty($quotes[$i]['module'])) { // Standard
?>
<!--bof shipping method option card-->
<div class="card mb-3">
<div class="card-header">
<?php echo $quotes[$i]['module']; ?>
<?php
if (!empty($quotes[$i]['icon'])) {
echo $quotes[$i]['icon'];
}
?>
</div>
<div class="card-body p-3">
<?php
if (isset($quotes[$i]['error'])) {
?>
<div><?php echo $quotes[$i]['error']; ?></div>
<?php
} else {
for ($j = 0, $n2 = count($quotes[$i]['methods']); $j < $n2; $j++) {
// set the radio button to be checked if it is the method chosen
$checked = false;
if (isset($_SESSION['shipping']) && isset($_SESSION['shipping']['id'])) {
$checked = ($quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'] == $_SESSION['shipping']['id']);
}
if ($n > 1 || $n2 > 1) {
?>
Bookmarks