• Resolved kosukekawa

    (@kosukekawa)


    I have added a new column using “woocommerce_shipping_instance_form_fields_free_shipping” Or
    “woocommerce_shipping_instance_form_fields_XX”

    It exactly added however, the label and input text and the input parent “fieldset” selectors are added “style =”display:None”.

    This problem is only for “FreeShipping”.
    “Flat Rate” and “PickUp” are no problem.

    I use following version.
    WordPress version:6.4.3
    Woocommerce version:8.7.0

    Please help this.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support omarfpg a11n

    (@omarfpg)

    Hi @ kosukekawa,

    Can you please share more details about this? Where did you add a new column? It seems to me it was to your checkout form, correct? Which code exactly did you use to do this? Can you share a link to your page to learn more?

    Thanks!
    -OP

    Thread Starter kosukekawa

    (@kosukekawa)

    Hi,

    Let me explain that.

    First, I added this filter on cutomized plugin

    //Adding WB Location ID
    add_action('woocommerce_init', 'woocommerce_shipping_instances_form_fields_filters');
    function woocommerce_shipping_instances_form_fields_filters(){
        foreach( WC()->shipping->get_shipping_methods() as $shipping_method ) {
            add_filter('woocommerce_shipping_instance_form_fields_' . $shipping_method->id, 'shipping_methods_additional_custom_field',21);
        }
        // Free Shipping
        // add_filter('woocommerce_shipping_instance_form_fields_free_shipping', 'shipping_methods_additional_custom_field',20);
    }
    
    function shipping_methods_additional_custom_field( $settings ) {
        $settings['wb_location_id'] = array(
            'title'         => __('WB Location ID', 'woocommerce'),
            'type'          => 'text', 
            'placeholder'   => __( 'Enter WhiteBase Location ID.', 'woocommerce' ),
        );
        return $settings;
    }

    It affects below:
    Admin panel > WooCommerce > Settings > Shipping > Shipping Zone

    Edit any Zone Name

    They are Shipping method flat rate/local pickup/FreeShipping. You can find that only Freeshipping doesn’t show “WB location ID”

    Flat Rate

    Pick Up

    FreeShipping

    And the console shows it exactly generate HTML code with “WB location ID”

    It is admin panel. So I need to share URL with password. How can I share it?

    Best regards,

    Plugin Support Shameem a11n

    (@shameemreza)

    Hi @kosukekawa,

    For reference, these particular forums are meant for general support with the core functionality of WooCommerce itself. For development and custom coding questions, it’s best to ask for insight related to those on either the WooCommerce Advanced Facebook group or the WooCommerce Community Slack. Many of our developers hang out there and will be able to offer insights into your question. You can also seek help from the following:

    I wish I could help more, but hopefully, this gets you going in the right direction to get some further insight/information.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘display none with woocommerce_shipping_instance_form_fields_free_shipping’ is closed to new replies.