I'm looking for a solution to add WooCommerce shipping address form in single product page, before add to cart button. To be more specific, I'm using WooCommerce Shipping Multiple Addresses plugin which allows clients to use different delivery addresses for products in cart.
After trying different hooks, this seems to be real pain for me to achieve this.
Here's an example what I tried.
// Add shipping addresses form within single product pages
function filter_woocommerce_shipping_fields() {
$address_fields = apply_filters('woocommerce_shipping_fields', $address_fields);
return $address_fields;
}
add_action( 'woocommerce_before_add_to_cart_button', 'filter_woocommerce_shipping_fields' );
Is this approach completely wrong or am I on a right track?
I'm new with WooCommerce hooks.