Prevent creation of commission on Cheque Payments

MultivendorX

Resolved
Viewing 15 reply threads
  • Author
    Posts
    • #194121
      print88
      Participant

      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.

    • #194124

      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

    • #194140
      print88
      Participant

      the link is asking for login and password.

    • #194147
    • #194155
      print88
      Participant

      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 );
      }
      }

    • #194179

      @print88, yes, you have to check the payment mode as cheque using

      $payment == ‘cheque’
      Copy
    • #194192
      print88
      Participant

      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.

    • #194196
      print88
      Participant

      Using the second set of codes. The commission would still not set as zero but paid.

    • #194197
      print88
      Participant

      It would appear that the commission did not set to ZERO but PAID.
      But there were not STRIPE transfer record of it.

    • #194202

      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.

    • #194229
      print88
      Participant

      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?

    • #194254

      @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.

    • #194268
      print88
      Participant

      I want the amount to show the commission as zero.

    • #194274

      @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?

    • #196018
      print88
      Participant

      solved

    • #196023

      Happy to hear that. We are closing this thread. If you need help or face issue in future please open a new support thread.

Viewing 15 reply threads

The topic ‘Prevent creation of commission on Cheque Payments’ is closed to new replies.