Support

Account

Home Forums Add-ons Repeater Field Update/ Create new repeater block with foreach loop Reply To: Update/ Create new repeater block with foreach loop

  • 
    if ($orig_cart_items) {
      $field_key = "field_59aff2511ca92";
      $value = array();
      foreach ($orig_cart_items as $item) {
        $value[] = array(
          'festival_id' => $item['show_festival_id'],
          'edition_id" => $item['show_edition_id'],
          'movie_id' => $item['show_movie_id']
        );
      } // end foreach
      update_field($field_key, $value, $post_id);
    } // end if