Support » Plugin: Registrations for WooCommerce » Get price form item on the loop

Viewing 1 replies (of 1 total)
  • Already solved after looking a little into the database.

    $args = array(
    ‘post_parent’ => get_the_ID(),
    ‘post_type’ => ‘product_variation’,
    ‘numberposts’ => -1,
    ‘post_status’ => ‘any’
    );
    $variation= reset(get_children( $args ));
    $ID_var = $variation->ID;
    $price = get_post_meta( $ID_var, ‘_regular_price’, true);
    $sale = get_post_meta( $ID_var, ‘_sale_price’, true);

    There’s a child post of type ‘product_variation’ that stores that information. Its not actually stored directly on the post post_meta.

Viewing 1 replies (of 1 total)
  • The topic ‘Get price form item on the loop’ is closed to new replies.