• Resolved niikk

    (@niikk)


    Hello

    Is there a way to hide failed transaction on vendors order overview page? Why we need this? We manage the whole stuff for our vendors. So they only must see order where are correct in the status “processing” and “Completed”. How can we hide other status orders there?

    Cheers

Viewing 12 replies - 1 through 12 (of 12 total)
  • Hello @niikk ,

    Can you please be more specific?

    Do you want to hide the orders from the order list for a particular order status?

    Or, you want to hide an order status from the order status selection under the order details page?

    It is better if you share a screenshot.

    Thank you.

    Thread Starter niikk

    (@niikk)

    hi @rur165

    Thanks for your reply.

    Here is a screenshot: https://ibb.co/dpt8rD5

    We want to hide failed orders in the vendor dashboard orders overview. Vendor should not see “Failed” order there.

    Cheers

    Hello @niikk ,

    To hide the failed orders you need to modify the file from – dokan-lite/temaplates/orders/listing.php

    On that file you have to include the below if condition after line #65 – https://prnt.sc/ts2jl3

    if ($order->status !== "failed")

    You need to wrap the whole order section properly with the if condition.

    I hope this helps.

    Thank you.

    Thread Starter niikk

    (@niikk)

    Hello @rur165

    Thanks! Works as expected!

    But now there is only a little issue with the top filter for order filtering. There is still a filter for “failed”. And I saw, that dokan don’t use a special CSS class for this. How can I hide the filter “Failed” there as well?

    Cheers

    Hello @niikk ,

    There is no direct hook available to modify the statuses from the filter list so I will suggest to use this CSS to hide the “Failed: filter:

    .dokan-orders-content .dokan-orders-area ul.order-statuses-filter li:last-child {
        display: none;
    }

    Thank you.

    Thread Starter niikk

    (@niikk)

    Hello @rur165

    Great! Nice! Works!

    I now noticed, that the filter ?all“ also count the ?failed“ orders which we hide. Can we also adjust this count that the number is right?

    Cheers

    Hello @niikk ,

    Actually we do not have a filter or hook for that as well. So if you want to make a change you have to make changes in the core files. Either modify the variable $orders_counts from dokan-lite\includes\template-tags.php.

    Or, you can modify the original function dokan_count_orders() from dokan-lite\includes\Order\functions.php

    Thank you.

    Thread Starter niikk

    (@niikk)

    hi @rur165

    But this is in \includes\ folder. How can I adjust there in child theme?

    Cheers

    Hello @niikk ,

    I forgot the mention that part actually.

    It will not be possible to override a file under the /includes/ folder with a child theme. Only the template files can be overridden via a child theme. We do not advise making any changes into core files but in this case, there is no other way to modify the part you wanted.

    So, if you make any changes you need to keep a backup and replace the changes after each update.

    I hope I was able to clear the confusion.

    Thank you ??

    Thread Starter niikk

    (@niikk)

    Hi @rur165

    So, finally we made now some changes to exclude failed order in the count. We worked with the dokan_count_orders() function and made a simple change to it.

    Below you see the current function:

        if ( $counts === false ) {
            $counts = [
                'wc-pending'    => 0,
                'wc-completed'  => 0,
                'wc-on-hold'    => 0,
                'wc-processing' => 0,
                'wc-refunded'   => 0,
                'wc-cancelled'  => 0,
                'total'         => 0
            ];

    Actually we just remove 'wc-failed' => 0,. It’s working as it should.

    But we want to ask you if this is the right way or do we better go another way?

    Cheers

    • This reply was modified 4 years, 1 month ago by niikk.

    Hello @niikk,

    As you have removed any feature related to the failed orders there should not be a problem except that you are making changes directly on the plugin which will be removed when you update the plugin.

    The function you have modified has been used in these places – https://prnt.sc/v2nko8. So as long you have no use of the failed status on the site the functionality will not be hampered.

    Thank you ??

    Thread Starter niikk

    (@niikk)

    Hi @rur165

    Thanks. I guess that ok. We do not want to show “failed” orders to vendor. So a failed order does not count in dashboard and order list. If a customer cancle a failed order then it would be transform to a “canceled” order and this counts then. So I guess everything should work!

    Thanks. ??

    Cheers

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Hide failed transaction vendor order dashboard’ is closed to new replies.