Jump to content
Sign in to follow this  
JB

Order Update Tool- too sweet!

Recommended Posts

Since Alonso has now uploaded the wonderful repaired version of his Order Update Tool I figured I would put up the simple add-on of placing a button in the admin that links to his update tool page. This is not needed, but makes it a little easier than having to type in the actual file name to use the update utility. First his contribution is found here:

 

http://www.oscommerce.com/community/contributions,728

 

To add a button just go to admin/orders.php and around line 560 ish find this bit of code:

 

        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');

 

Replace it with this:

 

        $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>  <a href="' . tep_href_link(FILENAME_UPDATE_ORDER) . '" TARGET="_blank">' . tep_image_button('button_update.gif', IMAGE_UPDATE) . '</a>');

 

 

This will place an "update" button in your main orders page in the admin section. To update any order just click on "update" and select the order you would like to change from the drop-down list. The "update" button image should already exsist so there is no need to upload a new image for one and it should already be defined in the languages file. HTH

Share this post


Link to post
Share on other sites

You also need to update application_top.php to link it correctly:

 

define('FILENAME_UPDATE_ORDER', 'update_order.php');

 

Just add that to application top.

 

CC.

Share this post


Link to post
Share on other sites

hehe :) I've learned the best way to learn is to play and that's what I'm doing, although my hair does seem to be lighter! I just can't seem to stop pulling it! :lol:

Share this post


Link to post
Share on other sites

So does the new order update also add attirbutes when "adding" a product to the order?

 

This is the only reason why we cannot currently use this contrib.

Share this post


Link to post
Share on other sites

Oops...sorry about that! I did the mod to my files a week or so ago and knew there was a define somewhere, but at first I thought it was the image, forgot all about the application_top file...thanks!!!

Share this post


Link to post
Share on other sites

Robert - No it doesnt let you add attributes.

 

Justin - Never mind, it werent a hard one to sort.

 

Marie - I know your site isnt based on OSC at the mo, but holy body stockings Batman!! :shock:

Some luuuurvely ladies you got there. :wow: :biggrin:

(Just kiddin)

 

CC.

Share this post


Link to post
Share on other sites
Robert - No it doesnt let you add attributes.

 

Damn. :(

 

Anyone want to add this to the current contrib? I'll pay you for your time.

Share this post


Link to post
Share on other sites
haha-Steve you bad boy! :twisted:  

 

It'll be up in about 2 days. Everything is getting transferred on the 14th.

 

Argh the ladies have always been my weakness. :lol:

 

Cant wait to see your store.

Bet you cant guess why... :lookround:

 

Are you going to post it in My Store forum for us all to have a peak at?

 

CC.

Share this post


Link to post
Share on other sites

Problem using order update tool Order Update Tool v.1.3.1

 

I received the folowing message after clicking select order

 

 

Failure

I was unable to fetch the products from catalog.products.

 

Last MySQL Message was:

Column: 'products_name' in order clause is ambiguous

Last MySQL Query was:

SELECT * FROM products p LEFT JOIN products_description pd ON pd.products_id=p.products_id ORDER BY products_name

Share this post


Link to post
Share on other sites

HEHEHE

 

Here is a better code change to make a button apppear on the order page in admin:

 

$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a> <a href="' . tep_href_link(FILENAME_UPDATE_ORDER, 'OrderID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_update.gif', IMAGE_UPDATE) . '</a>');

 

This makes it so that when you click on the Update Button, It will automatically divert to the right order ID, save having you to select it from the list.

 

Warren

Share this post


Link to post
Share on other sites

Thanks Warren...even sweeter yet! ;) I actually got to use this today when someone called and wanted to add an item to an order...worked like a charm.

Share this post


Link to post
Share on other sites

This is a great contribution. However, in the drop list of products to choose from in the add new line item, I am getting about 40 lines of blank space before I see any of my product items in the list. Also I am getting some doubles and triples of each different item in the list.

 

 

MOD Suggestion: It would be nice if we could also delete an item off the list too. Food for thought.

 

 

Anybody have some suggestions on these problems I am having. This is Version 1.3.1 .

 

 

 

RazorSharp :?

Share this post


Link to post
Share on other sites

I just found another problem with this Order Update MOD.

 

Lets say you just added a new item to the order, and hit the order update button. Now you see the new item in the list. Now, if you keep hitting the refresh button it keeps adding that last new item to the list multiple times depending on how many times you hit the refresh button on your browser. So, for an example if I hit the refresh button 5 times it would add the last new item you just entered 5 times.

 

Is anybody else having this same problem.

 

 

Razor Sharp :(

Share this post


Link to post
Share on other sites
This is a great contribution. However, in the drop list of products to choose from in the add new line item, I am getting about 40 lines of blank space before I see any of my product items in the list. Also I am getting some doubles and triples of each different item in the list.

 

The triplicate products will be down to the fact you are using multiple languages. Say the 3 standard languages.

 

Lets say you just added a new item to the order, and hit the order update button. Now you see the new item in the list. Now, if you keep hitting the refresh button it keeps adding that last new item to the list multiple times depending on how many times you hit the refresh button on your browser. So, for an example if I hit the refresh button 5 times it would add the last new item you just entered 5 times.

 

Why is this a bug?

You are bound to have this happen as you are refreshing the last action on that page, this isnt a bug...

Why are you refreshing the page anyway?

 

Surely you would only use this if something did not load correctly?

Best thing IMO - Dont keep clicking refresh, theres no need!

 

CC.

Share this post


Link to post
Share on other sites

Steve:

 

 

You know that someone is going to click refresh button more then once. Thats why I test all contigencies with a contribution. There is a definite problem/bug here. And, just do hit refresh is not the solution to the problem. Also, as far as double and triples in my list. Why are all the double and triples in the drop down list all in english, and not in the other languages too?

 

 

 

RazorSharp

Share this post


Link to post
Share on other sites

ok first off...

 

You know that someone is going to click refresh button more then once. Thats why I test all contigencies with a contribution. There is a definite problem/bug here.

 

Who will?

If this will be one of your employee's that is your job to sort out what they know is a correct process and what is not.

This isnt a public function, so if an Admin does something wrong, that is in effect your problem!

It is not a bug.

That is what refresh does!

 

Also, as far as double and triples in my list. Why are all the double and triples in the drop down list all in english, and not in the other languages too?

 

You tell me, it is your site!

How can we answer questions based on your website?

 

Have you written the name of each product in the translation of each language?

Most names are spelt the same in alot of languages.

If you are calling a "widget" a "widget" in English, German and Spanish then it will show the same 3 times.

 

If you want answers to questions give full details of each question...

Sure some experienced OSC users are knowledgable, but none of us are mind readers buddy!

 

CC.

 

P.S. Cheers Warren. :wink:

You are quite right, there is nothing wrong with the mod.

This is Open Source, if it doesnt work for you, change it yourself.

Or pay someone!

Share this post


Link to post
Share on other sites
RazorSharp, leave CC alone you bully!!

 

I dont see anything wring with the mod!

 

Well...

 

Bully - I dont know.

 

Newbie - Very maybe!

 

CC.

Share this post


Link to post
Share on other sites

Warren Ashcroft:

 

 

I am not trying to pick on CC. I don't even know CC. However, I am just saying that any good programer would make sure that there are no problems/bugs with any programing that they create. And, If I had created this contribution, and someone brought to my attention this problem. I would have said thank you I really appreciate you taking the time to test my program, and pointing out any and all problems with it. I would have then fixed the problem, and asked those same people if they would be kinda enough to test it again. Don't take it personal.

 

 

 

RazorSharp

Share this post


Link to post
Share on other sites
However, I am just saying that any good programer would make sure that there are no problems/bugs with any programing that they create. And, If I had created this contribution....

 

Just a suggestion, then why don't you fix it and upload it? There is no "lock-out" that prevents you from adding a package to the contribution. FWIW, I have yet to find any program that contains no bugs or problems can you name one? While you are busy creating the new version see if you can add attributes as well...people would go "gah,gah".

 

I would have said thank you I really appreciate you taking the time to test my program, and pointing out any and all problems with it. I would have then fixed the problem, and asked those same people if they would be kinda enough to test it again.

 

As far as I know, the person who contributed this does not even know this thread exists...maybe he is busy coding instead of complaining and saying what he would do. Do yourself a favor and try installing the older versions of this contribution and you will see why its current status is, at the very least, a vast improvement over what was available previously. I don't recall anyone ever saying it was perfect or even complete as most contributions in this project, like the project itself, are under a continuous state of development. I think if you actually contacted the creator of the latest version you would find he would say "thank you" just as you mention. Why do you think v1.31 came out so quickly after v1.30, it was from people saying "hey,I found this problem" so those particular problems were addressed for the moment. I personally would never have thought of refreshing a page that has no reason to be refreshed...normally I make a change, hit the submit button and close the page as I am done. There is a simple piece of code you can add to prevent this "bug" as you say, where if the page is refreshed it takes you back to the base file instead of the order_id that you just worked on preventing the quantities from increasing. Add it to your own file and then you can be happy, while the rest of us will simply avoid refreshing the page. :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×