• Hello!

    I try to get products швы like this:

    foreach ($receivers_ids as $receivers_id) {
        $user_id = $receivers_id;
    
        print($user_id . ',');
        
        $wishlist_ids = YITH_WCWL()->get_wishlists( array( 'user_id' => $user_id ) );
    
            foreach ($wishlist_ids as $wishlist_id) {
                $wish_id = $wishlist_id['id'];
                print($wish_id . ',');
    
                
                $wish_products = YITH_WCWL()->get_products( [ 'wishlist_id' => 'all' ] );
    
                //var_dump($wish_products);
                foreach ($wish_products as $wish_product) {
                        $product_id = $wish_product['prod_id'];
                        print($product_id . ',');
                }
            }
    }

    And get only product from last wishlist. Could you tell why?

    I also try to use $wish_id instead ‘all’ but get the same.

    • This topic was modified 1 year, 8 months ago by idresult.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Juan Coronel

    (@juaancmendez)

    Hello there,
    we hope you’re doing well!

    Could you tell us exactly what you want to achieve? Since that code should return the id of the products of the wishlist in which you are positioned at that moment.

    We will be attentive to your response.

    Best regards.

    Thread Starter idresult

    (@idresult)

    Hello!

    I try to get all ids from products in all wishlists.

    Plugin Support Juan Coronel

    (@juaancmendez)

    Hello there,

    We’re sorry, but that type of query is currently not available in the plugin.

    If you have any other questions, feel free to contact us.

    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to get products ids’ is closed to new replies.