Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global $wpdb;
- // Inserts values into woocommerce_tax_rates
- $wpdb->query("INSERT INTO wp_woocommerce_tax_rates (tax_rate_country, tax_rate_state, tax_rate, tax_rate_name) VALUES ('$country', '$state', '$rate', '$city')
- ON DUPLICATE KEY UPDATE tax_rate_id='tax_rate_id'");
- so I am trying to update zip code tax rates based on a csv file, so I assume I could use the column named tax_rate_id as that stores the actual zip code which would be unique. So I am trying to write the above statement so that if a row exist only update that row, if not insert it as a new row.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement