• Resolved sajjad

    (@sajjad203)


    Hi,

    I want to show purchased products (status = complete) for the current user.
    I found https://edd.wp-a2z.org/oik_api/edd_get_users_purchased_products/
    But it has problem! It shows products with any status! (complete, pending, …)

    Are you sure that it works truly? Can you help that what is the problem?

    I tested these:
    1.

    $user = get_current_user_id();
    $test = edd_get_users_purchased_products( $user );
    var_dump($test);

    2.

    $user = get_current_user_id();
    $status = 'complete';
    $test = edd_get_users_purchased_products( $user , $status );
    var_dump($test);

    But output is the information of purchased products with any status! (complete, pending, …)

    I used this to show purchased products:

    $user = get_current_user_id();
    $test = edd_get_users_purchased_products( $user );
    
    	foreach ($test as $key => $value) {
    		foreach ($value as $Skey => $Svalue) {
    			echo $Skey . "	--->	" . $Svalue . "<br>";
    		}
    	}

    Can you test this function to sure that is work true or not?!

    Thank you for help

    https://www.ads-software.com/plugins/easy-digital-downloads/

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Contributor Pippin Williamson

    (@mordauk)

    Try changing complete to publish.

    Thread Starter sajjad

    (@sajjad203)

    Not worked!!

    $user = get_current_user_id();
    $status = 'publish';
    $test = edd_get_users_purchased_products( $user , $status );
    var_dump($test);

    Are you sure about this function?

    Thread Starter sajjad

    (@sajjad203)

    Hello Pippin,

    Is it possible to help to solve this problem?

    Thank you very much ??

    Plugin Contributor Pippin Williamson

    (@mordauk)

    Can you look and see if the customer records for the user shows a value for the “User” section? If it doesn’t, connect the user account to the customer record then it should work.

    Thread Starter sajjad

    (@sajjad203)

    User defined as a customer and and connected to the customer’s account.
    And all things works fine like purchase history and ….

    But just this function has problem.

    Is it possible to test this function yourself?

    Regards

    Thread Starter sajjad

    (@sajjad203)

    Guys,

    Can anyone test and fix this function?

    Regards

    Plugin Contributor Pippin Williamson

    (@mordauk)

    We use this function ourselves and do not have this kind of issue with it.

    Can you please tell me a bit more about precisely what you’re trying to do?

    Thread Starter sajjad

    (@sajjad203)

    User purchased product1 and tried to purchase produc4 but his payment is in pending. So user just have product1.

    You can see the purchase history that works fine:
    https://myedd.cloudsite.ir/checkout/purchase-history/

    But above function has problem and show any products with any status (pending, complete …)
    https://myedd.cloudsite.ir/func-test-page/
    (Currently the function just should show product1 and NOT product4)

    Are you see the problem?
    I should show the title of purchased products for the current user.

    Thread Starter sajjad

    (@sajjad203)

    Host is free and automatically will delete after a month and you do not need to remove login details from above post!

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Host is free and automatically will delete after a month and you do not need to remove login details from above post!

    Thanks for the heads up.

    Please do not post details like that again in these forums. Do not. It’s always a bad idea an anyone who posts that will see their post edited or deleted.

    Plugin Contributor Pippin Williamson

    (@mordauk)

    Ah, that’s intentional.

    The status option in this function is not for specifying the status of the payment records; it’s for specifying the status of the product that was purchased.

    Use edd_get_users_purchases( $user = 0, $number = 20, $pagination = false, $status = 'complete' ) for getting payments of a specific status instead.

    Thread Starter sajjad

    (@sajjad203)

    Ah ??
    I don’t want the list of purchases!!!!!
    I want a list of products that user purchased them.

    Thread Starter sajjad

    (@sajjad203)

    I just found edd_get_users_purchased_products to show products that purchased but this function has problem.

    I sent a ticket from your site and attached login details of https://myedd.cloudsite.ir/func-test-page/

    Please help to solve problem of this function.

    Many thanks

    [ No bumping please. ]

    Thread Starter sajjad

    (@sajjad203)

    Hi,

    I solved this by combine some functions ??

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Bug: edd_get_users_purchased_products’ is closed to new replies.