Home Forums Add-ons Repeater Field Copy/Paste Repeater Field Array Reply To: Copy/Paste Repeater Field Array

  • Can you provide more info?

    How is the data being added to the contents being added to lc_photos_list in the first instance?

    If you then add info to lc_registration, does it matter what the post ID will be?

    Based on your code, something like:

    add_action( 'woocommerce_payment_complete_order_status_completed', 'lc_complete_for_status' );
    function lc_complete_for_status( $order_id ){
    	if( have_rows('lc_photos_list', 579) ):
    		 while( have_rows('lc_photos_list', 579) ) : the_row();
    			$sub_value = get_sub_field('sub_field');
    			$post_id = 576;
    			$row = array(
    				'field_61645b916cbd7'	=> $sub_value #this is your repeater field key
    			$i = add_row('field_61645b866cbd6', $row, $post_id); #this is the key for the main repeater	
    	#update_field("lc_photos_list", $copyPhotosObject, 576);

    I don’t know the repeater field info or how you get the post IDs (579/576)

    Should hopefully get you underway.

    Code is untested!