0
votes

I've added a custom field, and I want the label text to start on a new line. At the moment it starts between to price fields.

Can I style it? or cant I change the priority to move it to another line?

enter image description here

I am using: WooCommerce: Get custom field from product variations and display it as a suffix to variation prices

1
Show your code. Maybe it needs only to be styled via CSS.Vertisan

1 Answers

1
votes

You could add a wrapper class 'wrapper_class' => 'form-row-full',

For the wrapper_class are the other possibilities:

  • form-row-first - 50% of the width, left
  • form-row-last - 50% of the width, right
  • form-row-full - 100% of the width, full
 // 1. Add custom field input @ Product Data > Variations > Single Variation
add_action( 'woocommerce_variation_options_pricing', 'Add_bulk_price_to_variations', 10, 3 );
function Add_bulk_price_to_variations( $loop, $variation_data, $variation ) {  
    woocommerce_wp_text_input( array(
        'id' => 'bulk_price[' . $loop . ']',
        'desc_tip'    => 'true',
        'description' => __( 'Enter the Bulk price here.', 'woocommerce' ),
        'label' => __( 'Custom Field', 'woocommerce' ),
        'wrapper_class' => 'form-row-full',
        'value' => get_post_meta( $variation->ID, 'bulk_price', true ) 
    ));
}