The meta box template for the variations is defined in the file html-variation-admin.php. There you will find the hook “woocommerce_variation_options_pricing”. With this hook you can add your input field to the desired place.
function variation_settings_fields($loop, $variation_data, $variation)
{
// Your Text Field
woocommerce_wp_text_input(
array(
'id' => '_text_field[' . $variation->ID . ']',
'label' => __('My Text Field', 'woocommerce'),
'placeholder' => 'http://',
'wrapper_class' => 'form-row',
'desc_tip' => 'true',
'description' => __('Enter the custom value here.', 'woocommerce'),
'value' => get_post_meta($variation->ID, '_text_field', true)
)
);
}
add_action('woocommerce_variation_options_pricing','variation_settings_fields');
Related Posts:
- How to automatically apply woocommerce product title to all product images alt tags?
- Cleanest/Fastest way to avoid calling and retrieving data from the database multiple times?
- WP All Import / Update stock quantity from multiple XML files
- Best way to use variables in multiple functions?
- How to store the_title() into a variable to reutrn the value, not just echo it
- How do I make my function add variables/values to the $post object?
- Woocommerce auto cancel On-Hold after X days
- Add custom field to attachments in a specific category
- WooCommerce – Customer Order History Pagination
- The values of custom fields are not available functions.php
- How can update custom meta for all posts
- How do I know what variables are passed in a filter/action and what their meaning is?
- WooCommerce – Display variation custom field value [closed]
- Woocommerce: Is it possible to overide the settings for allowing to purchase out of stock products [closed]
- Woocommerce HTML email option unavailable
- How to add SVG icon above product tab title
- Use is_product_category() properly
- Changing Woocommerce flat rate every nth number of items
- Count the number of times the search form template gets included on a page
- Limiting woocommerce line_total decimal length
- How do I display a user’s previous orders as a select box option on a product?
- WooCommerce – Reset quantity input field when variation changes
- Automatically remove a canceled order in Woocommerce
- Call global variable array() in woocommerce child/template
- Passing the custom field values in the wp_get_current_user array function
- Two Different Links for Same Product – WooCommerce [closed]
- Get value from shortcode to do something
- How can I apply_filters from inside a function?
- Pass Category Name, Description and Photo into variables to pass to jQuery
- Auto-update products after they were published – Woocommerce
- How to VAR_DUMP a $variable during checkout process (Is my product meta callable?)
- Woocommerce related product text
- Woocommerce: hook action/filter I could use to add variation id and price with each attribute opt on WooCommerce Rest api
- Firing schema via code in functions.php doesn’t work
- Is it possible to intercept all ajax requests and get the parameters and the returns?
- Incorrect amount of posts returned when filtering related Woo products by custom taxonomy
- Which PHP page is the Default Posts Page
- How to check if a PHP string is different than meta field?
- Why does this update_post_meta function not delete the custom field itself?
- How to show/hide php table rows based on the content of custom fields
- Custom meta box values are not getting saved for my custom post type
- Add product to cart for user – WC()->cart->add_to_cart [closed]
- woocommerce specific quantities for product
- Personalize checkout text
- CSS change in woo commerce Place Order Text [closed]
- Problem with adding custom CSS class to image in ACF Photo Gallery plugin [closed]
- Overide Variable in Child Theme
- Custom Taxonomy Select Menu: Setting default option value?
- Hide a div when a custom field is empty
- Conditional On custom field plugin metabox
- Execute PHP code only with specific user role
- Woocommerce Custom Meta Boxes- How to only display if they actually have content
- Modify WooCommerce used to get all orders in dashboard
- Output product category link from WP_Query
- Delete images from media library when user deletes an image from ACF Gallery
- Updating Metadata with Shortcode
- How to send a php var to jQuery Ajax call with two different file
- Woocommerce My acount page
- Woocommerce – Exclude variation attribute on specific variation
- Products listing check if meta checkbox is checked
- Is it possible to update the dataset using update_post_meta
- Billing detail page doesn’t work after I’ve changed the order of the Woocommerce navigation
- PHP function for horizontal Woocommerce thumbnails and badges
- global $product is empty string when passed into function
- Block error message in foreach loop when looping through ACF field
- Run a sql (update) after 12 hours after the user login. Woocommerce users
- Hide a div if the fiels is empty
- Custom global variable not working in function
- Hide payment method based on user role AND minimum cart value
- WooCommerce display price before add to cart [closed]
- Trying to add some custom text into WordPress Post title via function.php
- Reduce Stock Based on Custom Variation Field Rather than Attribute (Working Script)
- Woocommerce – if selected attribute term equals
- split 1 cart item into instock and back ordered
- Adding product permalink on admin order page throwing error
- How do I get the value of a current user’s custom field?
- Add Product Permalink in woocommerce admin order page
- How to override WooCommerce Order Item Meta with data from Cart?
- WP_Query To Display Product Of Brand On Taxonomy Page
- Store custom field’s multiple values in one user meta key
- Get field in readable word
- WooCommerce multiple custom fields code
- Display text of price (minus 20%) on every product page in a sentence.
- Pulling a variable into the wp_nav_menu function
- Where can I find the declaration of `$_wp_theme_features`?
- Use WP_Query Data In Cookie
- ACF Date fileds to Age Convert [closed]
- Setting WooCommerce currency programmatically
- Appending an ACF custom field to the page title
- Warning: Attempt to read property “term_id” on int – Woocommerce
- WooCommerce – Show ‘Sales’ badge on variable products where only some variations have sales price [closed]
- posts_clauses drop ACF get_field function
- Grabbing value of input field inside of array
- Hide child of parent categories already hidden with “get_terms_args” – Woocommerce
- Automatically change insurance quantity based on cart total [closed]
- Change WooCommerce Order status from frontend form submitted data
- How to pass value to add_filter wpcf7_form_tag from another function?
- Custom Admin Menu Report for Specific User ID
- Add text below WooCommerce short description if metabox value is true
- ACF number less than comparison not working