Author Topic: [HACK] Export Orders and Batch update of Status  (Read 90723 times)

chris.t.uk

  • Contributing Developer
  • Jr. Member
  • *
  • Posts: 98
Re: [HACK] Export Orders and Batch update of Status
« Reply #30 on: May 19, 2009, 21:35:38 pm »
Daisy,
Please check your messages for email address.
Chris,
Hacks
Export Orders & Batch Update -> http://forum.virtuemart.net/index.php?topic=52215.0
UK Counties -> http://forum.virtuemart.net/index.php?topic=33968.0
Sites running Virtuemart
http://www.ladders247.co.uk http://www.tools247.co.uk http://www.mackay.co.uk
Synchronization
Synchronized with our instore system via PrePrepSQL and missing Image Remote Retrieval system ;-)

wadeo

  • Beginner
  • *
  • Posts: 23
Re: [HACK] Export Orders and Batch update of Status
« Reply #31 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.

 

chris.t.uk

  • Contributing Developer
  • Jr. Member
  • *
  • Posts: 98
Re: [HACK] Export Orders and Batch update of Status
« Reply #32 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.

Hacks
Export Orders & Batch Update -> http://forum.virtuemart.net/index.php?topic=52215.0
UK Counties -> http://forum.virtuemart.net/index.php?topic=33968.0
Sites running Virtuemart
http://www.ladders247.co.uk http://www.tools247.co.uk http://www.mackay.co.uk
Synchronization
Synchronized with our instore system via PrePrepSQL and missing Image Remote Retrieval system ;-)

DaisyEE8

  • Beginner
  • *
  • Posts: 16
Re: [HACK] Export Orders and Batch update of Status
« Reply #33 on: May 28, 2009, 11:05:31 am »
Checked and replied. ;)

It really looks nice now.


samparker89

  • Jr. Member
  • **
  • Posts: 56
Re: [HACK] Export Orders and Batch update of Status
« Reply #34 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

chris.t.uk

  • Contributing Developer
  • Jr. Member
  • *
  • Posts: 98
Re: [HACK] Export Orders and Batch update of Status
« Reply #35 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.
Hacks
Export Orders & Batch Update -> http://forum.virtuemart.net/index.php?topic=52215.0
UK Counties -> http://forum.virtuemart.net/index.php?topic=33968.0
Sites running Virtuemart
http://www.ladders247.co.uk http://www.tools247.co.uk http://www.mackay.co.uk
Synchronization
Synchronized with our instore system via PrePrepSQL and missing Image Remote Retrieval system ;-)

samparker89

  • Jr. Member
  • **
  • Posts: 56
Re: [HACK] Export Orders and Batch update of Status
« Reply #36 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

chris.t.uk

  • Contributing Developer
  • Jr. Member
  • *
  • Posts: 98
Re: [HACK] Export Orders and Batch update of Status
« Reply #37 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);

Hacks
Export Orders & Batch Update -> http://forum.virtuemart.net/index.php?topic=52215.0
UK Counties -> http://forum.virtuemart.net/index.php?topic=33968.0
Sites running Virtuemart
http://www.ladders247.co.uk http://www.tools247.co.uk http://www.mackay.co.uk
Synchronization
Synchronized with our instore system via PrePrepSQL and missing Image Remote Retrieval system ;-)

tyrael84

  • Beginner
  • *
  • Posts: 6
Re: [HACK] Export Orders and Batch update of Status
« Reply #38 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.

samparker89

  • Jr. Member
  • **
  • Posts: 56
Re: [HACK] Export Orders and Batch update of Status
« Reply #39 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

samparker89

  • Jr. Member
  • **
  • Posts: 56
Re: [HACK] Export Orders and Batch update of Status
« Reply #40 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

chris.t.uk

  • Contributing Developer
  • Jr. Member
  • *
  • Posts: 98
Re: [HACK] Export Orders and Batch update of Status
« Reply #41 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.
Hacks
Export Orders & Batch Update -> http://forum.virtuemart.net/index.php?topic=52215.0
UK Counties -> http://forum.virtuemart.net/index.php?topic=33968.0
Sites running Virtuemart
http://www.ladders247.co.uk http://www.tools247.co.uk http://www.mackay.co.uk
Synchronization
Synchronized with our instore system via PrePrepSQL and missing Image Remote Retrieval system ;-)

samparker89

  • Jr. Member
  • **
  • Posts: 56
Re: [HACK] Export Orders and Batch update of Status
« Reply #42 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

chris.t.uk

  • Contributing Developer
  • Jr. Member
  • *
  • Posts: 98
Re: [HACK] Export Orders and Batch update of Status
« Reply #43 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.
Hacks
Export Orders & Batch Update -> http://forum.virtuemart.net/index.php?topic=52215.0
UK Counties -> http://forum.virtuemart.net/index.php?topic=33968.0
Sites running Virtuemart
http://www.ladders247.co.uk http://www.tools247.co.uk http://www.mackay.co.uk
Synchronization
Synchronized with our instore system via PrePrepSQL and missing Image Remote Retrieval system ;-)

samparker89

  • Jr. Member
  • **
  • Posts: 56
Re: [HACK] Export Orders and Batch update of Status
« Reply #44 on: June 09, 2009, 13:08:55 pm »
Thanks! Any idea when this will be released?