Created
December 9, 2024 16:50
-
-
Save PechenkiUA/b362c2b6d8adde031d0f1ae30a24fc5f to your computer and use it in GitHub Desktop.
Повна назва області
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// state name | |
add_filter('tscf_filter_codetemplate', function ($list, $order_id) { | |
$order = wc_get_order($order_id); | |
$billing_state_code = $order->get_billing_state(); | |
$billing_country = $order->get_billing_country(); | |
$billing_state_name = \WC()->countries->states[$billing_country][$billing_state_code] ?? $billing_state_code; | |
$list['{billing_state_name}'] = $billing_state_name; | |
return $list; | |
}, 20, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment