• Resolved Mikey

    (@mikeyhash)


    Hello,

    I am setting different commission rates for each of my vendors’ products and I want to add a column with the commission rate (i.e. just the percentage) in the admin WC Vendors->Commissions table, for keeping better evidence purposes.

    Here’s a printscreen: https://prntscr.com/kz0fuh.

    Thus, I am editing wc-vendors/classes/admin/class-wcv-commissions-page.php, but I am not able to figure out what to return for the commission rate.

    Please see below:

    
    /**
    	 * column_default function.
    	 *
    	 * @access public
    	 *
    	 * @param unknown $item
    	 * @param mixed   $column_name
    	 *
    	 * @return unknown
    	 */
    	public function column_default( $item, $column_name ) {
    		global $wpdb;
    		switch ( $column_name ) {
    			case 'id' :
    				return $item->id;
    			case 'vendor_id' :
    				$user = get_userdata( $item->vendor_id );
    				return '<a href="' . admin_url( 'user-edit.php?user_id=' . $item->vendor_id ) . '">' . WCV_Vendors::get_vendor_shop_name( $item->vendor_id ) . '</a>';
    			case 'total_due' :
    				return wc_price( $item->total_due );
    
    			case 'commission_rate':
    			  
    				return ????????;
    
                            [..........]
    

    Please take a minute from your time and help me out with this.

    Thank you for your support!

Viewing 1 replies (of 1 total)
  • Thread Starter Mikey

    (@mikeyhash)

    I’ve solved this one on my own, if anyone also needs it, just ask here.

Viewing 1 replies (of 1 total)
  • The topic ‘Commission Rate in admin WC Vendors->Commissions table’ is closed to new replies.