/*Woocommerce Price Shortcode */ function shortcode_for_woo_price ( $atts ) { $atts = shortcode_atts( array( 'id' => null ), $atts, 'product_price' ); if ( empty( $atts[ 'id' ] ) ) { return ''; } $product = wc_get_product( $atts['id'] ); if ( ! $product ) { return ''; } return $product->get_price_html(); } add_shortcode( 'product_price', 'shortcode_for_woo_price' ); --------------------Use the following shortcode on any pages------------ [product_price id = ""] /?add-to-cart=10 [product_price id = "10"]