Skip to content

Instantly share code, notes, and snippets.

@hedqvist
Last active February 19, 2020 13:01
Show Gist options
  • Select an option

  • Save hedqvist/f768c1e8561c0c4dadc77d1cb8ce84ae to your computer and use it in GitHub Desktop.

Select an option

Save hedqvist/f768c1e8561c0c4dadc77d1cb8ce84ae to your computer and use it in GitHub Desktop.
Fortnox - Dont prefill from customer card
<?php
/**
* @snippet WooCommerce - Fortnox plugin by Redlight Media - Set Blank field in order to prevent details from customer card
* @author Redlight Media AB / Christopher Hedqvist
* @compatible WooCommerce 3.9.2
*/
function redlight_fortnox_prevent_autofill($orderData) {
if(empty($orderData['Order']['Address2'])){
$orderData['Order']['Address2'] = "API_BLANK";
}
if(empty($orderData['Order']['DeliveryAddress2'])){
$orderData['Order']['DeliveryAddress2'] = "API_BLANK";
}
return $orderData;
}
add_filter('obj_fortnox_order_data', 'redlight_fortnox_prevent_autofill', 10 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment