Author Topic: Task #27 - Edit Order Feature  (Read 81441 times)

kaltokri

  • Jr. Member
  • **
  • Posts: 57
    • Die Bogenecke
Task #27 - Edit Order Feature
« on: March 02, 2007, 08:24:29 am »
This is an information-page of the virtuemart addon edit order -> Link to Flyspray Task #27.

Description
Sometimes it’s necessary to modify an order:
 - add/remove items
 - change quantity
 - modify shipping costs
 - apply discounts
 - change the owner of an order

So virtuemart must allow to change orders after they have been placed. This Add-On allows the Admin to change the orders. Some day in the future it will be part of the official virtuemart! Until it is not a part of vm, please remember:

This is a hack. Use at your own risk!

Tested with joomla 1.0.15 and vm 1.1.0.

Installation
The needed files are attached to this post. joomlaXplorer is a good tool to do the actions descripted below. To install the AddOn you have to:

   1. Download ONLY the file change_order_vXXX.zip.
   2. Unpack this file into a temporally directory.
   3. Open joomlaXplorer.
   4. Upload and overwrite the files in the archive.

With the version 0.8.8 you can also upload the zip file to the joomla root directory and unpack it with joomlaXplorer.

Now this AddOn is installed. But remember, it is possible that an upate of virtuemart overwrite this AddOn and you need to upload the files again! Sometimes the Add-On doesn't work with a new version of joomla or vm. I try to solve this problems as soon as i can, but sometimes i doesn't have time to analyse, so your help is welcome.

If you want more functionallity or bugfixes and you are able to programm php, feel free to do the work and send it to me. I'll integrating it. Thanks.

Usage
Change only one thing at the same time and click on the small icon right beside the form you have changed. So this modification is save and the page will be reloaded. Otherwise you lost all changes, execpt the modifications from that form, where you have click the icon.
If you want to change the "bill to"-address [move order to another user] the user you want to assign must still exist. If it doesn't exist, create the user first.
To change the "ship to"-address the user must have this address as alternative shipping address. You can add new addresses in the user account administration.
If a customer make an order per telephone or mail and you must enter the order do the following steps:
 - Login to the frontside (not admin backend) of your shop with your own account.
 - Cofigure and place the order like you would buy the order.
 - After the order is placed, change to admin backend, virtuemart, orders and open the order.
 - Now change the "bill to"-address to the right user.
If a user change his address the "bill to"- and "ship to"-addresses won't be changed automatically. They are stored in the datarecord of the order. So if you need to change a address, first chage it in the user account and reassign the user to the "bill to"-field.
In edit order you find a field discount. If you type a negative value in it, it will change to fee.

Wishlist
 - Add a coupon to an order.
Problem: If the coupon is added by mistake it will be deleted and you can’t get it back [Rolf].

 - Combine two orders from one customer.
Problem: Much work to implement and i don’t understand the code of nfischer for adding products [Rolf].

 - Automated e-mail to customer with changed order.
Alternative: a button to send e-mail to customer is easier to implement [Rolf].

 - Make discounts per %.
Comment: Why do this? You can do it easily by yourself with a calculator  ;) [Rolf].

 - Choose and store status for each item of the order.
Comment: This will be integrated in the next version of virtuemart [Rolf].

Known errors/limitations
   - This AddOn is difficult to install.
   - Stock levels can go into negative range. This is causing problems within the rest of vm.
   - The discount is only one value in the database. So if the discount was modified through an item with discount and this item is removed the discount will not be changed and is wrong.
   - Some entries in the language files are in english (please help to translate).
   - Different programmers worked on this addon and used different programming styles.
   - Some parts of the sourcecode are hard to understand.

Downloads
In v0.8.8 for vm 1.1.0 the language system was changed. Because of this only the german version is added. Please help and send me translatet versions. Look at v0.8.7 for an old version of the language file to save work.

[attachment cleanup by admin]
best regards,
Rolf Geuenich

https://www.bogenecke.de

Pisu

  • Contributing Developer
  • Jr. Member
  • *
  • Posts: 451
  • ..still looking for..
    • Blog di Stefano Bagnatica
Re: Task #27 - Edit Order Feature
« Reply #1 on: March 20, 2007, 20:09:35 pm »
Many thanks, this is a very important hack, I hope will be inserted in official release soon. I'm attaching Italian translation...

Some comments:
  • I'm not sure that select list is a good choice, it's useful but I have 2000 products and the page is slow to load... What about inserting directly the desidered product sku? In fact, this function is to be used from shop admins, so it's not a great problem.
  • line 1029 of ps_order_change.php: what is $ps_order_edit? It's causing a "notice" error to me.
  • In the same file, variable $mosConfig_offset should be defined as global, like at line 884.
  • Line 471 of ps_order_change_html.php: "Action" is untranslated.

Hope I can help you!

[attachment cleanup by admin]
Pisu - Team VMItalia (Supporto Italiano VirtueMart)
www.stefanobagnatica.it | www.vmitalia.net

kaltokri

  • Jr. Member
  • **
  • Posts: 57
    • Die Bogenecke
Re: Task #27 - Edit Order Feature
« Reply #2 on: April 04, 2007, 13:51:06 pm »
Thanks for your help, but this topic should only have the installation instructions and files. Discussions should be done in http://virtuemart.net/index.php?option=com_smf&Itemid=71&topic=26445.0

Now i transfer Edit Order in the vm trunk. Only a sku field isn't enoght, i think. I'll try to programm a search field like it is used in the product list.
best regards,
Rolf Geuenich

https://www.bogenecke.de

Sveneld

  • Beginner
  • *
  • Posts: 1
Re: Task #27 - Edit Order Feature
« Reply #3 on: April 09, 2007, 13:58:53 pm »
Hello. Tthis is a very important hack. Thank you.
I'm attaching Russian translation...
I can't change the shipping method :(

[attachment cleanup by admin]

kaltokri

  • Jr. Member
  • **
  • Posts: 57
    • Die Bogenecke
Re: Task #27 - Edit Order Feature
« Reply #4 on: April 16, 2007, 09:52:00 am »
Thanks for the translations. I've found and fixed the shipping bug. New version is coming soon!
best regards,
Rolf Geuenich

https://www.bogenecke.de

Sveneld

  • Beginner
  • *
  • Posts: 1
Re: Task #27 - Edit Order Feature
« Reply #5 on: April 16, 2007, 10:02:39 am »
I wait an update version with impatience.

kaltokri

  • Jr. Member
  • **
  • Posts: 57
    • Die Bogenecke
Re: Task #27 - Edit Order Feature
« Reply #6 on: April 17, 2007, 10:13:12 am »
New Version is attached in first post. Please test it and give me a feedback.
best regards,
Rolf Geuenich

https://www.bogenecke.de

Pisu

  • Contributing Developer
  • Jr. Member
  • *
  • Posts: 451
  • ..still looking for..
    • Blog di Stefano Bagnatica
Re: Task #27 - Edit Order Feature
« Reply #7 on: April 17, 2007, 13:10:58 pm »
Thank you, all right, this could be very useful! For the problem of my 2000 products, what about using a double select: in the first you choice the main category of product, and the second list will be filled with relative products (also in subcategories), with a JS-XML function...
Pisu - Team VMItalia (Supporto Italiano VirtueMart)
www.stefanobagnatica.it | www.vmitalia.net

Sveneld

  • Beginner
  • *
  • Posts: 1
Re: Task #27 - Edit Order Feature
« Reply #8 on: April 17, 2007, 14:08:42 pm »
Thank you. Shipping change is working now. What about joining of orders? It will be also very useful

Pisu

  • Contributing Developer
  • Jr. Member
  • *
  • Posts: 451
  • ..still looking for..
    • Blog di Stefano Bagnatica
Re: Task #27 - Edit Order Feature
« Reply #9 on: April 18, 2007, 23:37:08 pm »
What about joining of orders? It will be also very useful

Useful, but I don't think this is  real priority. Now first work is to integrate this in official VirtueMart....
Pisu - Team VMItalia (Supporto Italiano VirtueMart)
www.stefanobagnatica.it | www.vmitalia.net

Anthony C.

  • Jr. Member
  • **
  • Posts: 286
Re: Task #27 - Edit Order Feature
« Reply #10 on: July 10, 2007, 18:18:42 pm »
hi kaltokri,

I really want to thank you for developing this modification. It saves me a lot of time when we need to modify the order.

Great Job.

By the way, does it work if I name order.order_print.php to another file? for example, orde.order_mod_print.php

I just want to put a link into my order_print file so I don't need to replace it all the time.

Thank you,

Anthony

kaltokri

  • Jr. Member
  • **
  • Posts: 57
    • Die Bogenecke
Re: Task #27 - Edit Order Feature
« Reply #11 on: July 17, 2007, 08:45:43 am »
I don't know. Please try it and post the result here.  :)
best regards,
Rolf Geuenich

https://www.bogenecke.de

HulaQueen

  • Jr. Member
  • **
  • Posts: 316
Re: Task #27 - Edit Order Feature
« Reply #12 on: July 24, 2007, 03:10:25 am »
Has anyone noticed that if you add a product in edit order, that brings quantity to a negative number that product in stock notifications go out? This problem isn't really an edit order feature, however I'm not sure where to report it. Any ideas?

kaltokri

  • Jr. Member
  • **
  • Posts: 57
    • Die Bogenecke
Re: Task #27 - Edit Order Feature
« Reply #13 on: July 24, 2007, 08:56:02 am »
This "bug" is known. I hope the vm developers take care of it in vm 1.1. The question is: Should we chage edit order, so that the product in stock can't go negativ or change the behaviour of vm.
best regards,
Rolf Geuenich

https://www.bogenecke.de

Anthony C.

  • Jr. Member
  • **
  • Posts: 286
Re: Task #27 - Edit Order Feature
« Reply #14 on: July 24, 2007, 19:41:27 pm »
about the renaming the file name:

It didn't work. It just redirect the page to my original order.order_print.php

is this related to line: 87 <input type="hidden" name="page" value="order.order_print" /> ?
must change to order.order_mod_print?

Thanks,

Anthony