[API] Included standard rate in get tax classes response

This commit is contained in:
Claudio Sanches 2015-10-07 19:12:31 -03:00
parent 4f45b04722
commit 34ef764477
1 changed files with 7 additions and 1 deletions

View File

@ -180,11 +180,17 @@ class WC_API_Taxes extends WC_API_Resource {
$tax_classes = array();
// Add standard class
$tax_classes[] = array(
'slug' => 'standard',
'name' => __( 'Standard Rate', 'woocommerce' )
);
$classes = WC_Tax::get_tax_classes();
foreach ( $classes as $class ) {
$tax_classes[] = apply_filters( 'woocommerce_api_tax_class_response', array(
'id' => sanitize_title( $class ),
'slug' => sanitize_title( $class ),
'name' => $class
), $class, $fields, $this );
}