set $method

This commit is contained in:
Mike Jolley 2015-12-17 10:15:58 +00:00
parent 0825b5001e
commit 90d472a0fe
1 changed files with 3 additions and 3 deletions

View File

@ -39,9 +39,9 @@ if ( ! defined( 'ABSPATH' ) ) {
</ul>
<?php elseif ( 1 === count( $available_methods ) ) : ?>
<?php
printf( '%3$s <input type="hidden" name="shipping_method[%1$d]" data-index="%1$d" id="shipping_method_%1$d" value="%2$s" class="shipping_method" />', $index, esc_attr( current( $available_methods )->id ), wc_cart_totals_shipping_method_label( current( $available_methods ) ) );
do_action( 'woocommerce_after_shipping_rate', $available_methods, $index );
$method = current( $available_methods );
printf( '%3$s <input type="hidden" name="shipping_method[%1$d]" data-index="%1$d" id="shipping_method_%1$d" value="%2$s" class="shipping_method" />', $index, esc_attr( $method->id ), wc_cart_totals_shipping_method_label( $method ) );
do_action( 'woocommerce_after_shipping_rate', $method, $index );
?>
<?php elseif ( ! WC()->customer->has_calculated_shipping() ) : ?>
<?php echo wpautop( __( 'Shipping costs will be calculated once you have provided your address.', 'woocommerce' ) ); ?>