Created
April 10, 2019 18:44
-
-
Save gareth-gillman/86890e6ee6e7b0b5bf3b944ef04939f3 to your computer and use it in GitHub Desktop.
get product price
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add Shortcode | |
function gg_price_shortcode( $atts ) { | |
$product = wc_get_product( $post_id ); | |
echo $product->get_price_html(); | |
} | |
add_shortcode( 'product-price', 'gg_price_shortcode' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment