• Resolved luckyboyrus

    (@luckyboyrus)


    Hello,

    I’m trying to realize the following payment split.

    100rub is a product price and delivery cost is 40rub. Admin commission is 10%. Gateway (i use Robokassa) for customer payment charges 4%. I will pay commissions manually via outside system because you bank transfer doesn’t support my country banking system.

    So Vendor should get 100rub -4% -10% = 86rub for product and 40rub – 4% = 38.4rub for delivery.

    How can I do it?

    I used payment gateway charges option (Seller, percentage, 4%, bank transfer) but got negative result. System shows 90rub to vendor and 40rub delivery to vendor.

    Please help me understand how to do this.

    Thanks a lot

    Pavel

    • This topic was modified 1 year, 2 months ago by luckyboyrus.
Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author DualCube

    (@dualcube)

    @luckyboyrus, thanks for reaching WCMp Support.

    Can you please let us know who is bearing the gateway charges. You can see this option via WCMp >> Settings >> Payment : https://prnt.sc/o2f9i5

    A screenshot will be very much appreciated.

    I have UI in russian – https://prnt.sc/o2hb74 . My settings are exactly the same as on your screenshot.

    • This reply was modified 1 year, 1 month ago by luckyboyrus.
    Plugin Author DualCube

    (@dualcube)

    @luckyboyrus, the gateway charge will only be deducted, when the commission will be paid.

    Means, under Net earning, we will only display the commission earned on the sale.

    Now, when admin will click on commission id (upon successfully commission payment), it will display the gateway charge. As you can see here :- https://www.loom.com/share/2e5b783692a24783bc7eba0dd33284a7

    It’s a pity.

    Is it possible to correct Net Earning calculation to substract gateway charges from product price and delivery? Or at least from delivery price.

    It’s confusing to Vendor then he sees full amount in commission report and receives smaller

    Maybe there is some code to add or correct?

    • This reply was modified 1 year, 1 month ago by luckyboyrus.
    Plugin Author DualCube

    (@dualcube)

    @luckyboyrus, as our plugin displays the total earning there, hence you have to do custom code and display the updated price i.e. net earning – gateway charge.

    Let us know if you need references of hook/filter for this.

    Thanks for the answer. I would appreciate references of hook/filter and ready to share my code while i’ll make it.
    As well can you please provide some architecture overview? My vendors ask a lot of functionality. Probably sometimes easier to make couple lines in code than disturbing you.

    And one more question. Is it possible to apply product search to specific vendor store?

    Plugin Author DualCube

    (@dualcube)

    @luckyboyrus, currently we don’t have product search as per vendor.

    However doing custom code, you can add that search.

    Thanks, can you please provide references of hook/filter for me to do custom code to display the updated price i.e. net earning – gateway charge?

    Plugin Contributor Khokan Sardar

    (@itzmekhokan)

    @luckyboyrus we created follows function for getting commission wise gateway charge. You can add it in your active theme’s functions.php –

    function get_wcmp_commission_gateway_charge($commission_id = 0){
    	if($commission_id){
    		global $WCMp;
    		$order_id = get_post_meta($commission_id, '_commission_order_id', true);
    		$commission_vendor = get_post_meta($commission_id, '_commission_vendor', true);
    		$vendor_user_id = get_term_meta($commission_vendor, '_vendor_user_id', true);
    		$vendor = get_wcmp_vendor($vendor_user_id);
    		if($vendor){
    			$payment_method = get_user_meta($vendor->id, '_vendor_payment_mode', true);
    			if($payment_method){
    				$WCMp->payment_gateway->payment_gateways[$payment_method]->vendor = $vendor;
    				$WCMp->payment_gateway->payment_gateways[$payment_method]->commissions = array($commission_id);
    				$WCMp->payment_gateway->payment_gateways[$payment_method]->currency = get_post_meta($order_id, '_order_currency', true);
    				return $WCMp->payment_gateway->payment_gateways[$payment_method]->gateway_charge();
    			}
    		}
    	}
    }

    And via calling this function get_wcmp_commission_gateway_charge($commission_id);, you can get gateway charge value for a commission. Dont forget to pass $commission_id while calling this function.

    As we are showing vendor net earning in so many section of vendor dashboard as well as in backend section. So, if you tell us for which section actually you want to display net earning – gateway charge, we can provide you the actual hook/filter to do the customization. Or else you can do it by yourself using the above functionalities.

    Please let me know if you have any query regarding this.

    Khokan,

    Thank you so much for your support!

    I need this in section Commissions – First line in WCMp menu. In titles and inside commission details.

    • This reply was modified 1 year, 1 month ago by luckyboyrus.
    Plugin Contributor Khokan Sardar

    (@itzmekhokan)

    @luckyboyrus, here is your code snippet as follow –

    function wcmp_register_custom_column_headings($columns){
    	$gateway = array('gateway_charge' => __('Gateway fees', 'dc-woocommerce-multi-vendor'));
    	$commission_earning_pos = array_search('_commission_earning', array_keys($columns));
    	$columns = array_slice($columns, 0, $commission_earning_pos + 1, true) + $gateway + array_slice($columns, $commission_earning_pos + 1, count($columns) - 1, true);
    	return $columns;
    }
    add_filter('manage_edit-dc_commission_columns', 'wcmp_register_custom_column_headings', 99);
    
    function wcmp_register_custom_columns($column_name, $id) {
    	$post = get_post($id);
    	if($post->post_type != 'dc_commission') return;
    	if($column_name == '_commission_earning'){
    		echo " (incl. Gateway fees)";
    	}
    	if($column_name == 'gateway_charge'){
    		$charge =get_wcmp_commission_gateway_charge($id);
    		echo wc_price($charge);
    	}
    }
    add_action('manage_pages_custom_column', 'wcmp_register_custom_columns', 99, 2);

    Khokan,

    Thank you very much! Great support from you and your team!

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Gateway charges to delivery’ is closed to new replies.