Banner Logo

Be a part of the family: Connect, Receive Support,
Contribute, and Reap Abundant Rewards!

Cash Commission are PAID but Credit Card Commission are set as ZERO instead

MultivendorX

Resolved
Viewing 21 reply threads
  • Author
    Posts
    • #215641
      print88
      Participant

      Previously I had a ticket with regards to setting CASH commission as ZERO which was solved:
      https://multivendorx.com/support-forum/topic/prevent-creation-of-commission-on-cheque-payments/

      However, Dec 22, 2023 onwards, the commission for CASH is paid and commission for CREDIT CREDIT is ZERO.

      Please assist. What went wrong?

    • #215661

      @print88 Sorry to hear that you have faced an issue on your end.
      Kindly share the code that you have added on your end for this modification. It seems there might be some issue in the code that is why it is not working on your end accordingly.
      Once you share the code our team will check that and will be able to help you further.

    • #215680
      print88
      Participant

      Codes haven’t changed for the last 6 months.
      This is the snippet I am using

      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 == ‘cheque’ ) {
      $order = wc_get_order($order_id);
      update_post_meta( $commission_id, ‘_commission_amount’, $order->get_subtotal() );
      update_post_meta( $commission_id, ‘_commission_total’, 0 );
      }
      }

      // paid commission automaticly for cod payment
      add_action( ‘after_wcmp_calculate_commission’, function( $commission_id, $vendor_order_id )
      {
      $payemnt_method = get_post_meta( $vendor_order_id , ‘_payment_method’ , true ); if( $payemnt_method == ‘cheque’ ) {
      update_post_meta( $commission_id , ‘_paid_status’ , ‘paid’ );
      }
      },10,2);

    • #215689
      Zia Rahim
      Participant

      You have a spelling mistake for the payment method. It is spelt “payemnt_method”. Its also good practice to use straight single quotes rather than curly quotes.

      • #215694
        print88
        Participant

        This is the exact coding sent to me by your IT team.
        Also the coding had been working for the past 6 months and suddenly have problem on the 22nd of December.

        I have corrected the typo and will report again when problem persist.

    • #215700
      print88
      Participant

      Credit card commission are paid as instructed but CASH commission calculated as zero but on the commission page, it is show as PAID.
      It is confusing.

    • #215705

      @print88 Thank you for providing us with the code. Upon reviewing it, it appears that the functionality of setting the vendor commission to zero is specifically associated with payments made via cheque. This does not affect COD or any other payment methods.
      Please proceed to remove or comment out the relevant custom code on your end and observe the commission creation flow for each payment mode. Keep us updated on your progress so that we can provide further assistance as needed.

    • #215761

      @print88 Kindly create a staging site where the code is added and your issue is replicated and then share the site url, temporary admin and ftp access with us so that we can check.

      While sharing the access don’t forget to mark your reply as private.

    • #215785
      print88
      Participant
      This reply has been marked as private.
    • #215794

      Hello @print88, Since you’ve provided access to your live site, could you also share test vendor and customer account details with us? This will enable us to examine the commission creation flow on your end.

    • #216611
      print88
      Participant

      Vendor Login
      diamond516
      (19805637Cc)

      Please note that any order made a physical printout invoice will be printed at my client’s physical store.
      Please put in the NOTES “TEST ORDER” and cancel/delete the order afterwards.

    • #216615

      @print88 Thanks for sharing the access with us.
      However, in accordance with our support policy outlined at https://multivendorx.com/how-to-get-support/, we are unable to test the issue on your live site. Since creating a staging site is not feasible for you, we kindly request that you take a backup of your live site. Please inform us once the backup is complete, and also provide FTP access to your site so that we can proceed accordingly.

    • #216616
      print88
      Participant
      This reply has been marked as private.
    • #216622

      @print88 We are not able to place order o your end as it shows this https://prnt.sc/3ZZBz_Wgf2-g. We are open for 2 more hours so if possible please let us know how we can place an order and check the issue on your end.

    • #216656
      print88
      Participant

      You can turn off the store hours at WooCommerce => Store Hours.
      Please turn it back on after your inspection.

    • #216665

      Thanks for the update. We checked your site but there is no code added in the functions.php file of your current active theme (http://tinyurl.com/ypucof25). Can you please let us know where have you added the code on your end.

    • #216680
      print88
      Participant
      This reply has been marked as private.
    • #216683

      @print88 We are unable to access the link you provided for accessing the code snippet. We are getting this while trying to access the shared url: http://tinyurl.com/yvq947aq.

    • #216737
      print88
      Participant
      This reply has been marked as private.
    • #216740

      Hi @print88, We are still not able to access the page of code snippets on your end. We are getting this http://tinyurl.com/ytjmoqz7 while accessing the url.

    • #216741
      print88
      Participant

      please use this link

      https://dinein.club/print88

    • #216744

      @print88 Check the below code for vendor commission to become zero for cash on delivery payment method-

      
      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 );
          $order = wc_get_order($order_id);
          $payment = $order->get_meta( '_payment_method', true );
          if( $payment == 'cod' ) {
              update_post_meta( $commission_id, '_commission_amount', 0 );
              update_post_meta( $commission_id, '_commission_total', 0 );
          }
      }
      
      Copy

      You can add the modification in this code according to your requirement. Let us know if you need any further assistance from our end.

    • #218666

      It’s been long and we have not heard back from you. We presume your query is resolved now. We are closing this thread. If you need help or face issue in future please do create a new support ticket.

Viewing 21 reply threads

The topic ‘Cash Commission are PAID but Credit Card Commission are set as ZERO instead’ is closed to new replies.