Support » Plugin: Advanced Custom Fields: Table Field » Add default values to cells

  • I want to create a nutrition data table for each of the products my client sells. I would like the labels (kcal, carbs, fat etc) pre populated in the table, primarily so that I can somehow (haven’t figured out exactly how to this part yet, but am going to use WP All Import) import all the product data I have and map the nutrition data to the table cells. I tried doing this by adding the ‘value’ key in the definition of the field, but it just breaks the table ūüôĀ

    Is there a way of doing what I want?

    array(
                'key' => 'field_5d0e23a3807a9',
                'label' => 'Nährwerte',
                'name' => 'nahrwerte',
                'type' => 'table',
                'instructions' => '',
                'required' => 0,
                'conditional_logic' => 0,
                'wrapper' => array(
                  'width' => '50',
                  'class' => '',
                  'id' => '',
                ),
                'wpml_cf_preferences' => 2,
                'use_header' => 1,
                'use_caption' => 2,
                'value' => array(
                  'header' => array(
                    0 => array(
                      'c' => 'Durchschnittliche Nährwerte'
                    ),
                    1 => array(
                      'c' => 'Unzubereitet pro 100 g'
                    )
                  ),
                  'caption' => false,
                  'body' => array(
                    0 => array(
                      0 => array(
                        'c' => 'Energie (kj)'
                      ),
                      1 => array(
                        'c' => ''
                      )
                    ),
                    1 => array(
                      0 => array(
                        'c' => 'Energie (kcal)'
                      ),
                      1 => array(
                        'c' => ''
                      )
                    ),
                    2 => array(
                      0 => array(
                        'c' => 'Fett'
                      ),
                      1 => array(
                        'c' => ''
                      )
                    ),
                    3 => array(
                      0 => array(
                        'c' => 'Fett, davon gesättigte Fettsäuren'
                      ),
                      1 => array(
                        'c' => ''
                      )
                    ),
                    4 => array(
                      0 => array(
                        'c' => 'Kohlenhydrate'
                      ),
                      1 => array(
                        'c' => ''
                      )
                    ),
                    5 => array(
                      0 => array(
                        'c' => 'Kohlenhydrate, davon Zucker'
                      ),
                      1 => array(
                        'c' => ''
                      ),
                    ),
                    6 => array(
                      0 => array(
                        'c' => 'Ballaststoffe'
                      ),
                      1 => array(
                        'c' => ''
                      ),
                    ),
                    7 => array(
                      0 => array(
                        'c' => 'Eiweiß'
                      ),
                      1 => array(
                        'c' => ''
                      )
                    ),
                    8 => array(
                      0 => array(
                        'c' => 'Salz'
                      ),
                      1 => array(
                        'c' => ''
                      )
                    )
                  )
                )
              )
  • You must be logged in to reply to this topic.