Change COD default order status to “On Hold” instead of “Processing” in Woocommerce
I need help with a problem-related to plugin "WooCommerce Pay for Payment" which counting some extra fee in shipping. Problem is, that this plugin sets automatically "processing" status in order which causes thanking email for payment (in case of local payment) and don't send email notification about a new order, so customer is confused (I didn't send any money and I received email "thanks for your payment").
I tried this solution: Set WooCommerce order status when order is created from processing to pending
But it only changes order status back to "on-hold" but sends email thank for payment anyway.
Only one thing that I need is to send to the customer in every new order email about a new order, nothing more (I would like to change status to "processing" manually).
Thank you for help, I have no idea how to resolve because I couldn't find PHP file causing a change of status in the plugin.
EDIT: Sorry to all. This was problem of COD in woocommerce plugin. Not Pay for payment as I mentioned. Woocommerce COD automatically set "processing" status.
I found solution for this on github:here
Its the first code.
Based on the answer to this question, this code worked fine for me:
function sv_wc_cod_order_status( $status )
return 'on-hold';
add_filter( 'woocommerce_cod_process_payment_order_status', 'sv_wc_cod_order_status', 15 );
php wordpress woocommerce orders payment-method
|
show 1 more comment
I need help with a problem-related to plugin "WooCommerce Pay for Payment" which counting some extra fee in shipping. Problem is, that this plugin sets automatically "processing" status in order which causes thanking email for payment (in case of local payment) and don't send email notification about a new order, so customer is confused (I didn't send any money and I received email "thanks for your payment").
I tried this solution: Set WooCommerce order status when order is created from processing to pending
But it only changes order status back to "on-hold" but sends email thank for payment anyway.
Only one thing that I need is to send to the customer in every new order email about a new order, nothing more (I would like to change status to "processing" manually).
Thank you for help, I have no idea how to resolve because I couldn't find PHP file causing a change of status in the plugin.
EDIT: Sorry to all. This was problem of COD in woocommerce plugin. Not Pay for payment as I mentioned. Woocommerce COD automatically set "processing" status.
I found solution for this on github:here
Its the first code.
Based on the answer to this question, this code worked fine for me:
function sv_wc_cod_order_status( $status )
return 'on-hold';
add_filter( 'woocommerce_cod_process_payment_order_status', 'sv_wc_cod_order_status', 15 );
php wordpress woocommerce orders payment-method
If you found a solution, please post an answer to your own question.
– Kevin Workman
Nov 13 '18 at 17:35
I have found a much better and efficient solution than the one you found on Github, since there is a dedicated filter hook in for COD Payment method… Please check the answer. It is tested and works.
– LoicTheAztec
Nov 14 '18 at 1:37
LoicTheAztec: I am sorry but it doesn't work. See comment bellow your answer. Thanks
– Jiří Prek
Nov 14 '18 at 9:12
Yes it's working perfectly. It's made for that. But you need to remove your other related customization code before. I have tested it on many installations from Woocommerce 3 to 3.5.x and it works just fine. When you look at the source code, we are just changing the default status from 'processing' to 'on-hold' status when using this filter. That's all. So the error comes from somewhere else.
– LoicTheAztec
Nov 14 '18 at 9:32
LoicTheAztec: Now I tried clear all functions.php and leave only your code- It isn't working. Next I deactivated all plugins except Woocommerce and Really simple ssl and again it isn't working. I have no idea what is causing this issue, but simply is not good for me. Have any idea? I am using easy commerce theme
– Jiří Prek
Nov 14 '18 at 11:56
|
show 1 more comment
I need help with a problem-related to plugin "WooCommerce Pay for Payment" which counting some extra fee in shipping. Problem is, that this plugin sets automatically "processing" status in order which causes thanking email for payment (in case of local payment) and don't send email notification about a new order, so customer is confused (I didn't send any money and I received email "thanks for your payment").
I tried this solution: Set WooCommerce order status when order is created from processing to pending
But it only changes order status back to "on-hold" but sends email thank for payment anyway.
Only one thing that I need is to send to the customer in every new order email about a new order, nothing more (I would like to change status to "processing" manually).
Thank you for help, I have no idea how to resolve because I couldn't find PHP file causing a change of status in the plugin.
EDIT: Sorry to all. This was problem of COD in woocommerce plugin. Not Pay for payment as I mentioned. Woocommerce COD automatically set "processing" status.
I found solution for this on github:here
Its the first code.
Based on the answer to this question, this code worked fine for me:
function sv_wc_cod_order_status( $status )
return 'on-hold';
add_filter( 'woocommerce_cod_process_payment_order_status', 'sv_wc_cod_order_status', 15 );
php wordpress woocommerce orders payment-method
I need help with a problem-related to plugin "WooCommerce Pay for Payment" which counting some extra fee in shipping. Problem is, that this plugin sets automatically "processing" status in order which causes thanking email for payment (in case of local payment) and don't send email notification about a new order, so customer is confused (I didn't send any money and I received email "thanks for your payment").
I tried this solution: Set WooCommerce order status when order is created from processing to pending
But it only changes order status back to "on-hold" but sends email thank for payment anyway.
Only one thing that I need is to send to the customer in every new order email about a new order, nothing more (I would like to change status to "processing" manually).
Thank you for help, I have no idea how to resolve because I couldn't find PHP file causing a change of status in the plugin.
EDIT: Sorry to all. This was problem of COD in woocommerce plugin. Not Pay for payment as I mentioned. Woocommerce COD automatically set "processing" status.
I found solution for this on github:here
Its the first code.
Based on the answer to this question, this code worked fine for me:
function sv_wc_cod_order_status( $status )
return 'on-hold';
add_filter( 'woocommerce_cod_process_payment_order_status', 'sv_wc_cod_order_status', 15 );
php wordpress woocommerce orders payment-method
php wordpress woocommerce orders payment-method
edited Nov 15 '18 at 13:27
LoicTheAztec
88.1k1364101
88.1k1364101
asked Nov 13 '18 at 12:14
Jiří PrekJiří Prek
236
236
If you found a solution, please post an answer to your own question.
– Kevin Workman
Nov 13 '18 at 17:35
I have found a much better and efficient solution than the one you found on Github, since there is a dedicated filter hook in for COD Payment method… Please check the answer. It is tested and works.
– LoicTheAztec
Nov 14 '18 at 1:37
LoicTheAztec: I am sorry but it doesn't work. See comment bellow your answer. Thanks
– Jiří Prek
Nov 14 '18 at 9:12
Yes it's working perfectly. It's made for that. But you need to remove your other related customization code before. I have tested it on many installations from Woocommerce 3 to 3.5.x and it works just fine. When you look at the source code, we are just changing the default status from 'processing' to 'on-hold' status when using this filter. That's all. So the error comes from somewhere else.
– LoicTheAztec
Nov 14 '18 at 9:32
LoicTheAztec: Now I tried clear all functions.php and leave only your code- It isn't working. Next I deactivated all plugins except Woocommerce and Really simple ssl and again it isn't working. I have no idea what is causing this issue, but simply is not good for me. Have any idea? I am using easy commerce theme
– Jiří Prek
Nov 14 '18 at 11:56
|
show 1 more comment
If you found a solution, please post an answer to your own question.
– Kevin Workman
Nov 13 '18 at 17:35
I have found a much better and efficient solution than the one you found on Github, since there is a dedicated filter hook in for COD Payment method… Please check the answer. It is tested and works.
– LoicTheAztec
Nov 14 '18 at 1:37
LoicTheAztec: I am sorry but it doesn't work. See comment bellow your answer. Thanks
– Jiří Prek
Nov 14 '18 at 9:12
Yes it's working perfectly. It's made for that. But you need to remove your other related customization code before. I have tested it on many installations from Woocommerce 3 to 3.5.x and it works just fine. When you look at the source code, we are just changing the default status from 'processing' to 'on-hold' status when using this filter. That's all. So the error comes from somewhere else.
– LoicTheAztec
Nov 14 '18 at 9:32
LoicTheAztec: Now I tried clear all functions.php and leave only your code- It isn't working. Next I deactivated all plugins except Woocommerce and Really simple ssl and again it isn't working. I have no idea what is causing this issue, but simply is not good for me. Have any idea? I am using easy commerce theme
– Jiří Prek
Nov 14 '18 at 11:56
If you found a solution, please post an answer to your own question.
– Kevin Workman
Nov 13 '18 at 17:35
If you found a solution, please post an answer to your own question.
– Kevin Workman
Nov 13 '18 at 17:35
I have found a much better and efficient solution than the one you found on Github, since there is a dedicated filter hook in for COD Payment method… Please check the answer. It is tested and works.
– LoicTheAztec
Nov 14 '18 at 1:37
I have found a much better and efficient solution than the one you found on Github, since there is a dedicated filter hook in for COD Payment method… Please check the answer. It is tested and works.
– LoicTheAztec
Nov 14 '18 at 1:37
LoicTheAztec: I am sorry but it doesn't work. See comment bellow your answer. Thanks
– Jiří Prek
Nov 14 '18 at 9:12
LoicTheAztec: I am sorry but it doesn't work. See comment bellow your answer. Thanks
– Jiří Prek
Nov 14 '18 at 9:12
Yes it's working perfectly. It's made for that. But you need to remove your other related customization code before. I have tested it on many installations from Woocommerce 3 to 3.5.x and it works just fine. When you look at the source code, we are just changing the default status from 'processing' to 'on-hold' status when using this filter. That's all. So the error comes from somewhere else.
– LoicTheAztec
Nov 14 '18 at 9:32
Yes it's working perfectly. It's made for that. But you need to remove your other related customization code before. I have tested it on many installations from Woocommerce 3 to 3.5.x and it works just fine. When you look at the source code, we are just changing the default status from 'processing' to 'on-hold' status when using this filter. That's all. So the error comes from somewhere else.
– LoicTheAztec
Nov 14 '18 at 9:32
LoicTheAztec: Now I tried clear all functions.php and leave only your code- It isn't working. Next I deactivated all plugins except Woocommerce and Really simple ssl and again it isn't working. I have no idea what is causing this issue, but simply is not good for me. Have any idea? I am using easy commerce theme
– Jiří Prek
Nov 14 '18 at 11:56
LoicTheAztec: Now I tried clear all functions.php and leave only your code- It isn't working. Next I deactivated all plugins except Woocommerce and Really simple ssl and again it isn't working. I have no idea what is causing this issue, but simply is not good for me. Have any idea? I am using easy commerce theme
– Jiří Prek
Nov 14 '18 at 11:56
|
show 1 more comment
1 Answer
1
active
oldest
votes
The code that you found in Github is outdated, clumsy and complicated, since there is a dedicated filter hook now. You should better try this lightweight and effective code, that will set the default order status for "Cash on delivery" payment gateway (COD) to "On Hold":
add_filter( 'woocommerce_cod_process_payment_order_status', 'change_cod_payment_order_status', 10 );
function change_cod_payment_order_status( $order_status, $order )
return 'on-hold';
Code goes in function.php file of your active child theme (active theme). Tested and works.
So the default order status set by the payment gateway is now "On Hold" instead of "Processing"
Hi. Thanks for answer. Unfortunatelly your filter hook causing INTERNAL SERVER ERROR and order goes to status pending. On order summary showing this issue and order message with succesfull completion is not showed. I tried another method of delivery and payment and there is no problem with finish of order. So this plugin unfortunatelly doesn't work
– Jiří Prek
Nov 14 '18 at 9:04
Edit:So this filter hook unfortunatelly doesn't work
– Jiří Prek
Nov 14 '18 at 9:13
OK but every piece of my customization code I really need for some purpose. So in this case I have to use "clumsy" code above :-/ Any idea where could be problem?
– Jiří Prek
Nov 14 '18 at 9:41
Now I tried clear all functions.php and leave only your code- It isn't working. Next I deactivated all plugins except Woocommerce and Really simple ssl and again it isn't working. I have no idea what is causing this issue, but simply is not good for me. Have any idea? I am using easy commerce theme.
– Jiří Prek
Nov 14 '18 at 11:57
I am using last version of Woocommerce- 3.5.1..I checked your link and this line of code I have in my files. Unfortunatelly I cannot turn on debugging mode and with help of plugins information I am lost- I don't understand it. Debug mode from some plugin told something but here I cant type it due to length of text. I tried turn on log file with define wp_debug in wp-config.php and It didn't work. Log file didn't appear in wp-content
– Jiří Prek
Nov 15 '18 at 11:19
|
show 5 more comments
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53280800%2fchange-cod-default-order-status-to-on-hold-instead-of-processing-in-woocomme%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The code that you found in Github is outdated, clumsy and complicated, since there is a dedicated filter hook now. You should better try this lightweight and effective code, that will set the default order status for "Cash on delivery" payment gateway (COD) to "On Hold":
add_filter( 'woocommerce_cod_process_payment_order_status', 'change_cod_payment_order_status', 10 );
function change_cod_payment_order_status( $order_status, $order )
return 'on-hold';
Code goes in function.php file of your active child theme (active theme). Tested and works.
So the default order status set by the payment gateway is now "On Hold" instead of "Processing"
Hi. Thanks for answer. Unfortunatelly your filter hook causing INTERNAL SERVER ERROR and order goes to status pending. On order summary showing this issue and order message with succesfull completion is not showed. I tried another method of delivery and payment and there is no problem with finish of order. So this plugin unfortunatelly doesn't work
– Jiří Prek
Nov 14 '18 at 9:04
Edit:So this filter hook unfortunatelly doesn't work
– Jiří Prek
Nov 14 '18 at 9:13
OK but every piece of my customization code I really need for some purpose. So in this case I have to use "clumsy" code above :-/ Any idea where could be problem?
– Jiří Prek
Nov 14 '18 at 9:41
Now I tried clear all functions.php and leave only your code- It isn't working. Next I deactivated all plugins except Woocommerce and Really simple ssl and again it isn't working. I have no idea what is causing this issue, but simply is not good for me. Have any idea? I am using easy commerce theme.
– Jiří Prek
Nov 14 '18 at 11:57
I am using last version of Woocommerce- 3.5.1..I checked your link and this line of code I have in my files. Unfortunatelly I cannot turn on debugging mode and with help of plugins information I am lost- I don't understand it. Debug mode from some plugin told something but here I cant type it due to length of text. I tried turn on log file with define wp_debug in wp-config.php and It didn't work. Log file didn't appear in wp-content
– Jiří Prek
Nov 15 '18 at 11:19
|
show 5 more comments
The code that you found in Github is outdated, clumsy and complicated, since there is a dedicated filter hook now. You should better try this lightweight and effective code, that will set the default order status for "Cash on delivery" payment gateway (COD) to "On Hold":
add_filter( 'woocommerce_cod_process_payment_order_status', 'change_cod_payment_order_status', 10 );
function change_cod_payment_order_status( $order_status, $order )
return 'on-hold';
Code goes in function.php file of your active child theme (active theme). Tested and works.
So the default order status set by the payment gateway is now "On Hold" instead of "Processing"
Hi. Thanks for answer. Unfortunatelly your filter hook causing INTERNAL SERVER ERROR and order goes to status pending. On order summary showing this issue and order message with succesfull completion is not showed. I tried another method of delivery and payment and there is no problem with finish of order. So this plugin unfortunatelly doesn't work
– Jiří Prek
Nov 14 '18 at 9:04
Edit:So this filter hook unfortunatelly doesn't work
– Jiří Prek
Nov 14 '18 at 9:13
OK but every piece of my customization code I really need for some purpose. So in this case I have to use "clumsy" code above :-/ Any idea where could be problem?
– Jiří Prek
Nov 14 '18 at 9:41
Now I tried clear all functions.php and leave only your code- It isn't working. Next I deactivated all plugins except Woocommerce and Really simple ssl and again it isn't working. I have no idea what is causing this issue, but simply is not good for me. Have any idea? I am using easy commerce theme.
– Jiří Prek
Nov 14 '18 at 11:57
I am using last version of Woocommerce- 3.5.1..I checked your link and this line of code I have in my files. Unfortunatelly I cannot turn on debugging mode and with help of plugins information I am lost- I don't understand it. Debug mode from some plugin told something but here I cant type it due to length of text. I tried turn on log file with define wp_debug in wp-config.php and It didn't work. Log file didn't appear in wp-content
– Jiří Prek
Nov 15 '18 at 11:19
|
show 5 more comments
The code that you found in Github is outdated, clumsy and complicated, since there is a dedicated filter hook now. You should better try this lightweight and effective code, that will set the default order status for "Cash on delivery" payment gateway (COD) to "On Hold":
add_filter( 'woocommerce_cod_process_payment_order_status', 'change_cod_payment_order_status', 10 );
function change_cod_payment_order_status( $order_status, $order )
return 'on-hold';
Code goes in function.php file of your active child theme (active theme). Tested and works.
So the default order status set by the payment gateway is now "On Hold" instead of "Processing"
The code that you found in Github is outdated, clumsy and complicated, since there is a dedicated filter hook now. You should better try this lightweight and effective code, that will set the default order status for "Cash on delivery" payment gateway (COD) to "On Hold":
add_filter( 'woocommerce_cod_process_payment_order_status', 'change_cod_payment_order_status', 10 );
function change_cod_payment_order_status( $order_status, $order )
return 'on-hold';
Code goes in function.php file of your active child theme (active theme). Tested and works.
So the default order status set by the payment gateway is now "On Hold" instead of "Processing"
edited Nov 14 '18 at 13:11
answered Nov 14 '18 at 1:31
LoicTheAztecLoicTheAztec
88.1k1364101
88.1k1364101
Hi. Thanks for answer. Unfortunatelly your filter hook causing INTERNAL SERVER ERROR and order goes to status pending. On order summary showing this issue and order message with succesfull completion is not showed. I tried another method of delivery and payment and there is no problem with finish of order. So this plugin unfortunatelly doesn't work
– Jiří Prek
Nov 14 '18 at 9:04
Edit:So this filter hook unfortunatelly doesn't work
– Jiří Prek
Nov 14 '18 at 9:13
OK but every piece of my customization code I really need for some purpose. So in this case I have to use "clumsy" code above :-/ Any idea where could be problem?
– Jiří Prek
Nov 14 '18 at 9:41
Now I tried clear all functions.php and leave only your code- It isn't working. Next I deactivated all plugins except Woocommerce and Really simple ssl and again it isn't working. I have no idea what is causing this issue, but simply is not good for me. Have any idea? I am using easy commerce theme.
– Jiří Prek
Nov 14 '18 at 11:57
I am using last version of Woocommerce- 3.5.1..I checked your link and this line of code I have in my files. Unfortunatelly I cannot turn on debugging mode and with help of plugins information I am lost- I don't understand it. Debug mode from some plugin told something but here I cant type it due to length of text. I tried turn on log file with define wp_debug in wp-config.php and It didn't work. Log file didn't appear in wp-content
– Jiří Prek
Nov 15 '18 at 11:19
|
show 5 more comments
Hi. Thanks for answer. Unfortunatelly your filter hook causing INTERNAL SERVER ERROR and order goes to status pending. On order summary showing this issue and order message with succesfull completion is not showed. I tried another method of delivery and payment and there is no problem with finish of order. So this plugin unfortunatelly doesn't work
– Jiří Prek
Nov 14 '18 at 9:04
Edit:So this filter hook unfortunatelly doesn't work
– Jiří Prek
Nov 14 '18 at 9:13
OK but every piece of my customization code I really need for some purpose. So in this case I have to use "clumsy" code above :-/ Any idea where could be problem?
– Jiří Prek
Nov 14 '18 at 9:41
Now I tried clear all functions.php and leave only your code- It isn't working. Next I deactivated all plugins except Woocommerce and Really simple ssl and again it isn't working. I have no idea what is causing this issue, but simply is not good for me. Have any idea? I am using easy commerce theme.
– Jiří Prek
Nov 14 '18 at 11:57
I am using last version of Woocommerce- 3.5.1..I checked your link and this line of code I have in my files. Unfortunatelly I cannot turn on debugging mode and with help of plugins information I am lost- I don't understand it. Debug mode from some plugin told something but here I cant type it due to length of text. I tried turn on log file with define wp_debug in wp-config.php and It didn't work. Log file didn't appear in wp-content
– Jiří Prek
Nov 15 '18 at 11:19
Hi. Thanks for answer. Unfortunatelly your filter hook causing INTERNAL SERVER ERROR and order goes to status pending. On order summary showing this issue and order message with succesfull completion is not showed. I tried another method of delivery and payment and there is no problem with finish of order. So this plugin unfortunatelly doesn't work
– Jiří Prek
Nov 14 '18 at 9:04
Hi. Thanks for answer. Unfortunatelly your filter hook causing INTERNAL SERVER ERROR and order goes to status pending. On order summary showing this issue and order message with succesfull completion is not showed. I tried another method of delivery and payment and there is no problem with finish of order. So this plugin unfortunatelly doesn't work
– Jiří Prek
Nov 14 '18 at 9:04
Edit:So this filter hook unfortunatelly doesn't work
– Jiří Prek
Nov 14 '18 at 9:13
Edit:So this filter hook unfortunatelly doesn't work
– Jiří Prek
Nov 14 '18 at 9:13
OK but every piece of my customization code I really need for some purpose. So in this case I have to use "clumsy" code above :-/ Any idea where could be problem?
– Jiří Prek
Nov 14 '18 at 9:41
OK but every piece of my customization code I really need for some purpose. So in this case I have to use "clumsy" code above :-/ Any idea where could be problem?
– Jiří Prek
Nov 14 '18 at 9:41
Now I tried clear all functions.php and leave only your code- It isn't working. Next I deactivated all plugins except Woocommerce and Really simple ssl and again it isn't working. I have no idea what is causing this issue, but simply is not good for me. Have any idea? I am using easy commerce theme.
– Jiří Prek
Nov 14 '18 at 11:57
Now I tried clear all functions.php and leave only your code- It isn't working. Next I deactivated all plugins except Woocommerce and Really simple ssl and again it isn't working. I have no idea what is causing this issue, but simply is not good for me. Have any idea? I am using easy commerce theme.
– Jiří Prek
Nov 14 '18 at 11:57
I am using last version of Woocommerce- 3.5.1..I checked your link and this line of code I have in my files. Unfortunatelly I cannot turn on debugging mode and with help of plugins information I am lost- I don't understand it. Debug mode from some plugin told something but here I cant type it due to length of text. I tried turn on log file with define wp_debug in wp-config.php and It didn't work. Log file didn't appear in wp-content
– Jiří Prek
Nov 15 '18 at 11:19
I am using last version of Woocommerce- 3.5.1..I checked your link and this line of code I have in my files. Unfortunatelly I cannot turn on debugging mode and with help of plugins information I am lost- I don't understand it. Debug mode from some plugin told something but here I cant type it due to length of text. I tried turn on log file with define wp_debug in wp-config.php and It didn't work. Log file didn't appear in wp-content
– Jiří Prek
Nov 15 '18 at 11:19
|
show 5 more comments
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53280800%2fchange-cod-default-order-status-to-on-hold-instead-of-processing-in-woocomme%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
If you found a solution, please post an answer to your own question.
– Kevin Workman
Nov 13 '18 at 17:35
I have found a much better and efficient solution than the one you found on Github, since there is a dedicated filter hook in for COD Payment method… Please check the answer. It is tested and works.
– LoicTheAztec
Nov 14 '18 at 1:37
LoicTheAztec: I am sorry but it doesn't work. See comment bellow your answer. Thanks
– Jiří Prek
Nov 14 '18 at 9:12
Yes it's working perfectly. It's made for that. But you need to remove your other related customization code before. I have tested it on many installations from Woocommerce 3 to 3.5.x and it works just fine. When you look at the source code, we are just changing the default status from 'processing' to 'on-hold' status when using this filter. That's all. So the error comes from somewhere else.
– LoicTheAztec
Nov 14 '18 at 9:32
LoicTheAztec: Now I tried clear all functions.php and leave only your code- It isn't working. Next I deactivated all plugins except Woocommerce and Really simple ssl and again it isn't working. I have no idea what is causing this issue, but simply is not good for me. Have any idea? I am using easy commerce theme
– Jiří Prek
Nov 14 '18 at 11:56