Error in snippet to update checkout label
-
I’m trying to update the label on the billing_phone field using the following code snippet:
// 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['billing']['billing_phone']['label'] = 'Phone (10 digits only - i.e. 216555111) '; return $fields; }
I’ve gotten the base code here from a couple WooCommerce sources (this is one: https://woocommerce.com/posts/customize-checkout-fields-woocommerce/) so I’m pretty sure my hooks are correct. But when I try to Save & Activate this snippet I get the error:
The snippet has been deactivated due to an error on line 6: Cannot redeclare function custom_override_checkout_fields.
(line 6 is the line beginning $fields in the function)
The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Error in snippet to update checkout label’ is closed to new replies.