WCFM Marketplace Tax on Commission is not working

Multi Vendor Marketplace Plugin | WCFM Marketplace Forums WCFM – Feature Request WCFM Marketplace Tax on Commission is not working

This topic contains 3 replies, has 2 voices, and was last updated by WCFM Forum WCFM Forum 3 months, 2 weeks ago.

  • Author
    Posts
  • #76597
    Avatar
    ssoharabsafe
    Participant

    Commission on tax is not working with marketplace commission by product price.
    I have set up a commission by product price for admin but the tax on commission is not working at all.
    And also admin Commission by product price calculation for percentage and fixed amount is not done properly.
    ..
    ..
    Suppose i have setup 50% commission and 50 rupees fixed price for commission by product price.
    Then fixed price amount is not added to the commission just 50% commission is calculated for the product..
    ..
    +++++++++++++———————-++++++++++++++++++++++++++++++++
    + Can you at least share how the calculation is done. +
    + I mean formula so i can understand it better..maybe i am wrong +
    + So if possible share it with me some information +
    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

    I hope you guys can solve it.
    Thank You!

  • #77420
    WCFM Forum
    WCFM Forum
    Keymaster

    Hi,

    Well, this commission tax always deduct from vendor’s commission part. Not applied on vendor fee part.

    Suppose, a product cost 1000 and commission setting 50% + 50 for Admin

    So, Vendor commission will be 450 and Admin Fee 550

    Now, if you have set commission tax 18% then this will applicable on Vendor’s commission 450×18%

    Thank You

  • #77501
    Avatar
    ssoharabsafe
    Participant
    This reply has been marked as private.
  • #77790
    WCFM Forum
    WCFM Forum
    Keymaster

    Hi,

    Please add this code to your site –

    add_action( 'wcfmmp_order_item_processed', function( $commission_id, $order_id, $order, $vendor_id, $product_id, $order_item_id, $grosse_total, $total_commission, $is_auto_withdrawal ) {
    	global $WCFM, $WCFMmp, $wpdb;
    	
    	if( apply_filters( 'wcfm_is_admin_fee_mode', false ) ) {
    		$commission_rule   = unserialize( $WCFMmp->wcfmmp_commission->wcfmmp_get_commission_meta( $commission_id, 'commission_rule' ) );
    		$gross_sale_order  = (float) $WCFM->wcfm_vendor_support->wcfm_get_gross_sales_by_vendor( $vendor_id, '', '', $order_id );
    		$commission_tax    = (float) $WCFMmp->wcfmmp_commission->wcfmmp_get_commission_meta( $commission_id, 'commission_tax' );
    		$total_commission += $commission_tax;
    		
    		$admin_fee = (float) $gross_sale_order - (float) $total_commission;
    		
    		if( isset( $commission_rule['tax_enable'] ) && ( $commission_rule['tax_enable'] == 'yes' ) ) {
    			$commission_tax = $admin_fee * ( (float)$commission_rule['tax_percent'] / 100 );
    			$total_commission -= (float) $commission_tax;
    			
    			$WCFMmp->wcfmmp_commission->wcfmmp_delete_commission_meta( $commission_id, 'commission_tax' );
    			$WCFMmp->wcfmmp_commission->wcfmmp_update_commission_meta( $commission_id, 'commission_tax', round($commission_tax, 2) );
    			$wpdb->update("{$wpdb->prefix}wcfm_marketplace_orders", array('total_commission' => $total_commission), array('ID' => $commission_id), array('%s'), array('%d'));
    		}
    	}
    }, 50, 9 );

    Thank You

You must be logged in to reply to this topic.