We need to access the company name from the checkout form in WooCommerce, inside the calculate_shipping (from Shipping Method API) when calculating the shipping options, but it only seems to have the array $package available which in turn just have access to a stripped down version of the $package['destination'] address fields. There is no $package['destination']['company'].
The company name form field in checkout
As part of the Billing address;
<input type="text" class="input-text " name="billing_company" id="billing_company" placeholder="" value="" autocomplete="organization">
As part of the Shipping address;
<input type="text" class="input-text " name="shipping_company" id="shipping_company" placeholder="" value="" autocomplete="organization">
Is there a way to directly access what is entered into the "shipping_company" or "billing_company" textfields or by any other means know if the customer is a company or private person?
I've tried WC()->checkout->get_value( 'shipping_company' ) but that doesn't return the text and there is no $_POST['shipping_company'] or $_POST['billing_company'] despite the AJAX hook when changing address details.