@pvfexcess
import the data into the following custom fields:
_atum_purchase_price
_atum_seller_id
_atum_supplier_sku
And copy the code into functions.php
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);
$seller_id = get_post_meta($id, '_atum_seller_id', true);
$supplier_sku = get_post_meta($id, '_atum_supplier_sku', true);
$data = [];
if( $purchase_price != ""){
$data['purchase_price'] = $purchase_price;
}
if( $seller_id != ""){
$data['seller_id'] = $seller_id;
}
if( $supplier_sku != ""){
$data['supplier_sku'] = $supplier_sku;
}
// Insert the field into the database
if( !empty($data) ){
$wpdb->update(
"{$wpdb->prefix}atum_product_data",
$data,
array(
'product_id' => $id
),
array('%s'),
array('%d')
);
}
}```