Automatic Pay Out Improvement Suggestion

WCMp Core

Automatic Pay Out Improvement Suggestion Resolved

Tagged: 

Viewing 10 reply threads
  • Author
    Posts
    • #110138
      JT
      Participant

      Is there any chance “processing” order could be excluded as well from the cron job through settings? Like checkboxes on the admin page to exclude certain status’? I’ve tweaked the file that does the processing and it works great, but when I update I have to change it back (and sometimes forget). I only want to pay vendors when orders are marked complete.

    • #110359

      Hi,
      Use

      wcmp_cron_mass_payment_exclude_order_statuses
      Copy

      this filter to restrict any order status before paid commission.

    • #110365
      JT
      Participant

      So add …

      add_filter('wcmp_cron_mass_payment_exclude_order_statuses', array( 'failed', 'cancelled', 'processing', 'payment processing' ), 10, 2);
      Copy

      to my functions.php?

    • #110423

      Hi,
      Your code is not right. you must add a function and return array value. You can check https://developer.wordpress.org/reference/functions/add_filter/ for your future development. For now, will share the code.
      Use this below code in your current active theme functions.php file to restrict processing order to paid

      // restrict processing order to paid commission
      add_filter( 'wcmp_cron_mass_payment_exclude_order_statuses', function( $order_status_disable ) {
        array_push($order_status_disable, "processing", "on-hold");
        return $order_status_disable;
      } );
      
      Copy
    • #111399
      redilson
      Participant

      Is this based on the status of the Parent order or the Sub Order related to the Commission? If this is all that’s needed to only pay vendors once they’ve marked their order as Complete, this will be most useful!

    • #111402
      JT
      Participant

      It’s on the suborder. It’s working really well. Although I did need to modify the function that gets the posts to return -1 (unlimited) instead of 5. Seems to work more reliably.

      • #111460
        redilson
        Participant

        Can you share your code @JT?

        @WCMP, what’s the Cron job that the auto-pay is fired off on?

    • #111445

      Hi,
      For now we don’t have any direct filter to modify this payout commission number at a time. But you can do this by using remove_action then add_action and then add your modified code.

    • #111622
      redilson
      Participant

      @Raju. Thanks for providing the code above. Would there be a way to also disable payouts when the vendor marks their order as “On Hold” status? Only want to pay them once they mark the order as complete. Thank you!

    • #111733

      Hi,
      We have updated the code in #110423

    • #111898
      redilson
      Participant

      Perfect, thank you!

    • #111934

      Just wanted to take a moment to thank you for choosing WCMp. Your satisfaction is the greatest recognition we could have, so we would request you to give us some feedback on our plugin.
      If you are happy with the core plugin, it will be highly appreciable if you share your experience with other users with a 5/5 rating on the WordPress.org plugin page.

Viewing 10 reply threads

The topic ‘Automatic Pay Out Improvement Suggestion’ is closed to new replies.

Buy all Marketplace addons together, check out our Bundle

Buy at Slashed Price