MultivendorX
-
AuthorPosts
-
-
July 6, 2023 at 9:42 AM #194121print88Participant
How can I prevent a commission being created if the customer chooses Cheque Payments?
The commission will be taken from STRIPE account instead of bank account.I need to stop commission payment so the accounting is correct.
-
July 6, 2023 at 1:21 PM #194124Sangita Support SquadKeymaster
As per the default flow of MultiVendorX, as soon as an order is placed the commission for that order gets created for every payment gateway.
Now if you want to prevent the generation of commission, you can set commission as 0, for certain payment gateways. For this, you will have to add custom code for that. You can refer to this code https://multivendordemo.com/test/moumita/wp-admin/plugins.php -
July 7, 2023 at 12:19 AM #194140print88Participant
the link is asking for login and password.
-
July 7, 2023 at 12:21 PM #194147Sangita Support SquadKeymaster
@print88 You can get the code here https://multivendorx.com/docs/code-snippet/commission/
-
July 7, 2023 at 12:49 PM #194155print88Participant
I am very new to coding. So I want to set commission as zero for CHEQUE, do I change the if( $payment == ‘cod’ ) { to if( $payment == ‘cheque’ ) { in the coding?
add_action( ‘mvx_commission_after_save_commission_total’, ‘zero_commission’ );
function zero_commission( $commission_id ) {
$order_id = get_post_meta( $commission_id, ‘_commission_order_id’, true );
$payment = get_post_meta( $order_id, ‘_payment_method’, true );
if( $payment == ‘cod’ ) {
$order = wc_get_order($order_id);
update_post_meta( $commission_id, ‘_commission_amount’, $order->get_subtotal() );
update_post_meta( $commission_id, ‘_commission_total’, 0 );
}
} -
July 7, 2023 at 5:06 PM #194179NerdySupportExpert MoumitaKeymaster
@print88, yes, you have to check the payment mode as cheque using
$payment == ‘cheque’
Copy -
July 8, 2023 at 1:40 AM #194192print88Participant
I have already activated the code in code snippet but it doesn’t seem to produce a commission ZERO.
I am trying the second set of codes today and see what happens.
-
July 8, 2023 at 2:29 AM #194196print88Participant
Using the second set of codes. The commission would still not set as zero but paid.
-
July 8, 2023 at 2:57 AM #194197print88Participant
It would appear that the commission did not set to ZERO but PAID.
But there were not STRIPE transfer record of it. -
July 8, 2023 at 1:05 PM #194202Sangita Support SquadKeymaster
Hi @print88
When the code for setting commission as 0 on cod is added then the marketplace admin will not be getting any commission for that product. The whole order amount will go to the product vendor.
For example – If you add the code for setting commission as zero on cod and admin commission is set as 10%. Now if a customer buys a product of $100 and selects cod for payment then the full $100 will be calculated as vendor commission. -
July 9, 2023 at 12:19 AM #194229print88Participant
Yes I understand what the code is trying to do.
This is the result:
The commission is still produced with an amount marked as PAID.
But the transfer did not record on STRIPE.Is this the supposed result?
-
July 10, 2023 at 6:15 PM #194254Sangita Support SquadKeymaster
@print88 Let me assist you with the flow after adding the code for setting commission as 0 for cod.
Once the admin adds the code then the total amount of an order placed with COD will go to the vendor of that product. The admin will not get any commission for the products for which the customer is paying through the COD payment option.
If a buyer wants to pay on the delivery, the marketplace admin won’t have a new commission to pay as the whole payment process will be offline and there is no control over it. so it might be useful to exclude the commission for vendors.That is why when you add the below code the commissions are showing as marked paid automatically on the admin end.
Now can you please explain the exact modification of this flow that you want to implement on your end so that we can help you accordingly. -
July 11, 2023 at 9:01 AM #194268print88Participant
I want the amount to show the commission as zero.
-
July 11, 2023 at 12:23 PM #194274Sangita Support SquadKeymaster
@print88 As we have shared earlier if you add this code https://multivendorx.com/docs/code-snippet/commission/ then the admin commission will be 0 for the orders when the customer will pay via COD.
Now if you kindly explain which commission do you want to set as 0? -
September 9, 2023 at 1:16 AM #196018print88Participant
solved
-
September 9, 2023 at 8:56 AM #196023Sangita Support SquadKeymaster
Happy to hear that. We are closing this thread. If you need help or face issue in future please open a new support thread.
-
-
AuthorPosts
The topic ‘Prevent creation of commission on Cheque Payments’ is closed to new replies.