Support

Account

Home Forums General Issues Show Calculated Price on Woocommerce Product Page Reply To: Show Calculated Price on Woocommerce Product Page

  • I figured it out.

    add_action( ‘woocommerce_single_product_summary’, ‘display_custom_field’, 16 );

    function display_custom_field ( ) {
    global $product;
    $pid= $product->get_id();
    $actual_price = floatval($product->get_price());
    $custom_price= floatval(get_post_meta($pid,’case_pack’,true));
    $final_price = $actual_price * $custom_price;
    echo ‘<b>Case Price:</b>’ . ‘ $’ .$final_price;
    }