Snippets

Dan Bochichio Woocommerce Default Location Checkout

Updated by Dan Bochichio

File woo-default-location Added

  • Ignore whitespace
  • Hide word diff
+/**
+* Manipulate default state and countries
+*
+* As always, code goes in your theme functions.php file
+*/
+add_filter( 'default_checkout_country', 'change_default_checkout_country' );
+add_filter( 'default_checkout_state', 'change_default_checkout_state' );
+function change_default_checkout_country() {
+return 'XX'; // country code
+}
+function change_default_checkout_state() {
+return 'XX'; // state code
+}

File woo-default-location.php Deleted

  • Ignore whitespace
  • Hide word diff
-/**
-* Manipulate default state and countries
-*
-* As always, code goes in your theme functions.php file
-*/
-add_filter( 'default_checkout_country', 'change_default_checkout_country' );
-add_filter( 'default_checkout_state', 'change_default_checkout_state' );
-function change_default_checkout_country() {
-return 'XX'; // country code
-}
-function change_default_checkout_state() {
-return 'XX'; // state code
-}
Created by Dan Bochichio

File woo-default-location.php Added

  • Ignore whitespace
  • Hide word diff
+/**
+* Manipulate default state and countries
+*
+* As always, code goes in your theme functions.php file
+*/
+add_filter( 'default_checkout_country', 'change_default_checkout_country' );
+add_filter( 'default_checkout_state', 'change_default_checkout_state' );
+function change_default_checkout_country() {
+return 'XX'; // country code
+}
+function change_default_checkout_state() {
+return 'XX'; // state code
+}