I want to know how do I display programmatically inserted product pricing in single product page?
Product pricing is saved using this code but it's not visible in frontend
//Starting scrape
$html = file_get_html('http://sitenam.com/page-1/');
$price = $html->find('span[class="price"]', 0)->innertext;
//Starting post
$post = array(
'post_author' => 1,
'post_content' => 'Content Here',
'post_status' => "publish",
'post_title' => "Product Title Here",
'post_parent' => "product-title-here",
'post_type' => "product",
);
$post_id = wp_insert_post( $post, $wp_error );
wp_set_object_terms( $post_id, 'simple', 'product_type' );
add_post_meta( $post_id, '_regular_price', $price );