Unable to call woocommerce hook in my custom php file

You are doing it all wrong, place your code like the following in your file.

<?php

echo 'hook called'; // This is not showing any message
    exit();

global $woocommerce;
$product_id = $_POST['selected_package_id'];

echo $product_id; // This is not displaying id
exit();

$found = false;
//check if product already in cart
if ( sizeof( WC()->cart->get_cart() ) > 0 ) {
    foreach ( WC()->cart->get_cart() as $cart_item_key => $values ) {
        $_product = $values['data'];
        if ( $_product->id == $product_id )
            $found = true;
    }
    // if product not found, add it
    if ( ! $found ){
        WC()->cart->add_to_cart( $product_id );
    }
} else {
    // if no products in cart, add it
    WC()->cart->add_to_cart( $product_id );
}

The approach you are using to do it by hooks is not correct.