Support » Plugin: Cart REST API for WooCommerce - CoCart Lite » Get Cart for Customer Role

  • 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 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.