• Resolved shahedparsa

    (@shahedparsa)


    Hi

    i tried to get cart:
    Authentication: jwt token
    endpoint: /cocart/v1/get-cart/id

    it gets each user/customer cart just for administrator Role.

    it is because of this line of code in the rest api file:

    public function get_permission_check() {
    		if ( ! current_user_can( 'administrator' ) ) {
    			return new WP_Error( 'cocart_cannot_read_cart', __( 'Cannot read cart!', 'cart-rest-api-for-woocommerce' ), array( 'status' => 500 ) );
    		}
    		return true;
    	} // END get_permission_check()

    so how a customer can get his/her cart while his/her role is not administrator?

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Get Cart for Customer Role’ is closed to new replies.