问题描述:

I want to change the title from the checkout page. But I just can change the label and the placeholder.

// 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 ) {

$fields['order']['order_comments']['placeholder'] = 'Please type your PO number here and we will add it to the invoice.';

$fields['order']['order_comments']['label'] = '';

return $fields;

}

网友答案:

As it stands there is not hook to change the section title. But here's the hack if you are desperate enough to make the modification.

  1. Locate your template folder
  2. Create a folder named 'checkout'
  3. Locate the file form-shipping.php in the Woocommerce plugin foler under templates/checkout/
  4. Copy file in step 3 to the folder created in step 2
  5. Now you have superpowers over the checkout form

Edit this line:

<h3><?php _e( 'Additional Information', 'woocommerce' ); ?></h3>
相关阅读:
Top