| @@ 611-621 (lines=11) @@ | ||
| 608 | throw new Exception( __( 'Unable to find shipping method for address.', 'woocommerce-gateway-stripe' ) ); |
|
| 609 | } |
|
| 610 | ||
| 611 | foreach ( $package['rates'] as $key => $rate ) { |
|
| 612 | $data[] = array( |
|
| 613 | 'id' => $rate->id, |
|
| 614 | 'label' => $rate->label, |
|
| 615 | 'amount' => array( |
|
| 616 | 'currency' => $currency, |
|
| 617 | 'value' => $rate->cost, |
|
| 618 | ), |
|
| 619 | 'selected' => false, |
|
| 620 | ); |
|
| 621 | } |
|
| 622 | } |
|
| 623 | ||
| 624 | // Auto select the first shipping method. |
|
| @@ 232-242 (lines=11) @@ | ||
| 229 | break; |
|
| 230 | } |
|
| 231 | ||
| 232 | foreach ( $package['rates'] as $key => $rate ) { |
|
| 233 | $data[] = array( |
|
| 234 | 'id' => $rate->id, |
|
| 235 | 'label' => $rate->label, |
|
| 236 | 'amount' => array( |
|
| 237 | 'currency' => $currency, |
|
| 238 | 'value' => $rate->cost, |
|
| 239 | ), |
|
| 240 | 'selected' => false, |
|
| 241 | ); |
|
| 242 | } |
|
| 243 | } |
|
| 244 | } |
|
| 245 | ||