Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Batch Update Status Support


jefs.42

Recommended Posts

ok I think i've pretty much managed to have both sets of checkboxes working...

 

but the reason why my batch update isn't working still is I think because I had to move the code for it down the page... but doing so.. my "form" code isn't around the orders on the page...

 

meaning... normally this code appears right before the coding for the HEADINGS on the orders start:

 

<?php echo tep_draw_form('UpdateStatus', FILENAME_ORDERS,tep_get_all_get_params()); ?>

 

and you can find a /form after this code, right?

 

<tr>

<td class="smallText"><?php echo BUS_HEADING_TITLE . ': ' . tep_draw_pull_down_menu('new_status', array_merge(array(array('id' => '', 'text' => BUS_TEXT_NEW_STATUS)), $orders_statuses), '', '');?> </td>

<td class="smallText" align="right"><?php echo tep_draw_checkbox_field('notify','1',false) . ' ' . BUS_NOTIFY_CUSTOMERS;?></td>

<td class="smallText" align="right"><?php echo tep_draw_input_field('select_all',BUS_SELECT_ALL,'onclick="checkAll(); return false;"','','submit');?>

<?php echo tep_draw_input_field('select_none',BUS_SELECT_NONE,'onclick="uncheckAll(); return false;"','','submit');?>

 

<?php echo tep_draw_input_field('submit',BUS_SUBMIT_UPDATE_STATUS,'','','submit');?> </td>

</tr>

 

the problem is that the batch print code also needs to be pretty much in the same places...

 

so my question changes... how does one use 2 tep_draw_form codes around the same parts of coding...

 

for instance in HTML if I wanted to use a <table> inside another <table> I'd have to write it this way

 

<table>

<tr>

<td><table></table></td>

</tr>

</table>

 

 

is there a way to reproduce something like that with php and have my 2 forms work around the same coding?

Link to comment
Share on other sites

  • Replies 50
  • Created
  • Last Reply

Top Posters In This Topic

Yeah, it looks like there's a few issues here that may make it rough.

 

First I'm almost positive you can't have forms within each other. So only one takes precedence (not sure if it's which comes first or last). So by moving my tep_draw_form down to solve that, the checkboxes are no longer part of the form. So you'd have to set it up to use only one form for both contributions.

 

But my contribution <form> submits to orders.php, and the print one submits to it's own (print_batch_process.php). So my code at the top of orders.php that does the actual updating would need moved to print_batch_process.php or vice versa.

 

Second is that, most likely, the javascript include for the print batch just loops through all checkboxes in the form under the (understandably) notion that all of them are for the print batch contribution. Where as my javascript only loops through the ones named update_oID[]. Not all that good with javscript, so I'm not sure if or how to modify the other one to only check the print batch boxes.

 

The last wouldn't be a huge deal if the first can be worked out. Depending on what you need to print/update you'd either have to Check All for the print batch then Uncheck All for the Update which would leave you with only the print batch boxes checked. Or you'd have to manually uncheck any you didn't want both checked.

Link to comment
Share on other sites

  • 2 months later...

Hell,

 

Wonderful contribution.

 

I installed, got it working, then made the modifications for the comment box....all great stuff.

 

Thanks to all for this.

 

I just note that after the UPDATE STATUS is clicked, it does all that it is supposed to do and returns to the same scree.........here I would expect it to have the comments box bland.....to start again.....but the earlier comments stay there....anyway to clear this ?

 

dca

Link to comment
Share on other sites

  • 3 months later...

I have been using this contribution for a while and love it! However, we recently moved to a different hosting and for some reason after the move, when we use the batch update, it does update the order, but in the order status history box on the bottom of the screen, there are no update notes there. I know it is updating the orders because if I go into the order and try to update it to something like shipped after updating it to shipped with the batch update, it gives me an error saying it's already been done. However, you cannot tel it was done because the order status history isn't showing it. Now if I am in the order and have it set to shipped and add a comment (causing there to be something for it to add) it will update the order and also show that update in the order status history portion. Any idea why the batch status update is not parsing to the order status history section?

 

Thank you,

David Henderson

Link to comment
Share on other sites

I have been using this contribution for a while and love it! However, we recently moved to a different hosting and for some reason after the move, when we use the batch update, it does update the order, but in the order status history box on the bottom of the screen, there are no update notes there. I know it is updating the orders because if I go into the order and try to update it to something like shipped after updating it to shipped with the batch update, it gives me an error saying it's already been done. However, you cannot tel it was done because the order status history isn't showing it. Now if I am in the order and have it set to shipped and add a comment (causing there to be something for it to add) it will update the order and also show that update in the order status history portion. Any idea why the batch status update is not parsing to the order status history section?

 

Thank you,

David Henderson

 

Ok, I did a little more testing. It seems that the batch status update is working if I only check one customer to update. However, if I choose 2 or more and try to update their status, it does update it for all intents and purposes, unfortunately it does not add that to the messages area. So we cannot see that the update has been done. It shows the correct status on the orders screen where it lists a bunch of orders at once, but if you go to a specific customer's order page there's no way to tell what his status actually is if it has been updated with the batch status updater. Any thoughts on what could be causing this problem and maybe what I could do to fix it?

 

Thank you,

David Henderson

Link to comment
Share on other sites

Ok, I did a little more testing. It seems that the batch status update is working if I only check one customer to update. However, if I choose 2 or more and try to update their status, it does update it for all intents and purposes, unfortunately it does not add that to the messages area. So we cannot see that the update has been done. It shows the correct status on the orders screen where it lists a bunch of orders at once, but if you go to a specific customer's order page there's no way to tell what his status actually is if it has been updated with the batch status updater. Any thoughts on what could be causing this problem and maybe what I could do to fix it?

 

Thank you,

David Henderson

 

 

I think I've found the problem, just not sure of the solution yet. Basically after looking at my orders_status_history table in my database, I noticed that the first order has an orders_id, but all of the others that were checked have an orders_id of 0, here is a copy paste of the table I'm looking at. So basically, for some reason it is not grabbing the oder id of the multiple orders that I am trying to update. How can I get it to use the order id's of the multiple orders I check mark to update?

 

12014 3973 3 2007-08-23 17:07:18 1

Edit Delete 12015 0 3 2007-08-23 17:13:05 1 Batch status update

Edit Delete 12016 0 3 2007-08-23 17:16:59 1 Batch status update

Edit Delete 12017 0 3 2007-08-23 17:17:00 1 Batch status update

Edit Delete 12018 0 3 2007-08-23 17:17:00 1 Batch status update

Edit Delete 12019 0 3 2007-08-23 17:17:00 1 Batch status update

Edit Delete 12020 0 3 2007-08-23 17:17:00 1 Batch status update

Edit Delete 12021 0 3 2007-08-23 17:17:00 1 Batch status update

Edit Delete 12022 0 3 2007-08-23 17:17:00 1 Batch status update

Edit Delete 12023 0 3 2007-08-23 17:17:01 1 Batch status update

Edit Delete 12024 0 3 2007-08-23 17:17:01 1 Batch status update

Edit Delete 12025 0 3 2007-08-23 17:17:01 1 Batch status update

Edit

Link to comment
Share on other sites

I think I've found the problem, just not sure of the solution yet. Basically after looking at my orders_status_history table in my database, I noticed that the first order has an orders_id, but all of the others that were checked have an orders_id of 0, here is a copy paste of the table I'm looking at. So basically, for some reason it is not grabbing the oder id of the multiple orders that I am trying to update. How can I get it to use the order id's of the multiple orders I check mark to update?

 

12014 3973 3 2007-08-23 17:07:18 1

Edit Delete 12015 0 3 2007-08-23 17:13:05 1 Batch status update

Edit Delete 12016 0 3 2007-08-23 17:16:59 1 Batch status update

Edit Delete 12017 0 3 2007-08-23 17:17:00 1 Batch status update

Edit Delete 12018 0 3 2007-08-23 17:17:00 1 Batch status update

Edit Delete 12019 0 3 2007-08-23 17:17:00 1 Batch status update

Edit Delete 12020 0 3 2007-08-23 17:17:00 1 Batch status update

Edit Delete 12021 0 3 2007-08-23 17:17:00 1 Batch status update

Edit Delete 12022 0 3 2007-08-23 17:17:00 1 Batch status update

Edit Delete 12023 0 3 2007-08-23 17:17:01 1 Batch status update

Edit Delete 12024 0 3 2007-08-23 17:17:01 1 Batch status update

Edit Delete 12025 0 3 2007-08-23 17:17:01 1 Batch status update

Edit

 

 

Ok, I wasn't quite right about that. It seems that if I check from the top order down, selecting multiple orders to update the status on, then the change tries to use oder_id 0, which causes nothing to actually update. However, if I check from the bottom up, then it uses the first order I checked as the order_id for all of the orders that I am trying to update. When that happens, I end up with one order with multiple status changes of the same type in it. Does anyone know what could be wrong in the code to cause this and what I can modify to fix it? Please?:)

 

Thanks,

David Henderson

Link to comment
Share on other sites

  • 4 weeks later...

Awesome contribution! It saves me alot of time and I really appreciate all the great help in this forum!

 

Is it possible to have the orders listing show the orders number next to the checkboxes? This would make it a little quicker to pick the order numbers and save

a little bit of shuffling back and forth.

 

Thanks again for a great contrib. I wish I would have installed it from the beginning!

Link to comment
Share on other sites

  • 1 month later...

Hiya guys, yes this is a fantastic contrib, saves sooo much time when it comes to processing orders!

 

Just something I have thought of that may saves even more time... A drop down box that has a list of commonly used messages and comments.

 

E.g. The stupid Royal Mail postal strike caused havoc with our orders and we had to advise everyone of the delays to their orders.

 

I will work this out and try and install this, however, this will require databasing with add/edit/delete options for the pre-made text. Hmm, maybe to start off with, just start off with simple text based statements?

 

I'd love to hear what others things of this idea?

Link to comment
Share on other sites

  • 2 months later...

Hey

 

I have installed v1.0 and have a problems with the order URL it is giving in the email the customer receives. Currently our admin is not on SSL but our customer accounts are. When updating the order status via the orders.php the email the customer receives has the 'Detailed Invoice' as http rather than https. I am assuming this is because I am sending the emails via the non SSL side of the site. Is there a way around this without moving my admin to SSL?

 

Many thanks

Alex

Link to comment
Share on other sites

  • 2 months later...

Hello, this is a great contrib., I like ver. 0.4 best.

 

 

But I would like some help to mod this a little and it will be perfect for what I need.

 

So far we can, batch: pending, process, delivered.

 

How hard will it be to batch delete?

 

Also I have another mod: cancelled orders which rather then deleting an order you can mark it as cancelled (replaces delete button) and it stays in the orders screens for future reference? Can this be added in the batch options?

 

Thanks again.

Link to comment
Share on other sites

  • 1 month later...

Hi folks. I'm currently working on getting a new version up, as I noticed that the v1.0 that's was put up doesn't actually work as is (w/ no language file BUS_SUBMIT is not defined and therefor the update loop never gets run), there's some excess code (like doctype and <head> stuff stuck down in the middle of the page), all the text is moved back into the orders.php file and I believe it should be separated out.

 

Also with making it language independent again, I'm making it so the Comment Bar buttons are defined in the language also. So you'll be able to create as many as you want, or none and just have the Reset to clear the comments field.

 

After that, I will work on adding the Delete ability as that seems to be a favorite request.

 

mafiouso: The select box will list any Status values that are setup in Localization->Orders Status. So, unless your 'Cancelled' does anything other than set that as the Status, just add 'Canceled' as a status option in the Localization section. And in that vain - you can add as many Status's that you want, edit the 3 that are osC defaults, etc.

Link to comment
Share on other sites

  • 2 weeks later...

No. And there's no plans for it, as that would start taking it back toward individualizing.

 

If someone wanted to start a new contribution implemeting individual order options, obviouslly the code is freely available to do that. But this one will continue only being for doing the exact same thing for many orders at once.

Link to comment
Share on other sites

Wanted to annouce for all those who were asking for it, and anyone who wants it that version 1.2 is now available which includes the ability to use it for deleting multiple orders at once.

 

Note that the ability to delete is optionally, and in fact must be turned on to be used (setting is in the language file).

 

Like the indivdual deletion, a Restock checkbox is also provided (only shows up when the Delete option is selected).

 

http://addons.oscommerce.com/info/3749

Link to comment
Share on other sites

Awesome work sir, thanks for all your efforts.

I have a quick question/small problem.

 

Can you select orders 1, 3, 5 for example (or infact any single order) using the checkboxes?

Ive tried to do this using IE and Firefox, and as soon as you check the box its as if you had clicked somewhere on the line, ie it selects that order. (the round info icon changing to the triangle).

If I choose select all it works, but again if I try to unselect one it all are unselected.

I guess its a javascript prob.... :-"

Link to comment
Share on other sites

I can't reproduce your issue. I can check/uncheck indivdual boxes with no problem in Firefox and IE (both 7 and 6).

 

The default orders.php has an onclick='...' in the <tr>'s so that clicking anywhere in that row will reload the page with that item selected (barring the case that you click on the preview button which loads a new page).

 

This contribution modifies that and removes the onclick from the <tr> and puts it into each of the <td>'s EXCEPT for the one with the checkbox.

 

I would recheck the code around 430-450 (depending which version you're using) and compare to the INSTALL file and/or the included orders.php with your version. This is the begining of the 3rd of the 3 sections modified. It sounds very much like the onclick is still in the <tr> so it applies to the <td> holding the checkbox as well as the rest of the row.

 

 

p.s. - javascript should be fine as that's what does the select all/none anyways ;)

Link to comment
Share on other sites

  • 2 weeks later...
I can't reproduce your issue. I can check/uncheck indivdual boxes with no problem in Firefox and IE (both 7 and 6).

 

The default orders.php has an onclick='...' in the <tr>'s so that clicking anywhere in that row will reload the page with that item selected (barring the case that you click on the preview button which loads a new page).

 

This contribution modifies that and removes the onclick from the <tr> and puts it into each of the <td>'s EXCEPT for the one with the checkbox.

 

I would recheck the code around 430-450 (depending which version you're using) and compare to the INSTALL file and/or the included orders.php with your version. This is the begining of the 3rd of the 3 sections modified. It sounds very much like the onclick is still in the <tr> so it applies to the <td> holding the checkbox as well as the rest of the row.

 

 

p.s. - javascript should be fine as that's what does the select all/none anyways ;)

Hi Jeff,

Thanks very much with your help I fixed it.

User error as usual.... ie mine.

Sorry about that! :rolleyes:

Link to comment
Share on other sites

  • 2 months later...

Hello!

 

This looks like a great contrib but I can't get it to work. I have installed everything from the newest version and all the checkboxes and buttons are there but the buttons don't work - or rather nothing happens when I click on them.

 

The check all button does nothing; if I check the boxes and click the uncheck all button nothing happens; and if I check boxes, choose a status change, and click update status nothing happens.

 

The buttons to put comments in the box DO work, but they are the only ones.

 

When I click on the buttons that do not work, I get a little message in the bottom corner of the browser that says "error on page" which I am guessing means a javascript error, correct? Does anyone know how to check this or fix it?

 

Thank you in advance for your help!

 

Blessings,

Krisann

Link to comment
Share on other sites

  • 9 months later...

I thought I'd hit gold with this one but the "select delete" has a problem.

Select all, select "delete orders" from the drop down, then hit "delete" are you sure? It will only delete the order highlighted (the first order in column) and not all those checked.

Am I missing something?

Ride It Like You Stole It

Link to comment
Share on other sites

  • 1 month later...

any thoughts about this?

 

i have installed, and no errors on teh store for that. but when i select orders to update and click the update button, it tells me that the order does not exist.

 

any thoughts on what could be the issue or where to look?

 

Cheers,

 

AL

Link to comment
Share on other sites

  • 2 years later...
  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...