WooCommerce-REST-API-Client-Library icon indicating copy to clipboard operation
WooCommerce-REST-API-Client-Library copied to clipboard

Attrubutes and terms endpoints

Open jcampos73 opened this issue 9 years ago • 2 comments

Hello,

Is library updated to use attributes and terms end points?

Thx

Best regards

jcampos73 avatar Mar 17 '16 08:03 jcampos73

I know this is old, but for others: you need to extend or update the WC_API_Client_Resource_Products class located in /resources/class-wc-api-client-resource-products.php then put in

public function get_attributes( $id = null, $args = array() ) {

        $this->set_request_args( array(
            'method' => 'GET',
            'path'   => array( 'attributes', $id ),
            'params' => $args,
        ) );

        return $this->do_request();
    }

usage is: print_r($client->products->get_attributes());

It only works with GET as this code uses only woocommerce V2 api... I'm discovering that this hasn't been updated for some time. I'm hoping they revisit this tool (as it is really helpful) and get it to work with woocommerce new API that works directly with wordpress API and include all controllers. The endpoint going from /wc-api/v2/ to use /wc-auth/v1/authorize for authentication and /wp-json/wc/v1 for requests.

dyluck07 avatar Jul 08 '16 23:07 dyluck07

Hello,

Maybe the most updated php client API is now:

https://github.com/woothemes/wc-api-php

Thx for the answer

jcampos73 avatar Jul 10 '16 11:07 jcampos73