• Resolved niikk

    (@niikk)


    Hello

    We are Dokan Pro customers and want to adjust the order details page alittle bit.

    How can we hook in the order complete button from the order overview into a single order? We want, that our vendors easy can complete a order.

    This button: https://ibb.co/vCNhYF9
    To this place in the order detals: https://ibb.co/q0rRrRf

    Cheers 🙂

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

    You need to navigate to wp-admin–>Dokan–>settings–>Selling ; https://nimb.ws/QCMTfJ
    Enable the option and save the settings to allow the vendors edit the order status 🙂

    I hope this helps.

    Thanks:)

    Thread Starter niikk

    (@niikk)

    hello @roshni07

    Thanks for your reply. But this was not the question. We know that there is a option like this. What we want is, that we implement the complete button in the details order page instead of the order status dropdown. So we will hide the Dropdows via CSS and add the button. Look at the screenshots.

    Cheers Nik

    Hello @niikk ,

    You will need bit of code copy-paste with some template customization knowledge to get exactly what you want.

    First, see the main source of that “Complete” button from –
    dokan-lite/templates/orders/listing.php look for the actions at line #148. This is the code you will need to copy and use on the order details page dokan-lite/templates/orders/details.php after line #182.

    I can give you the sample code to generate the complete button on order details page but you may need to make some modification based on your need –

    <li class="dokan-order-action" width="17%" data-title="<?php esc_attr_e( 'Action', 'dokan-lite' ); ?>" >
    
                                    <?php 
                                    
                                    $actions = array();
    
                                    if ( in_array( dokan_get_prop( $order, 'status' ), array( 'pending', 'on-hold', 'processing' ) ) ) {
                                        $actions['complete'] = array(
                                            'url' => wp_nonce_url( admin_url( 'admin-ajax.php?action=dokan-mark-order-complete&order_id=' . dokan_get_prop( $order, 'id' ) ), 'dokan-mark-order-complete' ),
                                            'name' => __( 'Complete', 'dokan-lite' ),
                                            'action' => "complete",
                                            'icon' => '<i class="fa fa-check">&nbsp;</i>'
                                        );
                                    }
    
                                    foreach ($actions as $action) {
                                        $icon = ( isset( $action['icon'] ) ) ? $action['icon'] : '';
                                        printf( '<a class="dokan-btn dokan-btn-default dokan-btn-sm tips" href="%s" data-toggle="tooltip" data-placement="top" title="%s">%s</a> ', esc_url( $action['url'] ), esc_attr( $action['name'] ), $icon );
                                    }
    
                                    ?>
                                </li>

    As this is a complete customization request, I am unable to completely help you implementing the code but using this code will generate the complete button and will also work.

    Once you complete the changes on the details.php file, save it under your-theme/dokan/orders folder to keep it safe from removal during update.

    I hope the information helps.

    Thank you.

    Thread Starter niikk

    (@niikk)

    Hello @rur165

    Thanks! It works now as expected. We only change the code for our need. 🙂

    Cheers

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Complete order button in order details page’ is closed to new replies.