BigCommerce - Hosted Ecommerce Software by Interspire

Interspire Forum

 
Go Back   Interspire Forum > Interspire Shopping Cart Community Forum > Customization and Integration > Code Modification and Addon Releases

Reply
 
Thread Tools Display Modes
  #1  
Old 10-28-2008, 06:17 PM
charlie.foxtrot + charlie.foxtrot is offline
Interspire Customer
 
Join Date: Oct 2008
Posts: 322
Default Remove Confirmation Dialog Before New "Status" Applied

Normally, I like the convenience of having admin forms do things for me automatically. Most automatic actions happen because the web page contains a bit of JavaScript code that has an "onClick()" or "onChange()" event.

When these are present, things happen automatically without my having to click a "Submit" button.

That's fine... most of the time. However, this can be problematic when it comes to changing the Status of an order (eg: "Shipped", "Cancelled", "Refunded", etc.)

It's problematic because many "Status" choices will automatically generate an email message that's sent to the customer. There's NO room for error! --- In the event you accidentally click the wrong choice, your customer may receive an automatic email alert with the wrong message.

Then, when you make the CORRECT choice, your customer may receive ANOTHER automatic email alert. (No doubt this will be confusing and annoying for your customer.)

Just below is a solution that works for me. This hack was made on ISC 4.0 (Starter edition).

1) Backup all important files.
2) Edit the file: /admin/templates/order.manage.row.tpl
3) At (or near) line 22 the following appears:

<select onclick = "order_status_before_change = this.selectedIndex; status_box=this" id="status_%%GLOBAL_OrderId%%" name = "status_%%GLOBAL_OrderId%%" class = "Field" onchange = "update_order_status('%%GLOBAL_OrderId%%', this.options[this.selectedIndex].value, this.options[this.selectedIndex].text)">

4) Replace that line with the following:

<select onclick = "order_status_before_change = this.selectedIndex; status_box=this" id = "status_%%GLOBAL_OrderId%%" name = "status_%%GLOBAL_OrderId%%" class = "Field" onchange = "if(!confirm('CONFIRM STATUS CHANGE:\n\nOrder:\t%%GLOBAL_OrderId%%\nFROM:\t' + this.options[order_status_before_change].text + '\nTO:\t' + this.options[this.selectedIndex].text)) { this.selectedIndex = order_status_before_change; return false; } update_order_status('%%GLOBAL_OrderId%%', this.options[this.selectedIndex].value, this.options[this.selectedIndex].text)">

5) Save the file and upload it to the correct directory on your server. (You make a backup copy right??)

Whenever you change the status of an order in the "View Orders" admin page, you'll receive a detailed pop-up confirmation.

If you click "OK" the changes will be applied (and, if applicable, an email will be sent). If you click "Cancel" then the old value is restored and nothing else happens.

Enjoy!
~Charlie

PS: Back up your files!! Any errors or improvements... post 'em here!

EDIT: Added some spaces to make the code a bit more readable.

Last edited by charlie.foxtrot; 10-28-2008 at 07:02 PM..
Reply With Quote
  #2  
Old 10-29-2008, 11:03 AM
babyREFLUX + babyREFLUX is offline
Interspire Customer
 
Join Date: Apr 2008
Posts: 1,715
Default

There has been a pop-up confirmation in every version up to v4.0 - I assume it is an oversight and will be corrected in v4.0.1?
Reply With Quote
  #3  
Old 10-29-2008, 04:13 PM
charlie.foxtrot + charlie.foxtrot is offline
Interspire Customer
 
Join Date: Oct 2008
Posts: 322
Default

Quote:
Originally Posted by babyREFLUX
There has been a pop-up confirmation in every version up to v4.0 - I assume it is an oversight and will be corrected in v4.0.1?
Thanks for the reply. That's very interesting... I did not know that. My first experience with ISC is version 4.0, so I've got nothing to compare it to.

I thought it was a little odd that this feature of the program didn't have a confirmation dialog. Until it's "fixed", I hope my little hack helps someone out (it's definitely helping me.)
Reply With Quote
  #4  
Old 10-29-2008, 04:28 PM
babyREFLUX + babyREFLUX is offline
Interspire Customer
 
Join Date: Apr 2008
Posts: 1,715
Default

Quote:
Originally Posted by charlie.foxtrot
I thought it was a little odd that this feature of the program didn't have a confirmation dialog.
Pop-up confirmations are always a hindrance until you realise how easy it is to make a mess of things when they are not there!
Reply With Quote
  #5  
Old 05-06-2009, 10:36 PM
AnimalMakers + AnimalMakers is offline
Interspire Customer
 
Join Date: Mar 2009
Posts: 171
Default

I don't know what you all are talking about. I am using 5.0.2 and it does NOT have a popup confirmation when the status of an order is changed.

Thanks to charlie.foxtrot, it does now. Thank you very much.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump