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

One thought on “Add states to Trinidad and Tobago in WooCommerce

  1. I have a problem.
    In my website checkout page, when i select a Shipping Fee and then the Credit Card payment method the Shipping Fee is adding to the checkout total.
    But, when i choose any other payment method the Shipping Fee is NOT adding to the checkout total.
    What is causing this issue ?
    I am trying to narrow out the possibilities. Is it because of:
    1. The Theme i am using. If so before it was fine
    2. The Payment Plugins that i am using

    Can you help me !

Share your thoughts

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