1. Home
  2. Docs
  3. WooCommerce Order Builder
  4. Actions and Filters
  5. wwob_add_items_field

wwob_add_items_field

Use this action to add an additional field within items repeatable field inside WWOB metabox.

The following example will add a description field to product items:

[enlighter lang=”php”]
add_action( ‘wwob_add_items_field’, ‘wwob_add_items_field’, 2, 10 );
function wwob_add_items_field($value, $field_type_object){

$value = wp_parse_args($value, array(
‘product-description’ => ”,

));
?>

input( array(
‘name’ => $field_type_object->_name( ‘[product-description]’ ),
‘id’ => $field_type_object->_id( ‘_product_description’ ),
‘value’ => $value[‘product-description’],
‘placeholder’ => ‘extra description field’,

) );
?>

Placement

This code should be placed in the functions.php file of your active theme.

Was this article helpful to you? Yes 1 No 2