Forums / Managing Customers and Orders / Admin order-status update default to no mail?

Admin order-status update default to no mail?

Views: 940

Results 1 to 7 of 7
15 Jul 2016, 3:47 PM
#1
helenewallis avatar

helenewallis

Totally Zenned

Join Date:
Jun 2016
Location:
Suffolk VA
Posts:
625
Plugin Contributions:
0

Admin order-status update default to no mail?

I've looked and I don't see any way to have the orders default to 'no mail' when there is a status update. Typically, the only time I update an order is to note that it has been shipped, and the customer already gets an email from the shipping service. I'd rather have it default to no mail and have to change it if necessary for a specific situation, than to have to remember every time to click on no mail. I've looked in the email options in Configuration, and in both the Customer and Order sections.

15 Jul 2016, 4:10 PM
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Admin order-status update default to no mail?

You'll need to edit /YOUR_ADMIN/orders.php to make that change (this really should be a store-configuration item, IMO). Find the following section towards the bottom of the file:

              <tr>
                <td class="main"><strong><?php echo ENTRY_NOTIFY_CUSTOMER; ?></strong> [<?php echo zen_draw_radio_field('notify', '1', true) . '-' . TEXT_EMAIL . ' ' . zen_draw_radio_field('notify', '0', FALSE) . '-' . TEXT_NOEMAIL . ' ' . zen_draw_radio_field('notify', '-1', FALSE) . '-' . TEXT_HIDE; ?>]   </td>
                <td class="main"><strong><?php echo ENTRY_NOTIFY_COMMENTS; ?></strong> <?php echo zen_draw_checkbox_field('notify_comments', '', true); ?></td>
              </tr>

To change the default to "No Mail", you'll make the following **highlighted **edits:

[B]<?php
//-bof-Change default setting to "no email"
?>[/B]
              <tr>
                <td class="main"><strong><?php echo ENTRY_NOTIFY_CUSTOMER; ?></strong> [<?php echo zen_draw_radio_field('notify', '1', [B]false[/B]) . '-' . TEXT_EMAIL . ' ' . zen_draw_radio_field('notify', '0', [B]true[/B]) . '-' . TEXT_NOEMAIL . ' ' . zen_draw_radio_field('notify', '-1', FALSE) . '-' . TEXT_HIDE; ?>]   </td>
                <td class="main"><strong><?php echo ENTRY_NOTIFY_COMMENTS; ?></strong> <?php echo zen_draw_checkbox_field('notify_comments', '', true); ?></td>
              </tr>
[B]<?php
//-eof-Change default setting to "no email"
?>[/B]

It's "good practice" to add some sort of comments surrounding your changes to core- (and template-override-) files so that it's easier to merge those changes on the next Zen Cart update.

15 Jul 2016, 4:10 PM
#3
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Admin order-status update default to no mail?

HeleneWallis:

I've looked and I don't see any way to have the orders default to 'no mail' when there is a status update. Typically, the only time I update an order is to note that it has been shipped, and the customer already gets an email from the shipping service. I'd rather have it default to no mail and have to change it if necessary for a specific situation, than to have to remember every time to click on no mail. I've looked in the email options in Configuration, and in both the Customer and Order sections.
This requires a code change in the admin/orders.php file. While the line numbers have likely changed, I know it to be in this forum because I have previously provided the direction to someone on how it's done. smirk Will see what can be found...

Edit: Well, there you have it. No need to look.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

15 Jul 2016, 4:37 PM
#4
helenewallis avatar

helenewallis

Totally Zenned

Join Date:
Jun 2016
Location:
Suffolk VA
Posts:
625
Plugin Contributions:
0

Re: Admin order-status update default to no mail?

lat9:

You'll need to edit /YOUR_ADMIN/orders.php to make that change (this really should be a store-configuration item, IMO). Find the following section towards the bottom of the file:
...

It's "good practice" to add some sort of comments surrounding your changes to core- (and template-override-) files so that it's easier to merge those changes on the next Zen Cart update.

Thanks much, I think it should be a store configuration item too (hint, hint!). I'll tweak the code, and I always comment heavily. Spent years as a maintenance programmer fixing software with zero comments. Learned the hard way, lol. I also have a file with a well-commented explanation of every change I've made to my ZenCart and why.

15 Jul 2016, 6:00 PM
#5
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Admin order-status update default to no mail?

HeleneWallis:

...Spent years as a maintenance programmer fixing software with zero comments. Learned the hard way, lol. I also have a file with a well-commented explanation of every change I've made to my ZenCart and why.
Yep, me too! Reminds me of a time when I was going to use another person's code as a "base" but found that the code (10K+ SLOC) contained not one comment. His response: "The comments only say what the code's supposed to do, so there's no point in including them.".

I just wrote what I needed from scratch ...

16 Jul 2016, 1:30 PM
#6
helenewallis avatar

helenewallis

Totally Zenned

Join Date:
Jun 2016
Location:
Suffolk VA
Posts:
625
Plugin Contributions:
0

Re: Admin order-status update default to no mail?

LOL. Been there done that. To be fair, some of the older languages didn't make it easy to comment anything. But there's no excuse for not doing it now.

16 Jul 2016, 1:56 PM
#7
helenewallis avatar

helenewallis

Totally Zenned

Join Date:
Jun 2016
Location:
Suffolk VA
Posts:
625
Plugin Contributions:
0

Re: Admin order-status update default to no mail?

And thank you. Just made the change, works as it should.