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 get default variation ID (woocommerce)
- How to store the_title() into a variable to reutrn the value, not just echo it
- WooCommerce: How to display item meta data in email confirmation using woocommerce_order_item_meta_end
- How to get the original price of the product in woocommerce?
- 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
- Output a WooCommerce product custom field in WooCommerce using get_post_meta()
- WooCommerce: update custom fields after checkout validation failure
- Use is_product_category() properly
- Woocommerce – remove product from category
- Changing Woocommerce flat rate every nth number of items
- Count the number of times the search form template gets included on a page
- How do I display a user’s previous orders as a select box option on a product?
- How do you add customer capability after Woocommerce purchase?
- tracking number field in Woocommerce order [closed]
- Image as Sales Badge
- How to put a variable in a instance in the widget
- Two Different Links for Same Product – WooCommerce [closed]
- Auto-update products after they were published – Woocommerce
- How to VAR_DUMP a $variable during checkout process (Is my product meta callable?)
- Display a specific category of products in shop page and disable code for specific actions
- Woocommerce related product text
- Is it possible to intercept all ajax requests and get the parameters and the returns?
- WooCommerce: How can I get orders with a custom ID in order meta data object?
- How can I get the values of my WordPress $wpdb query in Jquery?
- 3 Slashes appear after Apostrophe in custom fields after updating product-site
- Trouble checking if custom woocommerce checkout field is empty or not
- Incorrect amount of posts returned when filtering related Woo products by custom taxonomy
- Validation algorithm in checkout field
- My new button is in the wrong place
- Trying to retrieve post meta
- Redirect to another page using contact form 7? [closed]
- 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?
- Creating WordPress Shortcode with Variable
- require_once() if a product in woocommerce contains a tag [closed]
- 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]
- How do I change this function from two returns to one string to show sku and dimensions in WooCommerce cart?
- woocommerce specific quantities for product
- Personalize checkout text
- CSS change in woo commerce Place Order Text [closed]
- woocommerce related product title length
- How to add data to a custom field at the wp_users table?
- How to reference PHP in Javascript
- Overide Variable in Child Theme
- Hide a div when a custom field is empty
- Woocommerce order status payment
- Dynamically added custom fields not displayed on WooCommerce email notifications
- 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
- How to send a php var to jQuery Ajax call with two different file
- Display custom field value in woocommerce variable product via jQurey
- Products listing check if meta checkbox is checked
- Billing detail page doesn’t work after I’ve changed the order of the Woocommerce navigation
- 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
- Trying to add some custom text into WordPress Post title via function.php
- Discount in the specific product title using keyword ( Woocoommerce )
- Including user data in “new user notification email”
- 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?
- Woocommerce textarea format ignored
- Woocommerce Add custom “Add to cart button” in single page with tags
- Add missing alt tag to featured images for “storefront” theme
- Display text of price (minus 20%) on every product page in a sentence.
- Pulling a variable into the wp_nav_menu function
- Use WP_Query Data In Cookie
- Woocommerce Price Text
- Display custom meta box in my template file
- How to get the rating value of each comment
- Setting WooCommerce currency programmatically
- Woocommerce – Shipping tax class based on cart items not using the highest tax available
- Appending an ACF custom field to the page title
- WP query with variables gives no result for specific user
- WooCommerce – Show ‘Sales’ badge on variable products where only some variations have sales price [closed]
- posts_clauses drop ACF get_field function
- Replace the image of a product with its video in the shop page
- Grabbing value of input field inside of array
- Automatically change insurance quantity based on cart total [closed]
- How call WordPress shortcode inside function file
- strict custom php script on specific product category [closed]
- How to pass value to add_filter wpcf7_form_tag from another function?
- How to change product title color in shop page if product has specific product tag (Woocommerce)?
- Exclude function for custom pages, exclude custom ACF fields
- Get check box values inside array for use in posting form data
