WCMp bundle is available at a slashed price

Grab It Now

Withdrawal Balance Incorrect (needs reset)

Withdrawal Balance Incorrect (needs reset)2019-08-06T05:58:35-05:00

Home Support Forum WCMp Vendor Frontend Reports Withdrawal Balance Incorrect (needs reset)

WCMp Vendor Frontend Reports

Withdrawal Balance Incorrect (needs reset) Open

  • Author
    Posts
  • skempik
    Participant
    Post count: 10

    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.

  • WCMp Support
    Keymaster
    Post count: 1190

    @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.

  • NerdySupportExpert Moumita
    Keymaster
    Post count: 4609

    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));
    }
  • skempik
    Participant
    Post count: 10

    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

  • NerdySupportExpert Moumita
    Keymaster
    Post count: 4609

    @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.

  • skempik
    Participant
    Post count: 10
    This reply has been marked as private.
  • NerdySupportExpert Moumita
    Keymaster
    Post count: 4609
    This reply has been marked as private.
  • skempik
    Participant
    Post count: 10
    This reply has been marked as private.
  • NerdySupportExpert Moumita
    Keymaster
    Post count: 4609

    @skempik, please share the password also.

  • skempik
    Participant
    Post count: 10
    This reply has been marked as private.
  • NerdySupportExpert Moumita
    Keymaster
    Post count: 4609
    This reply has been marked as private.
  • skempik
    Participant
    Post count: 10
    This reply has been marked as private.
  • NerdySupportExpert Moumita
    Keymaster
    Post count: 4609
    This reply has been marked as private.
  • skempik
    Participant
    Post count: 10
    This reply has been marked as private.
  • NerdySupportExpert Moumita
    Keymaster
    Post count: 4609
    This reply has been marked as private.
  • skempik
    Participant
    Post count: 10
    This reply has been marked as private.
  • skempik
    Participant
    Post count: 10
    This reply has been marked as private.
  • NerdySupportExpert Moumita
    Keymaster
    Post count: 4609
    This reply has been marked as private.
  • skempik
    Participant
    Post count: 10
    This reply has been marked as private.
  • NerdySupportExpert Moumita
    Keymaster
    Post count: 4609
    This reply has been marked as private.

Please LOGIN to reply to this topic