fbpx

Hide cancelled Orders

WCMp Mangopay Marketplace

Hide cancelled Orders Resolved

Viewing 5 reply threads
  • Author
    Posts
    • #108379
      Benny
      Participant

      Hi there,
      Please can you assist me, I would like to display only processing orders and hide all cancelled orders from my vendor > vendor-orders.

      Find the screenshot attached.

      Attachments:
    • #108393

      Hi,
      Below code will help you to show only processing orders.
      Please add this code in the function.php of the current active theme :

      add_filter('wcmp_datatable_get_vendor_all_orders','wcmp_show_processing_order_from_table', 10, 3);
      function wcmp_show_processing_order_from_table( $orders, $requestData, $post ){
          global $wpdb;
          foreach ( $orders as $key => $id ) { 
              if ( get_post_status( $id ) != 'wc-processing' ) { 
                  unset( $orders[$key] );
              }
          }
          return $orders;
       }
      Copy

      Regards,

    • #108470
      Benny
      Participant

      Thank you, it worked.
      I would like to do the same for dashboard > Banking – overview, to not display all cancelled commission.

      See attached.

      Attachments:
    • #108490

      Hi,
      Please add this code in the function.php of the current active theme :

      add_filter( 'wcmp_vendor_banking_ledger_lists', 'ladger_table_cancel_hide',10,3);
      function ladger_table_cancel_hide($vendor_all_ledgers, $vendor, $requestData){
          $new_ladger = array();
          if(!empty($vendor_all_ledgers)){
              foreach ( $vendor_all_ledgers as $ledger ) {
                  if($ledger->ref_status != 'cancelled'){
                      $new_ladger[] = $ledger;
                  }
              }
          }
      return $new_ladger;
      }
      Copy

      Regards,

    • #108546
      Benny
      Participant

      Thank you, it worked

    • #108556

      Welcome.

Viewing 5 reply threads

The topic ‘Hide cancelled Orders’ is closed to new replies.

Buy all Marketplace addons together, check out our Bundle

Buy at Slashed Price