Fix #27339
This commit is contained in:
parent
9b9ebc396a
commit
a939cacf5c
|
@ -1189,8 +1189,10 @@ class WC_Tax {
|
|||
public static function get_rates_for_tax_class( $tax_class ) {
|
||||
global $wpdb;
|
||||
|
||||
$tax_class = self::format_tax_rate_class( $tax_class );
|
||||
|
||||
// Get all the rates and locations. Snagging all at once should significantly cut down on the number of queries.
|
||||
$rates = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM `{$wpdb->prefix}woocommerce_tax_rates` WHERE `tax_rate_class` = %s;", sanitize_title( $tax_class ) ) );
|
||||
$rates = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM `{$wpdb->prefix}woocommerce_tax_rates` WHERE `tax_rate_class` = %s;", $tax_class ) );
|
||||
$locations = $wpdb->get_results( "SELECT * FROM `{$wpdb->prefix}woocommerce_tax_rate_locations`" );
|
||||
|
||||
if ( ! empty( $rates ) ) {
|
||||
|
|
Loading…
Reference in New Issue