Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 2 of 10
[SOLVED] Export orders
 
gagachaga
Jr. Member
 
Total Posts:  11
Joined:  2009-02-02
 

ok i found the damn solution

people do not copy paste things form your browser,
type out the code your self, or do a strip of the text before pasting, i had major headache just cuz i was noob and was pasting, than i rewrote myself, i had never thought this all could be because of just a space between <?php and include

 
Magento Community Magento Community
Magento Community
Magento Community
 
gagachaga
Jr. Member
 
Total Posts:  11
Joined:  2009-02-02
 

ok i found the damn solution

people do not copy paste things form your browser,
type out the code your self, or do a strip of the text before pasting, i had major headache just cuz i was noob and was pasting, than i rewrote myself, i had never thought this all could be because of just a space between <?php and include

 
Magento Community Magento Community
Magento Community
Magento Community
 
gagachaga
Jr. Member
 
Total Posts:  11
Joined:  2009-02-02
 

i have another problem, my hosting does not allow writing to the root directory, which paths must i change for the export to work in example /public_html/export/..
i have tried changing the paths but no luck yet

 
Magento Community Magento Community
Magento Community
Magento Community
 
SapinTremblant
Jr. Member
 
Total Posts:  14
Joined:  2009-01-14
 

help please.

How can I change the “-” separating sku items in bundle product to “_” or how to list the sku products composing a bundle.

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
szotyi
Sr. Member
 
Total Posts:  153
Joined:  2008-11-29
 

case “getsku”:
return str_replace("-”,"_", $item->getSku());

you can also do the composing. you need the split function and then use foreach…

good luck

 
Magento Community Magento Community
Magento Community
Magento Community
 
gagachaga
Jr. Member
 
Total Posts:  11
Joined:  2009-02-02
 

i got the script working tx very much szotyi, i have another question, how can the the script be modified that it exports a tab delated file instead of a xml

 
Magento Community Magento Community
Magento Community
Magento Community
 
SapinTremblant
Jr. Member
 
Total Posts:  14
Joined:  2009-01-14
 

@szotyi : thanks for the str_replace. May you do the composing for me (I don’t want to bother you) ?  But I am not good at it and you look to know well the system and I think this would be the best for my export.

Sincerely.

 
Magento Community Magento Community
Magento Community
Magento Community
 
szotyi
Sr. Member
 
Total Posts:  153
Joined:  2008-11-29
 

its nothing about the system.. it is just playing with the text in php…

i do not have have any bundle products, but maybe i can help you… send me a current example of the exported xml (one order is enough) and a version how you want to have.. so i know how to change…

 
Magento Community Magento Community
Magento Community
Magento Community
 
SapinTremblant
Jr. Member
 
Total Posts:  14
Joined:  2009-01-14
 

thanks you so much :

here is one bundle export :

<?xml version="1.0" encoding="iso-8859-1"?>
<orders>
<order>
<orderinfo>
<idCommande>100000006</idCommande>
<identifiantacheteur>1</identifiantacheteur>
<nomFacture>BILLING NAME</nomFacture>
<telephoneFacture>BILLING PHONE</telephoneFacture>
<rueFacture>BILLING STREET</rueFacture>
<villeFacture>BILLING CITY</villeFacture>
<cpFacture>BILLING POSTAL CODE</cpFacture>
<paysFacture>BILLING COUNTRY</paysFacture>
<nomLivraison>SHIPPING NAME</nomLivraison>
<telephoneLivraison>SHIPPING PHONE</telephoneLivraison>
<rueLivraison>SHIPPING STREET</rueLivraison>
<villeLivraison>SHIPPING CITY</villeLivraison>
<cpLivraison>SHIPPING POSTAL CODE</cpLivraison>
<paysLivraison>SHIPPING COUNTRY</paysLivraison>
<modeLivraison>flatrate_flatrate</modeLivraison>
</orderinfo>
<items>
<item>
<typeProduit>bundle</typeProduit>
<sku>MAORATRIMARANPACKSPORT-NACE002PRbleulagon-COQUE005PRgris-FLOT010PRjade-SAFRAN001PRblanc-VOILE003-VOILE002</sku>
<nom>TRIMARAN PACK SPORT</nom>
<poids>WEIGHT</poids>
<qte>1.0000</qte>
<prixHT>1831.1000</prixHT>
<sousTotalHT>1831.1000</sousTotalHT>
</item>
</items>
<fraisLivraisonHT>83.6100</fraisLivraisonHT>
<tva>375.2900</tva>
<grandTotalTTC>2290.0000</grandTotalTTC>
</order>
</orders>

and here is how I would like it :

<?xml version="1.0" encoding="iso-8859-1"?>
<orders>
<order>
<orderinfo>
<idCommande>100000006</idCommande>
<identifiantacheteur>1</identifiantacheteur>
<nomFacture>BILLING NAME</nomFacture>
<telephoneFacture>BILLING PHONE</telephoneFacture>
<rueFacture>BILLING STREET</rueFacture>
<villeFacture>BILLING CITY</villeFacture>
<cpFacture>BILLING POSTAL CODE</cpFacture>
<paysFacture>BILLING COUNTRY</paysFacture>
<nomLivraison>SHIPPING NAME</nomLivraison>
<telephoneLivraison>SHIPPING PHONE</telephoneLivraison>
<rueLivraison>SHIPPING STREET</rueLivraison>
<villeLivraison>SHIPPING CITY</villeLivraison>
<cpLivraison>SHIPPING POSTAL CODE</cpLivraison>
<paysLivraison>SHIPPING COUNTRY</paysLivraison>
<modeLivraison>flatrate_flatrate</modeLivraison>
</orderinfo>
<items>
<item>
<typeProduit>bundle</typeProduit>
<sku>MAORATRIMARANPACKSPORT</sku>
<child-SKU>NACE002PRbleulagon</childSKU>
<child-SKU>COQUE005PRgris</childSKU>
<child-SKU>FLOT010PRjade</childSKU>
<child-SKU>SAFRAN001PRblanc</childSKU>
<child-SKU>VOILE003</childSKU>
<child-SKU>VOILE002</childSKU>

<nom>TRIMARAN PACK SPORT</nom>
<poids>WEIGHT</poids>
<qte>1.0000</qte>
<prixHT>1831.1000</prixHT>
<sousTotalHT>1831.1000</sousTotalHT>
</item>
</items>
<fraisLivraisonHT>83.6100</fraisLivraisonHT>
<tva>375.2900</tva>
<grandTotalTTC>2290.0000</grandTotalTTC>
</order>
</orders>

 
Magento Community Magento Community
Magento Community
Magento Community
 
szotyi
Sr. Member
 
Total Posts:  153
Joined:  2008-11-29
 

includes.php

find:

/** PRINT OUT VALUE **/

  $xmlTEXT .= "<$key>".getValue($value$item$option)."</$key>"

     
else 

/** ITEMS GROUPING **/
replace to:
/** PRINT OUT VALUE **/

      $temp getValue($value$item$option);
      
      if(
is_array($temp)) {
        $check 
split("/",$key);
        
$xmlTEXT .= "<$check[0]>".$temp['parent']."</$check[0]>";
        
$xmlTEXT .= str_replace("childsku",$check[1],$temp['childs']);
      
else {$xmlTEXT .= "<$key>".$temp."</$key>";}
     
     } 
else 

  
/** ITEMS GROUPING **/

find the case of the getsku in the getvalue function and replace to

case "getsku":
       
$skus split("-",$item->getSku());
       
$sku['parent'$skus[0];
       
$childs '';
       unset(
$skus[0]);
       
       foreach (
$skus as $child{
         $childs 
.= '<childsku>'$child"</childsku>";
       
}
       $sku[
'childs']=$childs;
       
       return 
$sku;

you HAVE to modifed the tagname of the childsku in the samples.php by:

sku/childtryLOLorwhatevergetsku,

where the sku is the tagname for the main item, childtryLOLorwhatever is the tagname for the child items, the getsku is refers to the the getvalue function…

 
Magento Community Magento Community
Magento Community
Magento Community
 
szotyi
Sr. Member
 
Total Posts:  153
Joined:  2008-11-29
 

@gagachaga:

sorry, my version only supports xml…

 
Magento Community Magento Community
Magento Community
Magento Community
 
gagachaga
Jr. Member
 
Total Posts:  11
Joined:  2009-02-02
 

can i simply use a xml to tab converter

its just that my shipping company only wants tab separated files
and on top of that they want the data on one line
for example
order ID Fname Lname address product how-many product how-many ....
order ID Fname Lname address product how-many product how-many ....
order ID Fname Lname address product how-many product how-many ....
.........

is there a way to at least get script to print this stuff on one line

tx so much for your response

 
Magento Community Magento Community
Magento Community
Magento Community
 
szotyi
Sr. Member
 
Total Posts:  153
Joined:  2008-11-29
 

i do not know exatly how you want but maybe you can start with:

/** PRINT OUT VALUE **/

  $xmlTEXT .= getValue($value$item$option)."\t"

     
else 

/** ITEMS GROUPING **/

or just use a parser, like this:

http://www.magicparser.com/node/464

or with preg_replace you repalce the <...> with tab…

but im wondering how they can read if they do not have labels only the values

 
Magento Community Magento Community
Magento Community
Magento Community
 
gagachaga
Jr. Member
 
Total Posts:  11
Joined:  2009-02-02
 

they have a system that goes over the file that knows the order of the fields, imports based on the order of the information

 
Magento Community Magento Community
Magento Community
Magento Community
 
gagachaga
Jr. Member
 
Total Posts:  11
Joined:  2009-02-02
 

they have a importer i guess that follows the order of the data separated by tabs than imports this data into a system that alerts them of a new order, the program logs into a ftp checks if thew file has been updated than downloads it and does this process, can i have the xml to csv parser run at the same time the export is created?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 2 of 10