Created
December 15, 2014 20:47
-
-
Save bavington/e11d6bc3b50e3c1c0b8c to your computer and use it in GitHub Desktop.
WooCommerce Getting the Regular 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
$regular_price = get_post_meta( get_the_ID(), '_regular_price', true); | |
if ($regular_price == ""){ | |
$available_variations = $product->get_available_variations(); | |
$variation_id=$available_variations[0]['variation_id']; | |
$variable_product1= new WC_Product_Variation( $variation_id ); | |
$regular_price = $variable_product1 ->regular_price; | |
} | |
echo $regular_price; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment