• Resolved dejanj

    (@dejanj)


    Hi,

    I need help with dokan actions on Orders page. Currently here i have two actions, to mark order complete or processing. What I want is to create action to mark order cancelled and on-hold.

    Currently I have in listing.php code that does the work for changing order status to completed and processing:

    if ( dokan_get_option( 'order_status_change', 'dokan_selling', 'on' ) == 'on' ) {
                                        if ( in_array( dokan_get_prop( $order, 'status' ), array( 'pending') ) ) {
                                            $actions['processing'] = array(
                                                'url' => wp_nonce_url( admin_url( 'admin-ajax.php?action=dokan-mark-order-processing&order_id=' . dokan_get_prop( $order, 'id' ) ), 'dokan-mark-order-processing' ),
                                                'name' => __( 'Processing', 'dokan-lite' ),
                                                'action' => "processing",
                                                'icon' => '<i class="fa fa-clock-o">&nbsp;</i>'
                                            );
                                        }
    
                                        if ( in_array( dokan_get_prop( $order, 'status' ), array( 'pending', 'on-hold' ) ) ) {
                                            $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-truck" style = "color:green;font-size:17px;">&nbsp;</i>'
                                            );
    
                                        }

    How can I define new actions to cancel order or put it on hold?

    Thanks,
    Dejan

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Hi there,

    The customization you mentioned is beyond the scope of this platform. I can give you the guideline but the implementation needs to be done with the help of an expert.

    First, we have to understand where these actions are defined. The actions created here are functioning from this file – dokan-lite/includes/Ajax.php see lines #28 & #29 and the corresponding functions which are defining what actually each action will do. So, you will also have to define your action like them.

    Once these completed you will need to add new actions array in the list.php file just like the two you copied here. Change your function names according to the functions you created in the last step.

    Please consult with a developer if you are not sure about reading and modifying advanced code structures.

    I hope the guideline gives you an idea of how to proceed with it.

    Thank you.

Viewing 1 replies (of 1 total)
  • The topic ‘Dokan actions on Listing page’ is closed to new replies.