Hi Pavel,
Thank you for your quick answer.
I have tried the code below in my functions.php, but the site lost, "white screen of death":
add_action('pmxi_saved_post', 'after_wpai_post_saved');
function after_wpai_post_saved($id) {
// get custom field
$purchase_price = get_post_meta($id, '_atum_purchase_price', true);
// Insert the field into the database
if( $purchase_price !== FALSE ){
$wpdb->update(
"{$wpdb->prefix}atum_product_data",
array(
'purchase_price' => $purchase_price,
),
array(
'product_id' => $id
),
array('%f'),
array('%d')
);
}
// Clean up unneeded custom field (OPTIONAL)
delete_post_meta( $id, '_atum_purchase_price' )
}
I am looking forward to your answer.
Best regards,
Nick