Answers for "get post id of product variation woocommerce"

4

get product price woocommerce of specific id

$product = wc_get_product( $post_id );

$product->get_regular_price();
$product->get_sale_price();
$product->get_price();
Posted by: Guest on February-11-2021
0

get variation id from by product id

$product = wc_get_product($product_id);
$variations = $product->get_available_variations();
$variations_id = wp_list_pluck( $variations, 'variation_id' );
Posted by: Guest on December-17-2020

Code answers related to "get post id of product variation woocommerce"

Browse Popular Code Answers by Language