Magento Forum

[SOLVED] Export orders
 
elfling
Enthusiast
 
Avatar
Total Posts:  901
Joined:  2008-10-21
 

Brilliant. Works a treat after Jame’s code fix.

Just need to look at some CSS styling to it now.

 
Magento Community Magento Community
Magento Community
Magento Community
 
elfling
Enthusiast
 
Avatar
Total Posts:  901
Joined:  2008-10-21
 

ARGHHH

Why isn’t

$xmlString "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?><?xml-stylesheet type=\"text/xsl\" href=\"filename.xsl\"?><exports><lastid>".$lastid."</lastid>".$xmlText"</exports>";

embedding the damn style sheet into the written file.

 
Magento Community Magento Community
Magento Community
Magento Community
 
elfling
Enthusiast
 
Avatar
Total Posts:  901
Joined:  2008-10-21
 

Ok, so got all this working. Have configured it for exporting for Parcel Force.

Just one thing though.

The recently exported list takes the orderid and not the increment id.

Any ideas on how to fix this?

 
Magento Community Magento Community
Magento Community
Magento Community
 
onepack
Sr. Member
 
Total Posts:  98
Joined:  2008-06-02
Amsterdam
 
szotyi - 20 January 2009 01:08 AM

hey,

here is the list.

how it works:
u find in the list what u want to add:
lets say I need for the order items three more information: the quantity how much has invoiced , the product type, and the updated time
i have found in the list:
qty_invoiced, product_type, updated_at
then u go to the includes.php file to getValue()
and add this three line

case "examplegetqtyinvoiced":
        return 
$item->getQtyInvoiced();

    case 
"renameitgetproducttype":
        return 
$item->getProductType();
        
    case 
"somethinggetupdatedat":
        return 
$item->getUpdatedAt();

now for the sample.php u can reach the value:
.
        
updatesomethinggetupdatedat,
        
typerenameitgetproducttype,
        
invoicedexamplegetqtyinvoiced,
.

so how did the getQtyInvoiced come from the qty_invoiced?
just putting the word ‘get’ before the word from the list, Remove the ‘_’ and made it capital the letters as the sample
I am not sure that it works for every properties…

In Case you want a property with case “somethinggetupdatedat”:
and it doesn’t work try it like this:

case “getdescription”:
$custom = Mage::getModel(’catalog/product’)->load($item->getProductId());
return $custom->getDescription();

 
Magento Community Magento Community
Magento Community
Magento Community
 
tom1801
Jr. Member
 
Total Posts:  13
Joined:  2009-05-28
KA, Germany
 

Hi,
first of all i want to say: GREAT WORK!

do you have a suggestion how to return the sku of a configurable product?
It always returns the sku of the “parent"-product but i want to have the sku depending on the choice of the configurable product.

i tried something like

$item->getChildProduct()->getSku()
but it doesn’t work.

any ideas?
thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
Mellow
Jr. Member
 
Total Posts:  13
Joined:  2009-10-16
 

Hello,

it looks like a great Script, but at my Installation its not working.

Magento Verison: 1.3.2.4

I tried all Fixes which some Users are here posted.
Nothing works.

If i click the export Button, the Shop redirected me to the Dashboard. But at the export Folder there is only the exports.xml which is empty and no other File…

Have you any Solutions?

Thank you

 
Magento Community Magento Community
Magento Community
Magento Community
 
bolasevich
Sr. Member
 
Avatar
Total Posts:  235
Joined:  2008-03-04
Newington, CT USA
 

possible option http://www.magentocommerce.com/extension/2063 handles this.. it will export order details / customer details / items ordered details

 
Magento Community Magento Community
Magento Community
Magento Community
 
colin008
Sr. Member
 
Total Posts:  84
Joined:  2008-10-20
 

Yep the script works great in version 1.3.2.4, thank you to everyone for your efforts.

For me the only problem is the script will not export a downloadable product, the script executes then stops and will not finish loading the /sales_order/ page after clicking either single or fromlast export.

I have looked at the export.php and includes.php, but i cant see why or where the problem is creating a xml file for a downloadable products..! Any help would be appreciated.

Later I find out that the error is because virtual products dont have shipping details and the script stops because of a non object error.

To solve this non object error
in includes.php

change

case "getshippingname":
        return 
$orderMag->getShippingAddress()->getName();

to

case "getshippingname":
        if (
$orderMag->getIsVirtual()) {
            
return " ";
        
else {
        
return $orderMag->getShippingAddress()->getName();
       
}

other properties of the order may also need to be changed depending on which properties your using.

 
Magento Community Magento Community
Magento Community
Magento Community
 
sn1pereagle
Jr. Member
 
Total Posts:  27
Joined:  2008-12-19
 

Perhaps somebody can help me.

I wanted to show the next XML line like:

<DEBTOR UID="9999">

To show this XML line in json code it should be: 

"DEBTOR"{
                    
"@attributes"{
                        
"UID""9999"
                    
},

But because of the string replace functions in the includes.php it can not be formatted well as an normal JSON code

So how can we fix this problem?

 
Magento Community Magento Community
Magento Community
Magento Community
 
elfling
Enthusiast
 
Avatar
Total Posts:  901
Joined:  2008-10-21
 

Still wondering where this is pulling its info from.

The lastid’s to be exported isn’t getting the increment ID’s...ideas

$descs $export->getElementsByTagName"desc" );
  
$desc $descs->item(0)->nodeValue;
 
Magento Community Magento Community
Magento Community
Magento Community
 
fanta00
Jr. Member
 
Total Posts:  28
Joined:  2009-11-23
 

Great! work after msn and James fixes,
1. however my download button only opens exported data in new browser tab instead of downloading the file, is it a bug or can it be fixed easily?

2. is it possible to export attributes? Like manufacturer (which is a drop-down list) ? Can anyone help please? this is very important, as just names of the products don’t say much…

3. and, actually ehh, none of the extra info added for export seems to work for me, xml files is still the same:
I added to the includes.php:
case “getstreet”:
return $orderMag->getStreet();
case “getpostcode”:
return $orderMag->getPostcode();

and to samples under Default:

street: getstreet,
postcode: getpostcode,

nothing shows in XML, what do I do wrong?

 
Magento Community Magento Community
Magento Community
Magento Community
 
r3volution11
Jr. Member
 
Total Posts:  20
Joined:  2009-04-12
 

I’ve tried all of these fixes and not one of them work. For me it still loads the dashboard.

Driving me nuts!

My magento installation is in domain.com/magento.

Should the URL locations in export.php be “/magento/index.php/admin/sales_order/?export=true&type;=customer” ?

SOLVED!

For those that have their magento installed in a sub directory, you want to put “index.php/subdirectory/admin...”

In other words index.php always goes first. Then be sure to edit line 278 of the includes.php file to set the correct download link (do not include index.php)

 
Magento Community Magento Community
Magento Community
Magento Community
 
r3volution11
Jr. Member
 
Total Posts:  20
Joined:  2009-04-12
 

Is there a way to get the Payment Method’s title (the one you see in the front end) versus the code oriented version?

IE: A Purchase Order is known as “purchaseorder.”

Reason being, I have changed the name of Purchase Order for something more suited to my site and business.

 
Magento Community Magento Community
Magento Community
Magento Community
 
elfling
Enthusiast
 
Avatar
Total Posts:  901
Joined:  2008-10-21
 

For me, what i did is i embedded an xml stylesheet so that basically it only displayed the information i wanted.

Example

<xsl:choose>
<
xsl:when test="shippingamount < 1">
  <
td>Shop Collection</td
  </
xsl:when>
<
xsl:when test="shippingamount < 8">
  <
td>PF24</td
  </
xsl:when>
<
xsl:when test="shippingamount < 13">
  <
td>PF48</td
  </
xsl:when>
<
xsl:when test="shippingamount < 21">
  <
td>PF24</td
  </
xsl:when>
<
xsl:otherwise>
  <
td>PF24</td
  </
xsl:otherwise>
  </
xsl:choose>
 
Magento Community Magento Community
Magento Community
Magento Community
 
r3volution11
Jr. Member
 
Total Posts:  20
Joined:  2009-04-12
 

Thanks for the reply. I’m just trying to make things as automated as possible for the laymen to be able to use the administration interface with out a large learning curve.

I’ll be looking myself but I wanted to ask - do you know of any good tutorial web sites on XML styling? Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top