can anyone help me out with this filter?

I’m trying to change the name to billing_company.

heres the plugin code

/**
     * @return string
     */
    public function get_name() {
        return apply_filters( 'woocommerce_xero_contact_name', $this->name, $this );
    }

    /**
     * @param string $name
     */
    public function set_name( $name ) {
        $this->name = htmlspecialchars( $name );
    }

and here what ive come up with.

ive never had to create one of these from scratch so any pointers more than welcome.

  add_filter( 'woocommerce_xero_contact_name' , 'custom_override_fields222' );

 function custom_override_fields222( $this->name, $this ) {

    $this->billing_company;

    return $this->name;
}

Read more here: WordPress / Woocommerce adding a filter issues


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: