• Resolved mattcracow

    (@mattcracow)


    I have a code that adds a new address field (House name) to checkout.
    How can I send that information to the Shipstation?

    Is it good to use the filter ‘woocommerce_shipstation_export_address_data’ and modify ‘address1’ value?

    add_filter( 'woocommerce_checkout_fields' , 'pdb_woocommerce_checkout_fields' );
    
    function woo_checkout_fields($fields) {
       $fields['billing']['billing_housename'] = array(
            'label'     => 'Company/House Name',
            'placeholder'   => 'Company/House Name (optional)',
            'priority' => 45,
            'required'  => false
        );
    
        $fields['shipping']['shipping_housename'] = array(
            'label'     => 'Company/House Name',
            'placeholder'   => 'Company/House Name (optional)',
            'priority' => 45,
            'required'  => false,
            'class'        => array('form-row-wide', 'address-field'),
        );
    
        unset($fields['billing']['billing_company']);
        unset($fields['shipping']['shipping_company']);
    
        return $fields;
    }
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Send additional address field’ is closed to new replies.