Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
* Add a custom text input field to the product page
function plugin_republic_add_text_field() { ?>
<div class="pr-field-wrap">
<label for="pr-field"><?php _e( 'Your name', 'plugin-republic' ); ?></label>
<input type="text" name='pr-field' id='pr-field' value=''>
<?php }
add_action( 'woocommerce_before_add_to_cart_button', 'plugin_republic_add_text_field' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.