VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Development Projects, Modifications, Hacks & Tweaks. VM1.1 => Topic started by: chris.t.uk on February 25, 2009, 22:27:48 pm

Title: [HACK] Export Orders and Batch update of Status
Post by: chris.t.uk on February 25, 2009, 22:27:48 pm
Features

Multiple export formats (tab delimited text, csv, native Microsoft Excel, eParcel)
Multiple Invoice production direct to Microsoft Excel,, then straight to printer!
Batch update order status to a new state, and notify customer
Limit orders by date or number
Export multiple order states
Export orderlines
Export customer details only
Column headers as defined by your Virtuemart installation
Multilingual(ish)
Javascript enable/disable option fields for usability

Compatibility

Only works with VM 1.1.X

Preview Images
This is what you are getting!

(http://twinn.co.uk/images/preview_medium.jpg)
(http://twinn.co.uk/images/excel_small.jpg)

This was originally http://forum.virtuemart.net/index.php?topic=36274.0 but support for VM1.0 is no longer, therefore this new post and thread.

export-1.1-0.2: Fixed export company logo to Excel
export-1.1-0.3: Fixed missing update for Text/CSV export types
export-1.1-0.4: Dropped Installer, Zip Windows Unzip Unix problems
export-1.1-0.5: 2009.04.17: Bug fix, removed reference to undefined function
export-1.1-0.6: Support for áéíóú (UTF-8)
export-1.1-0.7: WAMP Image insert Support, XML export added
export-1.1-0.8: Fixed non-update bug introduced in 0.7. Fixed MS Excel Status Update

[attachment cleanup by admin]
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: purestore on March 13, 2009, 08:25:54 am
Hi,

Just what I was looking for. However, I can't get it to work. Very new at this sort of thing and could need some more help please.
Using ftp client and placed the .zip file in the www directory, and the install_export.php to /www/administrator/components/com_virtuemart/html
Get the error message: You do not have permission to access the requested module, when using the other url suggested in vm config admin.= not working.
Also, why are there two .zip files to choose from in the first place to download. Difference? What do I do with the admin.install_export.php file?
It would be easier for someone like myself who just want things to work to have this excellent little thing upploadable via the Extention Manager Install in Joomla.

Please help,

J-E
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: Bruce Morgan on March 13, 2009, 15:54:29 pm
It looks like you have added two features only one of which I am presently interested in (bulk order status updates).  I also see you have two zip files.  Is the second one an update of the first or are these two feastures contained separately in the two files?

I only partially agree with the last post.  I try to minimize my use of hacks because I have to constantly reinstall them with every VM (or Joomla) update.  However, a module is not the answer.  If this works well, it should be added to the VM core.  Even with my very smal business it is quite tedious to update the orders status one at a time.  I think someone on the dev team offered to add it to the core if a good implemtaion is developed.  Are you out here listening to this?

Bruce
www.pepper-passion.com
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: chris.t.uk on March 15, 2009, 21:22:37 pm
Hi all and thanks for the interest.

Firstly, purestore you have read the instructions incorrectly, install_export.php needs to go in your www folder, then navigate to http://yourserver/install_export.php

Sometimes install_export.php will fail, the unzip class fails to find another support class, it is Joomla code so rather than mess with this I included admin.install_export.php for the Medium install.

admin.install_export.php goes to /www/administrator/components/com_virtuemart/html/

Basically this patch uses the same code to install that Virtuemart does to run it's update.  I have tried to make this as simple as possible to install for the end-user (There is also some hidden code that registers the export function, ps_install.php).

There are plans afoot for a VM module installer (I think full implementation is slated for VM2) but at the moment this option doesn't exist but VM1.2(Alpha) does show some foundations for this.  The Joomla Installer would be like using a hammer for a nut for what this hack does.

export-1.1-0.2.zip is an update to export-1.1-0.1.  I've removed it now to avoid future confusion.  I am trying to get this included in VM1.2.




Title: Re: [HACK] Export Orders and Batch update of Status
Post by: Bruce Morgan on March 15, 2009, 22:17:27 pm
I installed your program and tired the easy method.  It indicated a successful installation but it was not working.  I then uploaded the admin.install_expot.php to the inidcated directory as it was not shwing as being present and it still did not work.  I finally just extracted the files and uploaded them all at once.  This was actually the easiest way of all and I was able to get the menu for the export of orders.  However, what I was really looking for was the ability to update order status in bulk.  Where is this little gem hidden?  I tried checking multiple orders and changing the status and then clicked on one of the update buttons.  The only order updasted was the one for wehich I checked the update button.  Am I missing something here?

Bruce
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: chris.t.uk on March 16, 2009, 21:33:24 pm
Hi Bruce,

The hidden gem is in the pink.

After the easy install was there the option of 'Orders' -> 'Export Orders'? It has been tested on WAMP and LAMP.

Chris,
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: Bruce Morgan on March 16, 2009, 22:10:22 pm
I think I misunderstood.  I have one unshipped order received today so I tried doing an export over the range of the orders received today and checked them for bulk update to "shipped".  The export worked fine but when I when I checked the orders list within VM, the status of the most recent order was unchanged showing as "confirmed".

Frankly, I have no need to export order but I do have a need to update the status of multiple orders with a single click of the update button.  There was another hack that did exactly this for the older versions of Virtuemart.  I imagine there are many reasons why people would want to be able to export their orders as CSV files but why would you allow this to happen and change the status on the export file but not also update this within VM?  Sound like a bad idea to me unless I made mistake during my trial export.  Any comments?

Bruce
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: chris.t.uk on March 16, 2009, 22:15:02 pm
In my tests it did upate the VM, if it is not updating in VM then there is a problem, obviously.

The update code goes straight back to core VM code.

The image at the top shows exactly what you are getting in this hack
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: Bruce Morgan on March 16, 2009, 22:26:00 pm
My install was a little funky.  I started with the easy install but not all of the files were written so I completed it with manual upload of files.  Not an ideal situation.  I should also mention that when I exported the three orders, two of them were already shipped and one was not.  If I tried to do this the conventional way one at a time I would get an error message if I tired to update without a change in status.  I would prefer to be abe to do this within the VM order list view.  Many times I am not updating a continuous list of order so I go through and check mark the orders and change their status.  In the other hack there was a bulk update staus button on the upper menu bar that would do this for all of the checkmarked orders.

I understand that you primary interest may be the export function but do you not also sometimes wish to export a number of order that do not form a continuous number sequence?

Bruce
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: chris.t.uk on March 16, 2009, 22:40:18 pm
Hi Bruce,

The manual upload is never ideal, thats why I made the install files, with the fall back to the least favourable option.

The way I'd like to work with my orders is export all outstanding orders for import into external system/invoice printing. If I discovered an item was out of stock, prefer then to go back in, and update these.  All orders that are in a state that is not for export would not be showing in my (filtered) to-do lists.

But then, we all work differently.

P.S Using CSV or Text export would not have updated or shown as shipped the confirmed order in the export file, the code is not there for this format. I will post updated file tomorrow in export-1.1-0.3.outer.zip

Title: Re: [HACK] Export Orders and Batch update of Status
Post by: purestore on March 17, 2009, 06:26:55 am
Hi everyone,
And thank you Chris for clarifying for a newbe like me! I managed to install and it works fine in extended mode in vm but is not visible in Simple mode. I deleted the export.zip and the admin.install_export.php as requested from the screen upon completion of the installation.

Thank you,

Jan-Erik

Title: Re: [HACK] Export Orders and Batch update of Status
Post by: creagenzia on March 31, 2009, 20:04:03 pm
This is an interesting piece and will do what I needed...thank you Chris for your work!

Installation observations:

- easy install does not perform due to a mistake in the filename in install-export.php (it requests still export-1.1-0.2.zip instead of export-1.1-0.3.zip).

- if you adjust install-export.php or rename export-1.1-0.3.zip you will get a "installation succesfull" screen but the installation writes all files as paths (separated with backslash "\") into the root directory instead of into the actual folders.

so the installer needs some more work. I worked my way around by manually deplyoing the files in their relevant places.

If you have VM-Affiliate installed, it will overwrite some files (i.e. header.php and extlayout.js.php) what makes the affiliate admin menu disappear. So this files will have to be adjusted - chris might want to take this into consideration for future releases.
 
don't forget to back up first, if you implement any hack in a life site... ;)
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: chris.t.uk on April 01, 2009, 21:22:40 pm
Yes, the installer has been more problematic, (WinZip, File Perms, etc), than I think it is worth and is distracting from the core purpose of this hack.

Therefore the installer is gone and the download is now a basic unzip and ftp to the server.

As creagenzia notes, this does update the header.php and extlayout.js so modification will be needed to these files if you are using other hacks  (Please backup these two files before installation). I will put this in the docs for 1.1-0.5 please PM me in the meantime if you need guidance on this.

Hopefully we can concentrate now on any problems that occur with the actual export hack!  :P
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: Robroille on April 06, 2009, 19:21:08 pm
the zip file isn't available for download. Whare can i download it ?
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: chris.t.uk on April 06, 2009, 21:36:54 pm
It's at the bottom of the first post? Don't know if you have to be logged in though?
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: wadeo on April 08, 2009, 02:52:27 am
I was able to get it to work, I had a permissions error on my end.

Thanks for a great tool ...

***I was wondering if anyone has had any luck with export 1.1-0.4 ?
I have downloaded it and uploaded it a couple of times with no luck.

All files upload,no errors and I see no changes in VirtueMart(Simple or Extended views).
I'm using the following,
Joomla 1.5.8
VirtueMart 1.1.3

Do I have to run any additional files? Has something been left out from version export -1.1.0.3?

Any help would be grand..****

Fixed... If your having the same issue, check to see if your user account is the same one as your Joomla install, I was using a different account so my install failed.
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: wadeo on April 09, 2009, 10:42:53 am
I have another question about the sales export feature, If I wanted to add another field to the export how hard is that to do.

For instance I would like to export credit card information. We sometimes have to process sales offline.

Any thoughts on how this can be accomplished?

This is a awesome app, real time saver..

Thanks
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: chris.t.uk on April 09, 2009, 22:27:34 pm

To export credit card details you will need to modify the query in get_query() in ps_orders_export.php (I think you'll need to join in table jos_vm_order_payment)

Then just find the function that relates to the type of export you want and add in the fields, also in ps_orders_export.php

If you can do the SQL then it is very easy.

Chris.
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: purestore on April 17, 2009, 06:18:42 am
Hi,

I installed this report by uploading the administrator and components folders via ftp. Installation worked fine however, I get the following error message when using Excel (.xls) as export of choice.

Fatal error: Call to undefined method ps_orders_export::getVendor() in /home/mysite/public_html/administrator/components/com_virtuemart/classes/ps_orders_export.php on line 472

Using Joomla 1.5.10 and vm 1.1.3
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: chris.t.uk on April 19, 2009, 22:07:49 pm
export-1.1-0.5 fixes this.

Chris.
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: DaisyEE8 on April 27, 2009, 14:35:39 pm
Great work! Exactly what I was looking for.
There ist only one little thing.

Can I export the data in UTF-8?
My umlauts are not shown correctly in Excel.
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: wadeo on May 04, 2009, 04:54:22 am

To export credit card details you will need to modify the query in get_query() in ps_orders_export.php (I think you'll need to join in table jos_vm_order_payment)

Then just find the function that relates to the type of export you want and add in the fields, also in ps_orders_export.php

If you can do the SQL then it is very easy.

Chris.

I took a look and it looks like I will need to define other sections of the ps_orders_export.php to out put the CC info.

I was wondering is it possible to include an option to output the CC info or to have a custom ps_orders_export.php that can be downloaded.

Thanks,
wadeo

Title: Re: [HACK] Export Orders and Batch update of Status
Post by: Landrovergek on May 07, 2009, 20:40:35 pm
I installed it the ftp way.

But I can only get the csv and txt export working. the excel export is not working coorectly for me. Do i do something wrong?

VM 1.1.2, Joomla 1.5.9
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: chris.t.uk on May 07, 2009, 21:45:47 pm
Hi all,

Sorry for the delay.

Daisy, export-1.1-0.6.zip supports UTF-8, please let me know how you get on. You only need to upload the ps_export_orders.php file.

Wadeo, an option for CC details would need a bit of work, please PM me if you would like a custom file.

Landrovergek, what error messages do you get? Have all the PEAR support files been uploaded correctly?

Regards,

Chris.
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: wadeo on May 09, 2009, 15:46:17 pm
Great we now have the ability to export the orders. Now for something a bit more tricky....

I was wondering if it is possible to make changes and now import that data?

If not is there a way that I can make mas updates to the status of a range of orders?

Title: Re: [HACK] Export Orders and Batch update of Status
Post by: wadeo on May 11, 2009, 05:07:34 am
chris.t.uk ...PM sent...
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: chris.t.uk on May 12, 2009, 20:59:01 pm
Hi wadeo,

There is the functionality to update a range of orders in the hack, as is, it's in the pink.

OK, you can't select individual orders but my idea is really to export all completed orders and then set the status to shipped so I know what is dealt with, dealing with cancellations/unfulfillables ad hoc.

I can see that people would like to see this on the Order List page, so that they can select the orders to update.  This is not on the horizon at the moment.

To be honest I am working on VM1.2 at the moment and this is taking most of the free time that I have for development. Once VM1.2 is out and depending on how other things pan out then the exporting of credit cards details and importing orders (this would be good for migration from other systems) and selecting individual orders to mass update will move up the agenda.

Regards,

Chris.
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: DaisyEE8 on May 14, 2009, 21:47:46 pm
The umlauts are working now - thanks.

But there are some problems.
Everytime I export to excel I get an error message. "File error - Some Numberdata could be lost"
(Dateifehler - Einige Zahlendaten sind möglicherweise verloren gegangen)

I use german language J!1.5.9 with VM 1.1.2


p.s.
The & is shown as &
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: chris.t.uk on May 15, 2009, 20:57:41 pm
Hi daisy,

Could you check that there are actually orders in the state selected, or even retry with all states selected.   I have noticed this when there are not any orders to export.

Chris.
I will look into the &
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: DaisyEE8 on May 18, 2009, 10:13:07 am
We have 150 orders per month (round about) with a total of 500 oders in several states.
No order state is empty.

Do you need more information about our system?
If you wish I can give you one of those excel sheets.

Title: Re: [HACK] Export Orders and Batch update of Status
Post by: chris.t.uk on May 19, 2009, 21:35:38 pm
Daisy,
Please check your messages for email address.
Chris,
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: wadeo on May 24, 2009, 15:56:11 pm
First off Great Chris and thanks for getting back to me.

I have another request this may be something that I can do on my own with a little guidance.

What I would like to do is change the character that separates the values from a "," to something else. The problem we have is for some reason our customers are putting in a comma in the name field and it is causing all kinds of problems with our order system that we are importing the data due to the extra commas.

So I was looking in the code (ps_orders_export.php) line 1030

Code: [Select]
$exportFormat = "csv";
$delim=",";

So I proceeded to change the comma "," to a pipe "|" saved my changes and well as you know already it did not work.

Is there something else I will need to change for this to work the way I need it to .

Also on future updates to this you may want to add a feature that will allow you to use a custom separating character.

Looking forward to hearing from you and thanks again for a great product.

 
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: chris.t.uk on May 26, 2009, 22:09:03 pm
Line 1305
Change:
$contents .= $db->f("title") . " " . $db->f("first_name") . " " . $db->f("last_name") .$delim;
To:
$contents .= "\"". $db->f("title") . " " . $db->f("first_name") . " " . $db->f("last_name")."\"".$delim;

Should 'trap' the name in a cell.

You should also aim to change the Tab Delimited Text delimiter as the Excel and like should prompt for the delimiter. CSV will just get opened as it wants to see a comma!

If you are not splitting the address and it then gets split over lines then try modifiying the delimiter in  function getAddress, from \n to "," or whatever you like.

Title: Re: [HACK] Export Orders and Batch update of Status
Post by: DaisyEE8 on May 28, 2009, 11:05:31 am
Checked and replied. ;)

It really looks nice now.

Title: Re: [HACK] Export Orders and Batch update of Status
Post by: samparker89 on May 28, 2009, 11:11:58 am
Can anyone tell me what file I modify to change the layout of the invoice which is created in excel (The microsoft excel - invoice one).

Thanks
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: chris.t.uk on May 29, 2009, 20:22:44 pm
ps_orders_export.php -> export_excel_invoices

the image problem you had will be fixed early next week.
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: samparker89 on June 01, 2009, 10:19:02 am
Thanks, how do i get the shipping address in to the top left (where the shop address is).

Thanks
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: chris.t.uk on June 04, 2009, 13:57:01 pm
Manipulation of the cell numbers.

You could just move the code that says Ship To to the shop details output(keeping the cell numbers the same!).

i.e
$excel->writecell(A, B, shopname);
...
$excel->writecell(X, Y, customername);

becomes
//$excel->writecell(A, B, shopname);
$excel->writecell(A, B, customername);
...
//$excel->writecell(X, Y, customername);

Title: Re: [HACK] Export Orders and Batch update of Status
Post by: tyrael84 on June 07, 2009, 22:33:06 pm
When I try to export with to Invoices.xls i got this error in the file

Code: [Select]
<b>Fatal error</b>:  Non-static method imagebmp::imagebmp() cannot be called statically, assuming $this from incompatible context in localhost/administrator/components/com_virtuemart/classes/ps_orders_export.php</b> on line <b>987</b><br />
Please help me.

Thanks for the hack.
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: samparker89 on June 08, 2009, 15:28:06 pm
Hi,

I have found a problem with your hack, might be something i changed or something in your code i am unsure.

My problem is as follows, when i export an order in to excel and the customer enters a different shipping adddress to billing address, the billing address is displayed in both billing and shipping. This creates a massive problem as my parcels will get sent to the wrong address.

Can someone please shed some light on my problem.

Thanks
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: samparker89 on June 08, 2009, 17:14:00 pm
Also Tyrael, I got the same error when my site was still local, once i put it live it worked fine

Hope that helps
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: chris.t.uk on June 08, 2009, 21:57:13 pm
 :) Are you using WAMP? This issue appears to only accept WAMP configrations. I do have a patch but I am trying to finalise XML export, so.... anytime soon will be 1.1-0.7 which will resolve the Invoices issue.

Chris.

P.S. Sam, can you backup your ps_orders_export.php and reapply the hack, this will isolate the problem. Thanks.
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: samparker89 on June 09, 2009, 10:06:45 am
Hi,

I replaced the ps_order_export with the original one and it is still using the billing address for both shipping and billing. I have also replaced all the other files with the originals.

Also just looking at the code (and by any means i am definately no expert) and am wondering if the label will also make the data correspond i.e.

            //name + address
            $sheet->write($startRow + 13, $col, $VM_LANG->_('PHPSHOP_ORDER_PRINT_CUST_BILLING_LBL'), $addressFormat);
            $sheet->write($startRow + 14, $col, $db->f("title")." ".$db->f("first_name")." ".$db->f("last_name"));
            $sheet->write($startRow + 15, $col, $db->f("address_1"));
            $sheet->write($startRow + 16, $col, $db->f("address_2"));
            $sheet->write($startRow + 17, $col, $db->f("city"));
            $sheet->write($startRow + 18, $col, $db->f("country"));
            $sheet->write($startRow + 19, $col, $db->f("zip"));

            $col=3;
            //name + address
            $sheet->write($startRow + 13, $col, $VM_LANG->_('PHPSHOP_ORDER_PRINT_CUST_SHIPPING_LBL'), $addressFormat); - Will having this shipping label make all the data eg name address correspond the the data the customer entered in the shipping address fields?
            $sheet->write($startRow + 14, $col, $db->f("title")." ".$db->f("first_name")." ".$db->f("last_name"));
            $sheet->write($startRow + 15, $col, $db->f("address_1"));
            $sheet->write($startRow + 16, $col, $db->f("address_2"));
            $sheet->write($startRow + 17, $col, $db->f("city"));
            $sheet->write($startRow + 18, $col, $db->f("country"));
            $sheet->write($startRow + 19, $col, $db->f("zip"));

The reason i ask this is because all the $sheet->write... are the same for both shipping and billing, the only difference is the label.

Thanks
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: chris.t.uk on June 09, 2009, 13:06:32 pm
Seems I skipped the check for delivery address on invoice export.  :'(

Will get fixed in 1.1-0.7.

Chris.
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: samparker89 on June 09, 2009, 13:08:55 pm
Thanks! Any idea when this will be released?


Title: Re: [HACK] Export Orders and Batch update of Status
Post by: chris.t.uk on June 10, 2009, 21:03:42 pm
Just now  ;D
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: coleision on June 11, 2009, 22:54:37 pm
Nice little application you have here. It is exactly what I was looking for. I did the easy install of export-1.1-0.7.

I am able to export via date and everything is working smooth except it is not updating the order status. It gives me the warning asking me if I want to and I hit ok, however when I go back and list orders they stay at confirmed and NOT changing to shipped.

Any ideas? I am about ready to go live with my site and really need to get this functionality as we are expecting 1000's of orders very quickly and have a fulfillment center that I will be send the csv to to process the orders etc. Any suggestions would be VERY appreciated!

I also found that having a comma in your company name screws up the report as it is a comma separated format.(ie MyCompany, LLC) so I just removed the comma.
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: samparker89 on June 15, 2009, 10:39:42 am
I am having the same problem, with the .07 release the orders do not update. Everything else is still working fine. I reinstalled .06 however this does not display the shipping address properly. Is there any files in 06 i can replace with 07 so the orders update AND the shipping address is displayed when needed.

Thanks
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: chris.t.uk on June 15, 2009, 22:04:46 pm
 >:( Something that was meant to reduce error messages in the log files skipped the update. Have removed the change and fixed a couple more issues. All in 0.8 ;D 
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: gripped on June 24, 2009, 00:51:26 am
Hi I have installed 0.8 and all seemed well.

The main reason I want to use this is for the bulk updates. They work but even though 'notify customer is checked no emails are sent ?

Any idea what I could try to fix this.

Emails work on every other part of joomla / virtuemart (using SMTP)
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: coleision on June 24, 2009, 03:07:18 am
I updated to 0.8 and was able to update in mass. You my friend just made my day and restored some of my "buyers remorse" of using Virtuemart (yes I am aware that it is free, however I have spend well over 100 hours setting this up to work, so it was not free =)
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: Marco on June 30, 2009, 10:04:25 am
Hi

When I export in excel format I don't get to see the prices, any idea what this could be?
All I see is "&1900uro" in the price fields.

Thanks
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: chris.t.uk on June 30, 2009, 20:53:56 pm
Hi all,

gripped: does the email get sent went you manually update an order? The auto update uses the same routine as the manual update. Are there any log messages?

Marco: Are you using Euro's, not that it should matter? I realy can't explain this as there should only be '0.00' formatting on the numbers, unless the numbers have some formatting in the database, which is flowing into Excel. Have you tried any of the other formats, what happens there?

coleision: Thank You. ;D
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: gripped on July 01, 2009, 00:26:04 am
Quote
gripped: does the email get sent went you manually update an order? The auto update uses the same routine as the manual update. Are there any log messages?

Yes manual update the email gets sent. I have tried previously to generate some information for the logs but the only place I can find to do this is in 'Logfile Configuration
' area of the virtuemart administration panel. With logging enabled and set to debug - 7 (or tip - 8) the only messages I am getting in the logfile are along the lines.

Quote
10:42:50 24/06/09 VirtueMart [DEBUG] [***.***.***.***] [demo] calculating tax based on vendor address
10:42:55 24/06/09 VirtueMart [DEBUG] [***.***.***.***] [unknown user] Using existing Session **************, ID: *******************.

No other information is logged no matter what I do around the shop. So I think the logging may be incomplete ? or setup wrong ?

I have done many tests (with test accounts) and every time manual update through the order list works but bulk update updates the status of the order but no email is sent.

Thank you for replying and if there is anything more I can do, to help you help me please let me know
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: dstein on July 09, 2009, 23:02:44 pm
Hello,

I love this product, it has helped us tremendously. I am trying to upload 1.1-08 and I can't get the 6 PEAR files in the administrator folder for excel to upload. I tried using both filezilla and core FTP and the upload fails on both. I have also been through all their technical support and have changed all their settings. I have also contacted mediatemple where my site is hosted and they can't find an issue either.
I was wondering if anyone else had any trouble or if anyone has any suggestions. I had no trouble uploading version 1.1-06.

Thanks!
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: chris.t.uk on July 12, 2009, 21:04:51 pm
If you got 0.6 up then do not worry about the pear files, they have not changed.

Unfortunately gripped I am at a loss to explain why you would not be emailing updates. Have you tried possibly changing the mail sending format under Joomla settings, there is option of PHPMailer, sendmail and another, (can always change it back).
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: gripped on July 13, 2009, 00:06:44 am
I've got it working.

I'm not sure how it worked for anyone else yet not me ?

/administrator/components/com_virtuemart/html/order.orders_export.php

Line 192 changed the check box value from "checked" to "Y"

Quote
<input
   type="checkbox"
   name="notifyCustomer"
   value="checked"
/>


to

Quote
<input
   type="checkbox"
   name="notifyCustomer"
   value="Y"
/>


I noticed this was the value being sent by the standard order status change and also the value being tested in ps_order.php (at least I think so )
I could not see anywhere in your code where it was changed from "checked" to "Y"

I don't know much php (but trying to learn). Maybe it is a server setup thing which caused it not to work ?
The first line in the following quote (from ps_order.php) confuses me I don't know what it's trying to do.

Quote
$notify_customer = empty($d['notify_customer']) ? "N" : $d['notify_customer'];
      if( $notify_customer=="Y" ) {
         $notify_customer=1;
      }
      else {
         $notify_customer=0;
      }

Anyway thanks for the hack. Will save me much time.

Lee
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: webuser on July 15, 2009, 07:26:50 am
Hi guys thankyou for this extensions. I have had 2 people this week ask me why their shopping cart can't do this. So I was stoked to find this extension, great work. Also thanks Gripped cause I had exactly the same problem with the emails and your solution fixed mine too.
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: inkewbus on August 22, 2009, 07:44:32 am
Had a quick question for you. The module works really well, but I need to see about adding a small change to it. Where would I look to be able to have it add a field for the customer's email address? This is something we need quite badly. Any help would be GREATLY appreciated.
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: DK180 on October 09, 2009, 16:06:23 pm
Hi Chris

Just found your hack and think it just what I need unless you know of another option.  I want to export my sales info into an accounting program to look after my vat and tax affairs etc.

Im thinking, export as csv file and import to the program right now.

I am a little concerned having just spent two weeks with the VM affiliate developers getting it to work properly on J1.5.14  VM1.1.3 with regards to your remarks in response to remarks from:creagenzia who wrote

If you have VM-Affiliate installed, it will overwrite some files (i.e. header.php and extlayout.js.php) what makes the affiliate admin menu disappear. So this files will have to be adjusted - chris might want to take this into consideration for future releases.

you wrote:

 Export Orders and Batch update of Status]Re: [HACK] Export Orders and Batch update of Status (http://Re: [HACK)
« Reply #12 on: April 01, 2009, 21:22:40 pm »

As creagenzia notes, this does update the header.php and extlayout.js so modification will be needed to these files if you are using other hacks  (Please backup these two files before installation). I will put this in the docs for 1.1-0.5 please PM me in the meantime if you need guidance on this.

My questions are: is this still the case? and if so as I am not a programmer can you provide me the guidance to sort the problem as you suggest

Many Thanks
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: webuser on October 27, 2009, 04:30:38 am
Has anyone else noticed that the format of the exported CSV when you choose eParcel is nothing like the format required by Australia Post? Does anyone know whether they have changed the format or whether this was never the right format. Has anyone worked on a fix?
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: chris.t.uk on October 29, 2009, 21:59:37 pm
Here's how to update the menu to show export orders if you already have another hack installed.  Please remove <!--START EXPORT ORDERS MENU MOD--> and <!--END EXPORT ORDERS MENU MOD--> before saving your files.

FILE: administrator/components/com_virtuemart/header.php
Code: [Select]
case 'order':
?>
<h3 class="title-smenu" title="order" onclick="SwitchMenu('<?php echo $modCount ?>')">
<?php echo $VM_LANG->_('PHPSHOP_ORDER_MOD')
?>

</h3>
<div class="section-smenu">
<ul>
<li class="item-smenu vmicon vmicon-16-content">
<a href="<?php $sess->purl($_SERVER['PHP_SELF']."?pshop_mode=admin&amp;page=order.order_list"?>"><?php echo $VM_LANG->_('PHPSHOP_ORDER_LIST_MNU'?></a>
</li>
<!--START EXPORT HEADER MENU MOD-->
<li class="item-smenu vmicon vmicon-16-content">
<a href="<?php $sess->purl($_SERVER['PHP_SELF']."?pshop_mode=admin&amp;page=order.orders_export"?>">Export</a>
<hr />
</li>
<!--END EXPORT HEADER MENU MOD-->
<li class="item-smenu vmicon vmicon-16-content">
<a href="<?php $sess->purl($_SERVER['PHP_SELF']."?pshop_mode=admin&amp;page=order.order_status_list"?>"><?php echo $VM_LANG->_('PHPSHOP_ORDER_STATUS_LIST_MNU'?></a>
</li>
<li class="item-smenu vmicon vmicon-16-editadd">
<a href="<?php $sess->purl($_SERVER['PHP_SELF']."?pshop_mode=admin&amp;page=order.order_status_form"?>"><?php echo $VM_LANG->_('PHPSHOP_ORDER_STATUS_FORM_MNU'?></a>
</li>

</ul>
</div>

FILE: components/com_virtuemart/js/extlayout.js

Code: [Select]
case 'order':
$modules[$module]['title'] = $VM_LANG->_('PHPSHOP_ORDER_MOD');
$modules[$module]['links'][] = array('iconCls' => 'vmicon vmicon-16-content', 'href' => 'page=order.order_list', 'text' => $VM_LANG->_('PHPSHOP_ORDER_LIST_MNU'));
<!--START EXPORT ORDERS MENU MOD-->
$modules[$module]['links'][] = array('iconCls' => 'vmicon vmicon-16-content', 'href' => 'page=order.orders_export',  'text' => 'Export Orders' );
<!--END EXPORT ORDERS MENU MOD-->
$modules[$module]['links'][] = array('iconCls' => 'vmicon vmicon-16-content', 'href' => 'page=order.order_status_list', 'text' => $VM_LANG->_('PHPSHOP_ORDER_STATUS_LIST_MNU'));
$modules[$module]['links'][] = array('iconCls' => 'vmicon vmicon-16-editadd', 'href' => 'page=order.order_status_form', 'text' => $VM_LANG->_('PHPSHOP_ORDER_STATUS_FORM_MNU'));


In response to the 'Australia Post' issue, this was generated for a client who provided a sample file. I have no idea on the correct format or whether it has changed, but can only assume it has done as the customer was happy at the time.

Chris.
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: webuser on October 29, 2009, 23:36:07 pm
cool I think our client is going to ask us to re-do the export script so its the same format as the latest Australia Post eParcel system so if that happens I'll post back here with whatever we come up with.
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: fluidfusion on November 04, 2009, 17:54:47 pm
Just having a look at this and I like it!

Will it allow me to export credit card info?

Also, can I manipulate the order that the fields are exported in so they match a CSV template I have been supplied by my fulfilment house?
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: webuser on November 10, 2009, 06:46:22 am
Hi Chris, I've sent you a PM. We have hacked your hack so that it fits in with the latest eParcel structure soo the PM. Talk soon.
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: EmYia on November 10, 2009, 17:20:35 pm
Hi everybody. First of all thanks for this hack it's exactly what i needed.

But i have a problem :

When i try to export with xls format i got the following error

Fatal error: Cannot redeclare class ole_pps in /usr/local/lib/php/OLE/PPS.php on line 33

it work for every format ( csv,xml,txt )

anyone can help me?

config : joomla 1.5.14 VirtueMart 1.1.3
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: chris.t.uk on November 11, 2009, 21:11:54 pm
Probably a conflict with administator/components/com_virtuemart/classes/PEAR/OLE/PPS.php, they should be the same file.  (Files included in case PEAR is not installed)

Try renaming the file above(PPS.bak), should, hopefully, force it to use the installed PEAR file.
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: EmYia on November 12, 2009, 09:49:53 am
Thanks for answering. I tried rename the file and I've now the following message :

Fatal error: main() [function.require]: Failed opening required '[pathtojoomla]/administrator/components/com_virtuemart/classes//PEAR/OLE/PPS.php' (include_path='.:/usr/local/lib/php') in [pathtojoomla]/administrator/components/com_virtuemart/classes/PEAR/OLE/PPS/Root.php on line 24

What should I do?
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: astridv on November 16, 2009, 13:45:29 pm
Hi all,
I have another quite odd problem: new orders no longer get added to the database (quite detrimental...) AND I export only gibberish, so no legible address..
any ideas? I use VM 1.1.4 and the latest hack.



   Specificatie lijst   
6   2009-11-13 16:05   "  "      ", US"         ", US"         astrid@email.com   Joopy BV   Ä117,92   Ä2,20   Ä7,08   Ä127,20   Ä0,00   Ä0,00   EUR   Shipped   Vooraf per bank   ""   83.163.188.112   sa1   Schip Ahoy!   10   Ä11,79   Ä117,92   Ä12,50   Ä125,00      
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: chris.t.uk on November 17, 2009, 21:13:52 pm
New orders not being added to the database would not be the result of this hack as we don't change any of the core files except for the admin menu pages.

What currency are you using? Was it working before you upgraded to VM1.1.4, I have not actually tested yet with 1.1.4, not that there should be a problem, except maybe the menu options disappearing, see previous posts to fix this.

It would be best to post a file or PM me one.

Title: Re: [HACK] Export Orders and Batch update of Status
Post by: chris.t.uk on November 17, 2009, 21:19:13 pm
EmYia,

Could you rename PPS.bak back to PPS.php and check the permissions on the files in the PEAR ([pathtojoomla]/administrator/components/com_virtuemart/classes/PEAR/) folder, 644 should be ok?
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: DaisyEE8 on December 31, 2009, 10:07:31 am
Hi there, it's me again. ;)

I found a bug(?) on the very last day of this year.
Export Orders 1.1.0.8
J!1.5.14 VM 1.1.3 stable

No problems for a while. But in nower days I cannot export if I choose XLS format.
Works fine for csv or xml but not for xls. The sheet is empty.
Error: Wrong extension for this file - could be corrupted.
Tried around a bit and recognised that if I disable the "show order item?" option the xls is generated with no problems.

we have about 2500 orders using office 2000 and 2007


Thanks in advance and a happy new year!

Daisy


Title: Credit Card Info
Post by: rgbartist on January 14, 2010, 18:26:08 pm
Can we get details for the code and SQL instructions to export Credit Card numbers, expiration and CSV???

this is too vague:

To export credit card details you will need to modify the query in get_query() in ps_orders_export.php (I think you'll need to join in table jos_vm_order_payment)

Then just find the function that relates to the type of export you want and add in the fields, also in ps_orders_export.php

If you can do the SQL then it is very easy.

Chris.
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: anax on February 01, 2010, 18:03:44 pm
Works fine for csv or xml but not for xls. The sheet is empty.
Error: Wrong extension for this file - could be corrupted.
Hia, I just installed the Hack and as with Daisy all is fine for csv and xml. But when I try to export a .xls file I get a page of errors beginning with...
Quote
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/usr/lib/php:/PEAR.php) is not within the allowed path(s): (/home/barbara:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/barbara/public_html/administrator/components/com_virtuemart/classes/PEAR/PEAR_Include.php on line 70

Any help much appreciated.
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: dstein on February 24, 2010, 22:11:52 pm
Hello,
I'd like to start using the Invoices export, but I noticed that product attributes do not show up on this export. Any suggestions for the quickest way for me to add this in?
Thanks!
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: mikefromdenmark on March 05, 2010, 20:07:07 pm
I've downloaded v. 1.08 for J1.5.5 - but i'm having problems with the danish characters Æ Ø Å in the exported data.

Any ideas?
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: thimscool on March 16, 2010, 04:33:40 am
This hack was broken by my upgrade to VM 1.1.4. Specifically, I can no longer do bulk updates of order status. Has anyone else had this difficulty?
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: exhost on April 02, 2010, 16:03:01 pm
Is it possible to get this to work with a cron job?
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: QubeSys Technologies on June 01, 2010, 09:36:18 am
Hi..

Im with Joomla 1.5.18 and VM 1.1.4 .

We process all the orders manually. Is there a way to export the detailed Credit Card Information also into the XLS or CSV file ?

Please let me know..
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: QubeSys Technologies on June 01, 2010, 10:09:30 am
HI..
Is it done on your latest release ?
Let me know, or else, Im ready to pay few dollars to get the updated pack. Please, its urgent.


To export credit card details you will need to modify the query in get_query() in ps_orders_export.php (I think you'll need to join in table jos_vm_order_payment)

Then just find the function that relates to the type of export you want and add in the fields, also in ps_orders_export.php

If you can do the SQL then it is very easy.

Chris.
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: vishnubhatia on September 18, 2010, 14:37:06 pm
Hi Chris, I've sent you a PM. We have hacked your hack so that it fits in with the latest eParcel structure soo the PM. Talk soon.

Hi Webuser/Chris,

Even I am looking for a hack which works with Australia Post eParcel. I tried modifiying the code but did not work well.

Vish
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: saris10 on January 23, 2011, 14:44:01 pm
Hi,
can someone help me?
I need set final XML encoding to windows-1250 instead of utf-8.
In first line of XML i have
<?xml version="1.0" encoding= "windows-1250" ?>
but i need to save file in windows-1250 encoding.

Thanks
jaro
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: rob_st on July 06, 2011, 11:51:57 am
Hi Chris,

thanks for your Hacks, it basically works really fine. But I do have the following issue:

We're using commas as decimal seperator for our prices and we also do use in some product-titles a comma ("Product XY 88cm wide, 50cm deep"). This causes a Problem when the generated .csv-file since columns are spererated with every comma.

How do I change the basic seperator for this tool in something else, like a semikolon or anything?

While using CSV-Improved, I do not have this issue, since that extension changes the "," into "." in all the prices, but I dunno how it does that.

Greetings,
rob
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: Mothertiger on August 22, 2011, 18:41:28 pm
To export credit card details you will need to modify the query in get_query() in ps_orders_export.php (I think you'll need to join in table jos_vm_order_payment)

This hack is magnificent, thank you so much. I have modified it a little, but I am no programmer, and one thing I need to tweak is to use country_name instead of country so the reports will be suitable for our shipping labels. Changing the field name doesn't work and I think this is because the country_name field is in jos_vm_country and this isn't included in the base hack.

Would a kind soul be able to advise me of the exact syntax I need to join this in so I can use country_name? I can take it from there.

(I'm sure I'll figure it out 10mins after making this post now, but I've been scratching my head for a while!)
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: yorkie on September 21, 2011, 14:50:13 pm
Hi Chris, Great piece of code, worked first time for me.
However, I have to create a separate XML file for each order that is received, preferably with an option to selectively choose them from the order list and your code looks like being a great starting point. However, I'm on a steep learning curve switching from ASP coding experience to PHP and I'm trying to figure out what bits of your hack I would need to use or change to get there. I don't suppose you have any notes on how your code works do you?
Thanks
Dave
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: tobydecks on October 04, 2011, 17:26:05 pm
Two words Chris.
***obscenity removed***. Legend.
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: wharfadale on October 06, 2011, 09:12:47 am
Hi everybody!
Thanks for great hack! But how can i display in csv my product type parameters? Thanks!
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: lindapowers on January 04, 2012, 08:43:57 am
Thanks for this great hack.

Works perfectly for what we needed (export daily orders to excel for the transport company)

Just 2 questions:

- What file controls the fields imported? So we can choose which files are going to be imported.

- Is there any way to rename the fields name in the excel file generated?

Thanks
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: lindapowers on January 05, 2012, 09:09:52 am
BTW I'm having the same problem as Marco (&1900uro shown on the price) but just when I choose Microsoft Excel Multi-sheet.

Any ideas on how to solve it? Developer still around? last reply is from 2009  ???
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: nishantk on January 19, 2012, 14:52:33 pm
thanks will give try
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: kleinbaas on February 14, 2012, 00:46:56 am
I've got it working.

I'm not sure how it worked for anyone else yet not me ?

/administrator/components/com_virtuemart/html/order.orders_export.php

Line 192 changed the check box value from "checked" to "Y"

Hello Lee

Thank you so much for sharing your solution. I had the same problem (emails not being sent). I changed "checked" to "Y" and they're being send. Only problem is the email's are being send out twice! (each customer is getting the confirm email twice).

Has anyone else experienced this or have any idea what could be doing this? I am happy to do the looking and fixing myself, but just wanted to check if someone has fixed this or has an insight first.

Thanks in advance.

Edit: I've now fixed this. It wasn't sending the update emails out twice, it was sending out one email for every product! ..and updating the order status for every product. To fix this find the ps_orders_export.php file in this hack and use the $lastOrderID variable to make sure the checkUpdate function is not run when the current order id is the same as $lastOrderID. Do this for the export_text function (for csv files) as it has already been done for the other export types.
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: peters2011 on February 17, 2012, 13:13:06 pm
Features

Multiple export formats (tab delimited text, csv, native Microsoft Excel, eParcel)
Multiple Invoice production direct to Microsoft Excel,, then straight to printer!
Batch update order status to a new state, and notify customer
Limit orders by date or number
Export multiple order states
Export orderlines
Export customer details only
Column headers as defined by your Virtuemart installation
Multilingual(ish)
Javascript enable/disable option fields for usability

Compatibility

Only works with VM 1.1.X

Preview Images
This is what you are getting!

(http://twinn.co.uk/images/preview_medium.jpg)
(http://twinn.co.uk/images/excel_small.jpg)
Where is file or source for this export function?? :(


This was originally http://forum.virtuemart.net/index.php?topic=36274.0 but support for VM1.0 is no longer, therefore this new post and thread.

export-1.1-0.2: Fixed export company logo to Excel
export-1.1-0.3: Fixed missing update for Text/CSV export types
export-1.1-0.4: Dropped Installer, Zip Windows Unzip Unix problems
export-1.1-0.5: 2009.04.17: Bug fix, removed reference to undefined function
export-1.1-0.6: Support for áéíóú (UTF-8)
export-1.1-0.7: WAMP Image insert Support, XML export added
export-1.1-0.8: Fixed non-update bug introduced in 0.7. Fixed MS Excel Status Update
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: pkubik on April 17, 2012, 06:16:54 am
Hello, I would ask if you plan to also hack for VM 2.0? Thank you.
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: elepho on June 05, 2012, 14:48:55 pm
I've been looking for such a tool for months !

Thank you very much chris.t.uk !  ;)
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: Flomik on July 23, 2012, 15:48:22 pm
Very helpful component. Thank You very much!

But I have problem with export to Excel format (HTTP 500). Why, what do You think?
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: manojo on November 13, 2012, 12:44:26 pm
Its posible to put it automatically?

Everytime when an order becomes confirmed, the program generate a xml and save in a folder?
Title: Re: [HACK] Export Orders and Batch update of Status
Post by: lindapowers on November 27, 2012, 19:32:18 pm
I wonder why there's not one single component for virtuemart 1 or 2 that does what this hack is capable of, really, no one needs orders to be exported?

It would be great to see a full component that let us choose what fields to export, edit the name of the fields and the layout of the xml file etc.

Yeah asking is free I know but I really think this would help so many users that have to export data daily.

Not even a commercial component created.