Add states to Trinidad and Tobago in WooCommerce

You can add states to Trinidad and Tobago using the code below.

add_filter( 'woocommerce_states', 'wc_tt_states_mods' );
 
function wc_tt_states_mods ( $states ) {
 
  $states['TT'] = array(
          'TT-POS' => __( 'Port of Spain', 'woocommerce' ),
          'TT-SFO' => __( 'San Fernando', 'woocommerce' ),
  );
 
  return $states;
}

You can extend the states by adding additional states to the $states array.

This code can be added following the instructions here:

How to add custom code to your WooCommerce/WordPress site the right way

Have any feedback? Be sure to let me know here: Contact me

Share your thoughts

Your email address will not be published. Required fields are marked *