WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Blank Option at shipping method list (1 post)

  1. rhonz10
    Member
    Posted 1 year ago #

    Hi!

    Can anyone help me? i need to add a BLANK option on the shipping method list. the html should look like this.

    <select id="shipping_method" name="shipping_method">
    <option value="">Please Select Shipping Method</option>
    <option value="ship_method_1">ship_method_1</option>
    <option value="ship_method_2">ship_method_2</option>
    <option value="ship_method_3">ship_method_3</option>
    </select>

    i've modified/added to review-order.php

    if ( get_option('woocommerce_shipping_method_format') == 'select' ) {
     echo '<select name="shipping_method" id="shipping_method">';
     echo '<option value="blank">Please Select Shipping Method</options>';
    
    foreach ( $available_methods as $method )
     echo '<option value="' . esc_attr( $method->id ) . '" ' . selected( $method->id, $_SESSION['_chosen_shipping_method'], false ) . '>' . strip_tags( $method->full_label ) . '</option>';
    echo '</select>';

    selecting shipping method is fine, but when i select back the "blank" option, other options get "selected" and not the "blank".

    Thanks in Advance.

    http://wordpress.org/extend/plugins/woocommerce/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic