<div class="title"><?php _e('Sales', 'dokan'); ?> </div> <div class="count"><?php echo woocommerce_price($earning); ?> </div> </li> <li> <div class="title"><?php _e('Earning', 'dokan'); ?> </div> <div class="count"><?php echo dokan_get_seller_balance($user_id); ?> </div> </li> <?php do_action('dokan_seller_dashboard_widget_counter'); ?> </ul> </div> <!-- .big-counter --> <div class="dashboard-widget orders"> <div class="widget-title"><i class="fa fa-shopping-cart"></i> <?php _e('Orders', 'dokan'); ?>
<td><?php echo $user->user_email; ?> </td> <td> <a href="<?php echo admin_url('edit.php?post_type=product&author=' . $user->ID); ?> "> <?php echo isset($post_counts[$user->ID]) ? $post_counts[$user->ID] : 0; ?> </a> </td> <td><?php echo dokan_get_seller_balance($user->ID); ?> </td> <td><?php echo empty($info['phone']) ? '--' : $info['phone']; ?> </td> <td> <?php if ($seller_enable) { echo '<span class="seller-active">' . __('Active', 'dokan') . '</span>'; } else { echo '<span class="seller-inactive">' . __('Inactive', 'dokan') . '</span>'; } ?> </td>
/** * Validate an withdraw request * * @return void */ function validate() { if (!isset($_POST['withdraw_submit'])) { return false; } if (!wp_verify_nonce($_POST['dokan_withdraw_nonce'], 'dokan_withdraw')) { wp_die(__('Are you cheating?', 'dokan')); } $error = new WP_Error(); $limit = $this->get_withdraw_limit(); $balance = dokan_get_seller_balance(get_current_user_id(), false); $withdraw_amount = (double) $_POST['witdraw_amount']; if (empty($_POST['witdraw_amount'])) { $error->add('dokan_empty_withdrad', __('Withdraw amount required ', 'dokan')); } elseif ($withdraw_amount > $balance) { $error->add('enough_balance', __('You don\'t have enough balance for this request', 'dokan')); } elseif ($withdraw_amount < $limit) { $error->add('dokan_withdraw_amount', sprintf(__('Withdraw amount must be greater than %d', 'dokan'), $this->get_withdraw_limit())); } if (empty($_POST['withdraw_method'])) { $error->add('dokan_withdraw_method', __('withdraw method required', 'dokan')); } if ($error->get_error_codes()) { return $error; } return true; }
/** * Get a sellers balance * * @param int $user_id * * @return int */ function get_user_balance($user_id) { return dokan_get_seller_balance($user_id, false); }
echo $current == 'approved' ? ' class="active"' : ''; ?> > <a href="<?php echo add_query_arg(array('type' => 'approved'), dokan_get_navigation_url('withdraw')); ?> "><?php _e('Approved Requests', 'dokan'); ?> </a> </li> </ul> <div class="dokan-alert dokan-alert-warning"> <strong><?php printf(__('Current Balance: %s', 'dokan'), dokan_get_seller_balance($user_id)); ?> </strong> </div> <?php if ($current == 'pending') { $dokan_withdraw->withdraw_form(Dokan_Template_Shortcodes::$validate); } elseif ($current == 'approved') { $dokan_withdraw->user_approved_withdraws($user_id); } ?> </article> </div><!-- .dokan-dashboard-content -->
/** * Get Seller Balance * * @since 2.4 * * @return integer */ public function get_seller_balance() { return dokan_get_seller_balance($this->user_id); }