Support

Account

Home Forums Front-end Issues Display on Product

Unread

Display on Product

  • I have created a field group called “pick_up_location” as a mandatory field on the product creation of Woocommerce, and I generated the PHP as per below, but now I am totally lost as to where to put this code. I added it to the functions.php file but it still does not display the field on the Woocommerce product.

    if( function_exists(‘acf_add_local_field_group’) ):

    acf_add_local_field_group(array(
    ‘key’ => ‘group_5c07939362208’,
    ‘title’ => ‘Pick Up Location’,
    ‘fields’ => array(
    array(
    ‘key’ => ‘field_5c07939fec955’,
    ‘label’ => ‘Pick Up Location’,
    ‘name’ => ‘pick_up_location’,
    ‘type’ => ‘text’,
    ‘instructions’ => ‘Where will this product be collected from?’,
    ‘required’ => 1,
    ‘conditional_logic’ => 0,
    ‘wrapper’ => array(
    ‘width’ => ”,
    ‘class’ => ”,
    ‘id’ => ”,
    ),
    ‘default_value’ => ”,
    ‘placeholder’ => ”,
    ‘prepend’ => ”,
    ‘append’ => ”,
    ‘maxlength’ => ”,
    ),
    ),
    ‘location’ => array(
    array(
    array(
    ‘param’ => ‘post_type’,
    ‘operator’ => ‘==’,
    ‘value’ => ‘product’,
    ),
    ),
    ),
    ‘menu_order’ => 2,
    ‘position’ => ‘acf_after_title’,
    ‘style’ => ‘default’,
    ‘label_placement’ => ‘left’,
    ‘instruction_placement’ => ‘field’,
    ‘hide_on_screen’ => ”,
    ‘active’ => 1,
    ‘description’ => ‘Location’,
    ));

    endif;

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.