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"> </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.