• Resolved bash88

    (@bash88)


    Hi Guys,

    For shipping I needed to add a custom house number field next to the address_1 checkout field in WooCommerce. Because address numbers are now no longer entered in the address_1 field they don’t show up in Mollie. So the addresses for payments are number-less.

    I was looking for a hook in the plugin to add my custom house number field to the address before sending it to Mollie. I didn’t find any dev docs for the plugin anywhere.

    How would I accomplish this?

    Regards,
    Bas

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor davdebcom

    (@davdebcom)

    Hi @bash88

    What for example MyParcel does, is that they only un-merge the data for their own uses, and keep it merged in the database. Or, at least I believe that is what they do. That’s only possible solution.

    But there is also a filter for the payment request data, see:
    https://github.com/mollie/WooCommerce/blob/master/mollie-payments-for-woocommerce/includes/mollie/wc/gateway/abstract.php#L437

    Kind regards
    David

    Thread Starter bash88

    (@bash88)

    Hi @davdebcom

    Thanks for pointing me in the right direction. For anyone else looking for this, here’s a short explanation.

    add_filter( 'woocommerce_mollie_wc_gateway_creditcard_args', 'filter_mollie_payment_data', 10, 2 );
    
    function filter_mollie_payment_data($data, $order) {
    ...
    get custom housenumber field and add to $data
    ...
    return $data;
    }

    Note that you have to add a filter for each payment gateway you use. Above is for creditcard. Other gateway filters would look like: ‘woocommerce_mollie_wc_gateway_[gateway]_args’.

    Regards,
    Bas

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Custom house number field’ is closed to new replies.