I'm trying to migrate products from Shopify via API. I want the products to be the same ID in woocommerce as they are in Shopify. The Product ID in Shopify consists of 13 digits e.g. 1460581269617 and it looks like wp_insert_post functions the value limit to a 10 digit number only e.g. 1548353657
So when I try to map the Shopify product ID to import_id, it automatically changes the number to some 10 digit value and save it to the database. I need to save the product ID as it is in Shopify. Looking for a way to do this.
Following is the code I'm using.
$post = array(
'import_id' => $product_id,
'post_author' => '',
'post_content' => '',
'post_excerpt' => $product_content,
'post_status' => "publish",
'post_title' => $product_title,
'post_parent' => '',
'post_type' => "product",
'post_date' => $product_created_date,
);
//Create post
$post_id = wp_insert_post( $post );