Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter bop64921

    (@bop64921)

    I already have debugging enabled from before and the debug.log does not throw any errors of any kind.

    I am using MiniOrange Auth API REST plugin, I have downgraded to see if it was a possible update and it doesn’t fix either. I have also tried changing the name to functions.php since we have a lot of programming in that file and it doesn’t fix it either.

    I have also tried generating the token again and changing the system to Basic Auth but that didn’t work either. On another similar website that I have the same version of WordPress, everything works fine. I have also tried adding the field manually in the functions like this:

    function agregar_rol_usuario_a_api_rest() {

    register_rest_field('user', 'roles', array(
    
        'get_callback' => function ($user) {
    
            $usuario = get_userdata($user['id']);
    
            return $usuario->roles;
    
        },
    
        'schema' => null,
    
    ));

    }

    add_action(‘rest_api_init’,’agregar_rol_usuario_a_api_rest’);

    And adding an errorlog I managed to display the user ID and the role they have but for some reason the GET by postman does not work.

    (I have also checked that Postman shows me the entire payload)

    • This reply was modified 1 year, 1 month ago by bop64921.
    Thread Starter bop64921

    (@bop64921)

    Thanks for your answer. I’m using a bearer token authentication plugin, plus a few weeks ago we were able to view the roles and even edit them via API. But right now it won’t let me, I’m a little frustrated, any ideas? What I see that of all the users gets me: “is_super_admin”: true, In principle it shouldn’t affect it because it is a WooCommerce error but I don’t know what to think.

    Thread Starter bop64921

    (@bop64921)

    I see it works, but when i filter product with jet smart filters the products not show disccount, i think is ajax problem but why?

    Any idea?

    Thanks alot!!

    Thread Starter bop64921

    (@bop64921)

    Hello, thanks for your time.

    I know that, but im making disccount per role by the API Rest, i cant make that with API with your plugin, i want put disccounts for determinate users connected from external APP and then update with API Roles and Users with discounts or direct price, creating roles by API rest too.

    Then i have the problem if i not put the role on individual price manually by de admin area of wordpress i cannot acces to make disccount by the API REST.

    Sorry for me inglish.

    Thanks a lot.

Viewing 4 replies - 1 through 4 (of 4 total)