WooCommerce Change Form Labels and Remove Fields

后端 未结 3 1143
终归单人心
终归单人心 2021-01-20 06:16

I\'m trying to customise WooCommerce checkout page, how can I edit field labels?

Also, how can I remove 2 fields from the form? I don\'t need Company an

3条回答
  •  再見小時候
    2021-01-20 06:43

    I recommend making a custom plugin that modifies this so you can easily upgrade WooCommerce at a later date.

    In your custom plugin, implement some of the code found on here: http://wcdocs.woothemes.com/snippets/tutorial-customising-checkout-fields-using-actions-and-filters/

    For example, to remove Company and State:

    // Hook in
    add_filter( 'woocommerce_checkout_fields', 'custom_override_checkout_fields' );
    // Our Hooked in function - $fields is passed via the filter
    function custom_override_checkout_fields( $fields) {
        unset($fields['shipping']['shipping_state']);
        unset($fields['shipping']['shipping_company']);
        return $fields;
    }
    

    If you need help making a Plugin, I made a guide on how to add custom fields to the Product page. I think it might be helpful in this context. http://www.xatik.com/2013/02/06/add-custom-form-woocommerce-product/

提交回复
热议问题