This is my test code I am using at the moment
add_action('save_post_product', 'rl_acf_test', 999);
function rl_acf_test($post_id) {
// Avoid infinite loop when using update_field()
remove_action('save_post_product', __FUNCTION__);
// Check if stock is managed
$product = wc_get_product($post_id);
if (!$product ) {
return;
}
// Update the repeater
$rows = [[
'event_date' => "30062025",
'shipping_date' => "30062025",
'return_send_date' => "30062025",
'return_arrival_date' => "30062025",
]];
//$status = update_field($repeater_name, $new_rows, $post_id);
//$status = update_field($acfFieldObject['key'], $rows, $post_id);
$status = update_field('rental_info', $rows, $post_id);
error_log("Status is: " . var_export($status,true));
$product->save();
}
I am unable to post reply with my code. Submitting, screen refreshes and reply is not posted.
Tried different machines and browsers.