• Resolved jakvax012

    (@jakvax012)


    Hi,

    I have a problem with order status. We made order status “payment at the store” and we also have payment “store pickup”. In order status settings we set that default status for “store pickup” would be “payment at the store”. This works but we noticed that order statuses flow for order are pending > on-hold > payment at the store
    This is problem because woocommerce sending 2 emails – one when order is in on-hold status and the right one when order has status payment at store.
    Why it don’t go from pending > payment at the store, immediately?

    We have to have switch on emails also in on-hold status, so turn off sending emails in on-hold status is not an option.

    Can you help me where the error could be?

    Jakub

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello, Do you want to skip the on-hold status always? Or for only on specific cases? Or by payment method? If you want to replace the on-hold to your new status you can use this snippet on your functions.php file

    
    function cosm_define_default_status($order_status) {
    
    ? ? ? ? return 'payment-at-store'; //your slug
    
    }
    
    add_filter('woocommerce_default_order_status', 'cosm_define_default_status', 10, 1);
    
    function cosm_remove_transition_on_hold($statuses) {
    
    ? ? if (isset($statuses['on-hold'])) {
    
    ? ? ? ? unset($statuses['on-hold']);
    
    ? ? }
    
    ? ? return $statuses;
    
    }
    
    add_filter('wc_order_statuses', 'cosm_remove_transition_on_hold');

    Hi

    This isn’t really a solution to this problem because it just removes “on-hold” status altogether. Better solution would be if developers changes the code in src/Checkout.php (__construct) in a way that status is not changed at “woocommerce_thankyou” but when WP does it: currently when calling email_instructions() method. There is a apply_filter there when using bacs, cod and cheque called: woocommerce_bacs_email_instructions_order_status, woocommerce_cod_process_payment_order_status, woocommerce_cod_process_payment_order_status. Using this filter you can then “swap” “on-hold” to what ever you want. If devs would use this, then everything will be OK.

    Plugin Author Niloy

    (@im_niloy)

    Hi @jsssolutions
    We are updated the plugin code for order status in version 1.1.1 or later please update to the latest version and let us know if still face the problem.

    As we haven’t received a response, I’ll mark this as resolved. Feel free to open a new topic, if you continue encountering issues or reopen this topic; we’d be happy to assist. Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Problem with sending 2 email’ is closed to new replies.