Created
May 12, 2015 19:17
-
-
Save DanielSantoro/6f35d76717a8f23d30b3 to your computer and use it in GitHub Desktop.
Sell only to CA - Single Shipping Class
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 | |
| /** | |
| * Looking to make a shipping class only eligable for a specific state | |
| */ | |
| add_filter( 'woocommerce_states', 'wc_sell_only_states' ); | |
| function wc_sell_only_states( $discountstates ) { | |
| $discountstates['US'] = array( | |
| 'CA' => __( 'California', 'woocommerce' ), | |
| ); | |
| return $discountstates; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment