Skip to content

Instantly share code, notes, and snippets.

@hedqvist
Created July 27, 2020 09:12
Show Gist options
  • Select an option

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

Select an option

Save hedqvist/aa06b59f683281bcefc9b781020e4653 to your computer and use it in GitHub Desktop.
Fortnox - South Korea Temp Fix
<?php
/**
* @snippet WooCommerce -Fortnox - Solve South Korea until Fortnox fixes backend
* @author Redlight Media AB / Christopher Hedqvist
* @compatible WooCommerce 4.1.0
*/
function redlight_fortnox_south_korea( $orderData, $order_id) {
//$order = new WC_Order($order_id);
if( $orderData['Order']['Country'] == 'South Korea' ){
$orderData['Order']['Country'] = 'Korea, Republic of';
}
if( $orderData['Order']['DeliveryCountry'] == 'South Korea' ){
$orderData['Order']['DeliveryCountry'] = 'Korea, Republic of';
}
return $orderData;
}
add_filter('obj_fortnox_order_data', 'redlight_fortnox_south_korea', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment