milauskas Posted June 28, 2006 Posted June 28, 2006 Hi, I'm implementing the CIty Tax rate hack contrib and I see I have to enter some code for each city and its corresponding zip code. In an effort to save time, is there a way to have multiple zip codes for each city instead of having to enter code for each zip code one at a time? For example. I now have (this is jsut a snippet of the code): elseif ( ($cust_zip_code == '94105') && ($cust_entry_zone_id == '12') ) //ZIPCODE IS FOR San Francisco, CA, AND ZONE 12 IS CA { return 8.7500; //THIS IS THE STATE + CITY TAX RATE.... Is it possible in PHP to have this include ALL San Francisco zip codes, not just 94105? Quote
kgt Posted June 29, 2006 Posted June 29, 2006 Make an array of the SF zip codes (you're on your own for that one): $zip_codes_array = array( '94105', '94106', '94107' ); if( in_array( $cust_zip_code, $zip_codes_array ) && ($cust_entry_zone_id == '12') ) { return '8.7500'; Quote Contributions Discount Coupon Codes Donations
milauskas Posted June 29, 2006 Author Posted June 29, 2006 Thanks! I knew there were simple solutions. If only my PHP knowledge were sharper. This looks to be a great time saver. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.