Withdrawal Balance Incorrect (needs reset)

WCMp Vendor Frontend Reports

Withdrawal Balance Incorrect (needs reset) Resolved

Viewing 24 reply threads
  • Author
    Posts
    • #68128
      skempik
      Participant

      Hello, WC Marketplace is a great plugin. Hats off to all those who work on it and make it accessible for small start ups like me. However, I think during the update, the withdrawal balance is now showing + £10,000 for one of my vendors. This figure is closer to the total amount of all orders but they have all been withdrawn using PayPal masspay over time.

      Luckily when the vendor goes to withdraw it corrects itself and just shows the most recent orders and only allows the vendor to withdraw ones that haven’t already been paid. So my question is simple, is there a way to reset the withdrawal balance on the front page once all payments are up to date just to keep everything right?

      I have a backup of my site before the update but we had several orders since then so would like to avoid using the back up.

      Any information you could give would be a great help to me. Thanks.

    • #68159
      WCMp Support
      Keymaster

      @skempik, sorry to hear that you have faced this issue.

      Our team is looking into this. Kindly provide us some time.

      We will keep you posted.

    • #68296

      Hi @skempik, in order to reset the widget, add this code to the function.php of the current active theme :

      /**
      ** Remove previous transaction 
      **/
      add_filter('before_wcmp_dashboard_widget', 'filter_before_wcmp_dashboard_widget', 10, 1 );
      function filter_before_wcmp_dashboard_widget( $vendor_dashboard_widget ) {
          unset($vendor_dashboard_widget['side']['wcmp_vendor_transaction_details']); //remove Transaction Details widget
          return $vendor_dashboard_widget;
      }
      
      add_action('wcmp_dashboard_setup', 'wcmp_dashboard_setup_modified' , 4 ); 
      function wcmp_dashboard_setup_modified() {
          global $WCMp;
          $trans_details_widget_args = array();
          $trans_details_widget_args['action'] = array('title' => __('Withdrawal', 'dc-woocommerce-multi-vendor'), 'link' => esc_url(wcmp_get_vendor_dashboard_endpoint_url(get_wcmp_vendor_settings('wcmp_vendor_withdrawal_endpoint', 'vendor', 'general', 'vendor-withdrawal'))));
          $WCMp->vendor_dashboard->wcmp_add_dashboard_widget('wcmp_vendor_transaction_details', __('Transaction Details ', 'dc-woocommerce-multi-vendor'), 'wcmp_vendor_transaction_details' , 'normal', array() , $trans_details_widget_args);
      }
      
      function wcmp_vendor_transaction_details(){
          global $WCMp;
          $total_amount = 0;
          $transaction_display_array = array();
          $vendor = get_wcmp_vendor(get_current_vendor_id());
          $requestData = $_REQUEST;
          $vendor = apply_filters('wcmp_transaction_vendor', $vendor);
          $start_date = isset($requestData['from_date']) ? $requestData['from_date'] : date('01-m-Y');
          $end_date = isset($requestData['to_date']) ? $requestData['to_date'] : date('t-m-Y');
          $transaction_details = $WCMp->transaction->get_transactions($vendor->term_id);
          $args = array(
              'meta_query' => array(
                  array(
                      'key' => '_commission_vendor',
                      'value' => absint($vendor->term_id),
                      'compare' => '='
                  ),
              ),
          );
          $unpaid_commission_total = WCMp_Commission::get_commissions_total_data( $args, $vendor->id );
      
          $count = 0; // varible for counting 5 transaction details
          foreach ($transaction_details as $transaction_id => $details) {
              $count++;
              if ($count <= 5) {
                  $transaction_display_array[$transaction_id]['transaction_date'] = wcmp_date($details['post_date']);
                  $transaction_display_array[$transaction_id]['total_amount'] = $details['total_amount'];
              }
      
              $total_amount = $total_amount + $details['total_amount'];
          }
          $WCMp->template->get_template('vendor-dashboard/dashboard-widgets/wcmp_vendor_transaction_details.php', array('total_amount' => $unpaid_commission_total['total'], 'transaction_display_array' => $transaction_display_array));
      }
      copy
    • #68422
      skempik
      Participant

      Hi appreciate your response but unfortunately this didn’t work at all.

      I decided to delete all order and start afresh hoping that would work and that did put the vendor balance back down to zero however since then we’ve had 3 orders and the vendors balance is back up to £500 even though I have marked all payments as paid.

      This may be a problem with the latest update any other ideas please let me know.

      Cheers

    • #68501

      @skempik, will it be possible for you to share an admin and one vendor access, so I can check.

      While sharing the access, don’t forget to mark the response as private.

    • #68514
      skempik
      Participant
      This reply has been marked as private.
    • #68521
      This reply has been marked as private.
    • #68522
      skempik
      Participant
      This reply has been marked as private.
    • #68555

      @skempik, please share the password also.

    • #68814
      skempik
      Participant
      This reply has been marked as private.
    • #68843
      This reply has been marked as private.
    • #68844
      skempik
      Participant
      This reply has been marked as private.
    • #68861
      This reply has been marked as private.
    • #69121
      skempik
      Participant
      This reply has been marked as private.
    • #69190
      This reply has been marked as private.
    • #69356
      skempik
      Participant
      This reply has been marked as private.
    • #69662
      skempik
      Participant
      This reply has been marked as private.
    • #69692
      This reply has been marked as private.
    • #69702
      skempik
      Participant
      This reply has been marked as private.
    • #69704
      This reply has been marked as private.
    • #73434
      skempik
      Participant
      This reply has been marked as private.
    • #73498

      @skempik, let me help you out with our flow.

      – When an order is created on the woocommerce end, we create the corresponding sub-order.
      – Now, we check the initial order status of the order from woocommerce’s main order and set same order status for suborders too
      – After that, each vendor/admin needs to change order status for each sub-order
      – Therefore, apart from initial order status, if you change status of an order, this will not affect the sub order’s status

      So, if you check the initial order status for your main order was “Pending Payment”, that is why all the order status of the suborder will be pending payment too.

      As a solution what you can do, is add custom code, that will check if the parent order status is canceled, then the sob orders will be canceled too.

    • #73502
      skempik
      Participant

      Thank you once again.

      Could you let me know what the custom code is or is this something I will have to do myself?

      Cheers

    • #73562

      @skempik, Please add this code to the function.php of your current active theme :

      add_action( 'woocommerce_order_status_cancelled', 'wcmp_order_status_cancelled' );
      function wcmp_order_status_cancelled( $order_id ) {
        global $WCMp;
        $suborder_details = $WCMp->order->get_suborders($order_id);
        foreach ($suborder_details as $key => $value) {
            $suborder_fetch = array(
                'ID'           => $value->get_id(),
                'post_status'   => 'wc-cancelled',
            );
            wp_update_post( $suborder_fetch );
        }
      }
      copy
    • #75623
      susmita
      Moderator

      Hi @skempik,

      I presume that your issue is resolved, since, we haven’t heard back from you.

      We are marking this thread as resolved.

      Kindly open a new thread if you face any further query.

Viewing 24 reply threads

The topic ‘Withdrawal Balance Incorrect (needs reset)’ is closed to new replies.

WCMp bundle is available at a slashed price

Grab It Now