Home Forums Theme Support Dokan $post_counts->total doesn't update when admin deletes products

This topic is: not resolved

Tagged: 

This topic contains 10 replies, has 2 voices, and was last updated by  Nayem 4 years, 3 months ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #31119

    Gregório Sordi
    Member
    Post count: 152

    hi. $post_counts->total updates ok when seller deletes products. But if admin deletes it, it just maintain the same value.

    $post_counts->publish, $post_counts->draft, $post_counts->pending are ok.

    So now i have a seller with:

    $post_counts->total : 3
    $post_counts->publish : 0
    $post_counts->draft : 0
    $post_counts->pending : 0

    #31151

    Nayem
    Moderator
    Post count: 6480

    Hello Gregório,

    Can you please tell me actually what are you looking for?. I am not clear about it. Please describe me in more details. I am here to hear from you.

    Thank you 🙂

    #31190

    Gregório Sordi
    Member
    Post count: 152

    i'm creating intro tutorial messages for new sellers.

    if (empty($postcode)) {
    echo message 1
    }
    elseif (empty($post_counts->total)){
    echo message 2
    }
    elseif (empty($post_counts->publish)){
    echo message 3
    }

    but i ran into an error. so i printed the values above and found out what i said in the first post.

    got it?

    #31246

    Nayem
    Moderator
    Post count: 6480

    Hello Gregório,

    I am testing your issue. Please allow me some time. I will be back to you with the right solution.

    Thank you 🙂

    #31250

    Nayem
    Moderator
    Post count: 6480

    Hello Gregório,

    I have checked this and also discussed with our developer. Admin should not delete a product as the seller has bought subscription packs. If the admin needs to a product to be removed he can ask the seller to take it down.

    That was the logic behind the system.

    Thank you for understanding 🙂

    #31258

    Gregório Sordi
    Member
    Post count: 152

    i don't use subscription packs. It doesn't suit my site.

    i understand what you are saying, but admin should be able to delete products, for example, one that violates the sites policy. Or any other reason.

    This is clearly a bug, otherwise, why $post_counts->publish, $post_counts->draft, $post_counts->pending updates just fine?

    #31282

    Nayem
    Moderator
    Post count: 6480

    Hello Gregório,

    I have forwarded this topic to our developer team. Hope they will find the solution for you. Please keep patience and i will be back to you very soon with the feedback of our developer team.

    Thank you 🙂

    #31361

    Gregório Sordi
    Member
    Post count: 152

    ok. thanks.

    #31471

    Nayem
    Moderator
    Post count: 6480

    Hello Gregório,

    If you do not mind can you please tell me specifically that where this is happening?. If you can then please provide a screenshot where this happened. I think screenshot will help us to find the solution.

    Thank you for understanding 🙂

    #31511

    Gregório Sordi
    Member
    Post count: 152

    i did this inside dashboard-nav:

    $post_counts    = dokan_count_posts( 'product', $user_id );
    
    print '/ $post_counts->total';echo $post_counts->total ;
    print '/ $post_counts->publish:';echo $post_counts->publish ;
    print '/ $post_counts->draft:';echo $post_counts->draft ;
    print '/ $post_counts->pending:';echo $post_counts->pending ;
    

    this shows the above values for me.

    Now, do this:

    create a product with seller account. $post_counts->total and $post_counts->pending will updates to +1 (if it was 0, now its 1). Then, go to admin settings on backend. Lets say admin does not approve this product and deletes it. Then, $post_counts->total and $post_counts->pending should updates to -1.

    But that is not what is happening. $post_counts->pending updates to -1. $post_counts->total stays at previous value.

    therefore, now i have sellers with 0 products and $post_counts->total value is 5.

    got it now?

    thanks for the support!

    #31717

    Nayem
    Moderator
    Post count: 6480

    Hello Gregório,

    I have discussed about this issue with our developer team. Hope they will fixed it in our next update.

    Thank you for having patience. 🙂

Viewing 11 posts - 1 through 11 (of 11 total)

The topic ‘$post_counts->total doesn't update when admin deletes products’ is closed to new replies.