Hi.
I would like to know how to copy woocom info into custom fields.
Below is a basic example of me trying to add the product length to a variable then updating a custom field on save… Any ideas?
function my_acf_save_prod( $post_id ) {
global $product;
if ( 'product' == $post_type ) {
$p_width = $product->get_width();
update_field('productsheetareacm2', $p_width);
}
}
add_action('acf/save_post', 'my_acf_save_prod', 20);