Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

NEW! Complete Order Editing Tool!


jhilgeman

Recommended Posts

The status issue will be fixed and the new version will be available in a couple hours. In the meantime, it seems like there's a lot of different ways to apply tax. Some people put it in the sub-total, some put it above the sub-total, some put it below shipping, etc...

 

In my own store, new orders have a Tax order total line that appears above the Sub-Total (I don't tax shipping). Would most prefer to have a tax field added after the shipping line that has ALL The tax? Or how do you want it shown?

 

- Jonathan

Download osCommerce Order Editor v1.2 Here:

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

Link to comment
Share on other sites

Well I cant speak for ppl over in the US, but for those in the UK who are VAT registered, we must have a way to show a full break down on the order.

 

i.e. - Like the break down I showed before.

 

Sub-Total

Shipping

Tax

Grand Total

 

So what would be a good edition all round, I think, would be to have an input for all those options if possible.

 

Especially one that would allow the alteration of the total tax field.

 

You see if we had an order like the following:

 

Widget = ?100.00

Shipping = ?10.00

Tax @ 17.5% = ?19.25

Grand Total = ?129.25

 

At the moment the current code gives this result:

 

Widget = ?100.00

Shipping = ?10.00

Tax @ 17.5% = ?17.50

Grand Total = ?127.50

 

Now the solution would be some way to just alter the fields individually.

Sort of like we make our own calculations if poss.

 

I know it leaves room for error, but it also gives loads of control.

If we could then input our own calculations it would save on code calculations. Plus if someone orders from a country that does not have tax added, i.e. anyone not in the EU in Europe, then they would not have tax added to ANY of the order.

Whereas if they code was built to add tax automatically then you would have problems also.

 

So why not have it so the Admin has control over all input boxes add do his own calculations?

 

All in all it is a superb mod, and frankly something like this should be included in the standard code.

Look at Interchange, that has all of these features and Manual Order etc as standard. Not saying it is better, but these features do need adding to help each store.

 

Good work!

 

Think I have rambled enough, whats everyone elses thoughts?

Link to comment
Share on other sites

If you would like to put buttons in your admin you can do this. For MS2 in admin/orders.php find this around line 398:

This will place an "edit" button next to the packing slip& invoice buttons in your order view.

      <tr>

       <td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a>'; ?></td>

     </tr>

 

Change it to this:

      <tr>

       <td colspan="2" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $HTTP_GET_VARS['oID']) . '" TARGET="_blank">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('action'))) . '">' . tep_image_button('button_back.gif', IMAGE_BACK) . '</a> <a href="' . tep_href_link(FILENAME_EDIT_ORDERS, 'oID=' . $HTTP_GET_VARS['oID']) . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a>'; ?></td>

     </tr>

 

To place and "update" button on the main orders page find this around line 489:

 

      $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>');

    $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a> <a href="' . tep_href_link(FILENAME_EDIT_ORDERS, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a>');

       $contents[] = array('text' => '<br>' . TEXT_DATE_ORDER_CREATED . ' ' . tep_date_short($oInfo->date_purchased));

 

Change it to 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_EDIT_ORDERS, 'oID=' . $oInfo->orders_id). '">' . tep_image_button('button_update.gif', IMAGE_UPDATE) . '</a>');

       $contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_ORDERS_INVOICE, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_invoice.gif', IMAGE_ORDERS_INVOICE) . '</a> <a href="' . tep_href_link(FILENAME_ORDERS_PACKINGSLIP, 'oID=' . $oInfo->orders_id) . '" TARGET="_blank">' . tep_image_button('button_packingslip.gif', IMAGE_ORDERS_PACKINGSLIP) . '</a>');

       $contents[] = array('text' => '<br>' . TEXT_DATE_ORDER_CREATED . ' ' . tep_date_short($oInfo->date_purchased));

 

 

You will also need to add the define in your admin/includes/filenames.php

  define('FILENAME_EDIT_ORDERS', 'edit_orders.php');

 

 

For the order status issue I just did this. In edit_orders.php line 74:

                $UpdateOrders .= "cc_expires = '$update_info_cc_expires',

                       orders_status = '" . tep_db_input($status) . "'

                       where orders_id = '" . tep_db_input($oID) . "';";

 

I just changed it to this to set all of the edited orders to "processing":

                $UpdateOrders .= "cc_expires = '$update_info_cc_expires',

                       orders_status = '" . tep_db_input(2) . "'

                       where orders_id = '" . tep_db_input($oID) . "';";

Link to comment
Share on other sites

Okay, so I added v1.1. It doesn't include everything just yet - I uploaded it before JB posted that note, and it doesn't fix the tax issue just yet. But it does make the mod more usable. Here are the notes:

 

- Added status editing (fixed order status bug from 1.0).

 

- Added comments editing. (with compatibility for osC 2.1)

 

- Added customer notifications.

 

- Added some additional information to the instructions file.

 

- Fixed bug with product names containing single quotes.

 

I added my own recommendation for where to have a new "edit" button, but it's not as extensive as JB's recommendations.

 

I don't think I will add his suggestion of changing edited orders to Processing, though. It's good for a lot of people, but there are still a lot of people that won't want to use it like that. There may also be instances in which orders that are already processed and maybe even delivered may want to update the invoice. You don't want people to double-deliver an order because Delivered got changed back to Processing.

 

My original store has a LOT of custom mods, so I had to strip down this contribution to make it compatible with the default settings (i.e. take out tracking numbers, product and option weights, etc...), but it should be easy to re-add anything you need.

 

However, while this isn't really related to this contribution, here are some ideas that I've implemented and found extremely useful:

 

I've found that having a "paid" database flag/field is helpful, especially when people are sending in checks or money orders, or when credit cards aren't processed during checkout. Currently, I have that paid flag, and in my orders list, if an order is paid for, I have a $ sign next to the order.

 

I also use the Overlib Javascript library to allow me to view the comments right from the order list. Here's a partial screenshot of my orders list.

 

mods.gif

 

Some of those are real time-savers. I've also added a "cancelled" status so that I can keep track of how many orders are cancelled instead of just deleting them.

 

Just some ideas. I'll keep watching this thread for more opinions on the tax.

 

- Jonathan

Download osCommerce Order Editor v1.2 Here:

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

Link to comment
Share on other sites

Nice additions.

 

I am playing with it as we speak.

It is hard to say what the best answer is to the tax query, becos we work in such different ways on either side of the pond.

 

In which case really, there needs to be an option to add tax to the shipping.

 

Perhaps an input box that you can put a tax rate in, the same as in the products line, but one just for tax, and if it contains an input amount the tax is calculated on that for shipping amount + tax, if it is left blank then 0% tax will be calculated as there will be no input figure to calculate from.

Link to comment
Share on other sites

P.S.

 

Anyone using the P&S Shipping and Manual Order mod, dont use this.

It doesnt work, if you add a product it will not update the SPG_ shipping page with the new additions to the order.

 

So beware until this is fixed!

Link to comment
Share on other sites

Jonathan,

 

If you were to contribute the "order flags" and Overlib that you are using I think most people would find that very useful/handy as well. I know I sure would! :lol: Thanks for this great contribution!

Link to comment
Share on other sites

What do you all think about not automatically adding the tax field? Instead, if the tax field is there already, it gets updated.

 

If it isn't there, you have the option of inserting a blank-value, new order total item named "Tax:" - which will then be auto-updated with the sum of the products' tax and shipping tax (if the shipping tax is enabled)?

 

For example, if you have:

Sub-Total: $x.00

Shipping: $y.00

Total: $z.00

 

and you add an entry inbetween Shipping and Total that looked like:

Sub-Total: $x.00

Shipping: $y.00

Tax:

Total: $z.00

 

... upon clicking Update, the Tax: field would be calculated with the appropriate taxes and filled in. Would that work for everyone?

 

- Jonathan

Download osCommerce Order Editor v1.2 Here:

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

Link to comment
Share on other sites

LV0805039?

 

Are you sure that's the right Order ID? Normally, order IDs are only numbers, like 4224, 92712, 5, or 98... It gets generated from an auto-incrementing field in your database.

 

Are you using a contribution or some sort of customized modification that creates special Order IDs? I just checked out from your page and it gave me an order ID of OX0808038

 

I would use a database editor/viewer like phpMyAdmin or MySQLFront to connect to your database and see if you can find the numeric order ID. There has to be one there somewhere (if the mod had COMPLETELY changed the Order ID system, you wouldn't get a message saying the order didn't exist). Then, once you find the numeric order ID, change your link/code to use that order ID instead of the specialized/customized one.

 

- Jonathan

Download osCommerce Order Editor v1.2 Here:

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

Link to comment
Share on other sites

Okay, a bunch more fixes and additions are here. It's been a busy day for releases and patches.

 

Version 1.2

 

- Updated instructions and added some more recommendations.

 

- Corrected the bug in which the "Billing Address" fields would update the "Customer" fields.

 

- Added separate "Billing Address" fields, along with compatibility for osC 2.1 (which didn't have separate billing address info)

 

- Added "Company" and "Suburb" fields to each address section to make them "complete."

 

- Added ability to add auto-calculated "Tax" entry to the order total.

 

- Added option for taxing shipping via a variable near the top of the script.

 

- First (and hopefully last) fix for currency formatting. It used to only calculate using U.S. dollars (how ethno-centric of me...).

 

- Some additional, but minor bug fixes and corrections.

 

Feedback, comments, requests, bug reports, etc... are more than welcome.

 

- Jonathan

Download osCommerce Order Editor v1.2 Here:

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

Link to comment
Share on other sites

Sorry I should look into this more, but I thought I would post straight away at finding this error for anyone else who experiences it.

 

I got this at first attempt at using 1.2:

 

1064 - You have an error in your SQL syntax near 'comments = '' where orders_id = '100235'' at line 29

Link to comment
Share on other sites

Hmmm, line 29 is a bunch of comments. However, line 129 is close to a line that refers to the comments field.

 

Are you using osC 2.1 by any chance?

 

Open the file in notepad or your editor, and go to line 124, which should begin with: orders_status = ......

 

Delete the comma near the end, go down to line 128 (should start with $UpdateOrders), and add the comma right after the first quote and before the word "comments", so it looks like:

 

$UpdateOrders .= ", comments = '" . tep_db_input($comments) . "'";

 

Save and upload the file and see if that works. If so, let me know and I'll upload a "1.2b" version with that compatibility fix.

 

- Jonathan

Download osCommerce Order Editor v1.2 Here:

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

Link to comment
Share on other sites

Also, for anyone who's using a mod that "randomizes" the order ID into a alphanumeric string like AZ12345, here's how to make the mod work (forum member "chfields" just tested it):

 

Open up the edit_orders.php file and replace all instances of:

 

(int)$oID

 

with:

 

$oID

 

I probably won't make this a permanent fix. The osC crew put the (int) cast function in there for a reason, so I'll leave it in there, but add instructions to future versions on how to fix the above problem.

 

- Jonathan

Download osCommerce Order Editor v1.2 Here:

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

Link to comment
Share on other sites

Hmmm, line 29 is a bunch of comments. However, line 129 is close to a line that refers to the comments field.

 

Are you using osC 2.1 by any chance?

 

Open the file in notepad or your editor, and go to line 124, which should begin with: orders_status = ......

 

Delete the comma near the end, go down to line 128 (should start with $UpdateOrders), and add the comma right after the first quote and before the word "comments", so it looks like:

 

$UpdateOrders .= ", comments = '" . tep_db_input($comments) . "'";

 

Save and upload the file and see if that works. If so, let me know and I'll upload a "1.2b" version with that compatibility fix.

 

- Jonathan

 

Yep, that solved it.

 

I am now trying to find a way to make this intigrate with P&G Shipping Mod, as I think quite a number of people use it, but this update tool doesnt work with it. The details are not carried forward to the spg_invoice page etc...

Link to comment
Share on other sites

n!ce

 

few bugs @ tax, hope i can explain it with my english....

 

-) when you click on "edit" you see the product price without tax, but the shipping price is with tax, what happend is that you add the tax twice to the shipping costs!

 

-) i think nearly everyone in austria/germany uses the "cod_fee_calculation" mod, so there is a extra line for the cod fee added. Same thing for this, you have to add tax to this fee! (This fee is also displayed with tax at the edit screen, but there is nothing added).

 

What i mean is when you look at the edit module:

 

Product-Price (w.o. tax)

Shipping (w.o.tax, no it is displayed with tax)

C.O.D Fee (same like shipping)

-----------

Tax

---------

Sum

 

 

Added a Screenshot H E R E

 

 

Zwischensumme = Sub Total

Versandkosten = Shipping

Nachnahmegeb?hr = COD Fee

Mehrwertsteuer = Tax

 

Thx in advance, great mod!

Link to comment
Share on other sites

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...