Viewing 1 replies (of 1 total)
  • Thread Starter kimsf

    (@kimsf)

    Doing more research on this. It appears that all fields that are tokenized need to have the data-stripe attribute and the name attribute removed otherwise it won’t pass it on. I’ve been trying to find a way around this and no luck.

    This is what I have put so far in the functions.php file which successfully passes on the first billing address line to stripe. However orders on Woocommerce itself are missing the first address line! I’m lost and have no idea what to do.

    add_filter( 'woocommerce_default_address_fields' , 'custom_override_default_address_fields' );
    
    function custom_override_default_address_fields( $address_fields )
    {
        $address_fields['address_1']['required'] = false;
        return $address_fields;
    }
    function add_jscript() {
    echo '<script type="text/javascript">document.getElementById("billing_address_1").removeAttribute("name");
    document.getElementById("billing_address_1").setAttribute("data-stripe","address_line1");
    </script>';
    }
    
    add_action( 'woocommerce_after_checkout_form', 'add_jscript');
Viewing 1 replies (of 1 total)
  • The topic ‘Striper doesn't send the name or any address’ is closed to new replies.