Shopware Knowledgebase

Dieser Artikel ist noch nicht für Shopware 3.5 geprüft bzw. freigegeben.
Shopware Labs

Der Bereich Shopware Labs ist die Plattform für alle Entwickler. Hier findet man technische Dokumentationen und zahlreiche Tipps und Tricks rund um das Thema Programmieren. In dieser Rubrik stellen außerdem die Entwickler der shopware AG neue und experimentelle Lösungsansätze vor. Neue Funktionen, die in dieser Rubrik bereitgestellt werden, sind teilweise auch für zukünftige Releases geplant. Die Funktionen können dann ohne Programmierkenntnisse zukünftig direkt im Shopware Backend konfiguriert werden oder werden über Plugins bereitgestellt. Informationen über neue, geplante Funktionen finden Sie in unserer Roadmap.

Bitte beachten Sie, dass die hier bereitgestellten Lösungsansätze nicht offiziell supportet werden und nur eingebaut werden sollten, sofern Sie über das entsprechende, technische Wissen verfügen.

API-Export Funktionen

0 Kommentare

API-Export Funktionen

Informationen

Mit den API Export-Funktionen haben Sie die Möglichkeit Artikel, Kunden und Bestellungen aus der shopware Datenbank zu exportieren.

Datei: engine/connector/api/export/shopware.php

Klassenname: sShopwareExport

Einbindung:

require_once('../../api.php');

$api = new sAPI();

$export =& $api->export->shopware;

Methoden der Klassen

sArticleCategories

function sArticleCategories (array $article_categories)

Erklärung Liest alle Kategorien aus, die den in $article_categories übermittelten Artikel IDs zugeordnet sind
Parameter $article_categories Mögliche Parameterübergaben:
  • optional int ["articleID"] Übergabe einer Artikel ID (s_articles.id) oder
  • optional array["articleIDs"] Array an Artikel IDs (s_articles.id)
Rückgabe array
Werte Zuordnung Artikel ID -> Kategorie IDs

Code-Beispiel:

 
//Beispiel 1
$export->sArticleCategories ( array("articleID"=>45) );
 
//Beispiel 2
$export->sArticleCategories ( array("articleIDs"=>array(3, 45)) );
 

Rückgabe:

//Beispiel 1
Array
(
    [45] => Array
        (
            [0] => 9
            [1] => 12
            [2] => 16
        )

)

//Beispiel 2
Array
(
    [3] => Array
        (
            [0] => 9
        )

    [45] => Array
        (
            [0] => 12
            [1] => 9
            [2] => 16
        )

)

sArticleImages

function sArticleImages (array $article_images)

Erklärung Liest alle Bilder aus, die den in $article_images übermittelten Artikel IDs zugeordnet sind
Parameter $article_images Mögliche Parameterübergaben:
  • optional int ["articleID"] Übergabe einer Artikel ID (s_articles.id) oder
  • optional array["articleIDs"] Array an Artikel IDs (s_articles.id)
Rückgabe array
Werte Zuordnung Artikel ID -> Bildinformationen

Code-Beispiel:

 
//Beispiel 1
$export->sArticleImages ( array("articleID"=>3) );
 
//Beispiel 2
$export->sArticleImages ( array("articleIDs"=>array(3, 45)) );
 

Rückgabe:

//Beispiel 1
Array
(    
    [3] => Array
        (
            [0] => Array
                (
                    [id] => 3
                    [articleID] => 3
                    [img] => e9ddc4b3ecd4a875778135071ddc5efc
                    [main] => 1
                    [description] => 
                    [position] => 0
                    [width] => 1024
                    [height] => 768
                    [relations] => 
                    [link] => http://www.shopwareshop.de/images/articles/e9ddc4b3ecd4a875778135071ddc5efc.jpg
                )

        )

)

//Beispiel 2
Array
(
    [3] => Array
        (
            [0] => Array
                (
                    [id] => 3
                    [articleID] => 3
                    [img] => e9ddc4b3ecd4a875778135071ddc5efc
                    [main] => 1
                    [description] => 
                    [position] => 0
                    [width] => 1024
                    [height] => 768
                    [relations] => 
                    [link] => http://www.shopwareshop.de/images/articles/e9ddc4b3ecd4a875778135071ddc5efc.jpg
                )

        )

    [45] => Array
        (
            [0] => Array
                (
                    [id] => 41
                    [articleID] => 45
                    [img] => f0b2c52402a903b43d6e1468b3b5c9bb
                    [main] => 1
                    [description] => 
                    [position] => 0
                    [width] => 140
                    [height] => 106
                    [relations] => 
                    [link] => http://www.shopwareshop.de/304/images/articles/f0b2c52402a903b43d6e1468b3b5c9bb.jpg
                )
            [1] => Array
                (
                    [id] => 47
                    [articleID] => 45
                    [img] => hstgc52402a903b43d6e1468b3b5h5o8
                    [main] => 0
                    [description] => 
                    [position] => 1
                    [width] => 140
                    [height] => 106
                    [relations] => 
                    [link] => http://www.shopwareshop.de/304/images/articles/hstgc52402a903b43d6e1468b3b5h5o8.jpg
                )

        )

)

sArticlePrices

function sArticlePrices (array $article_prices)

Erklärung Liest alle Preise aus, die den in $article_prices übermittelten Artikeldetail IDs zugeordnet sind
Parameter $article_prices Mögliche Parameterübergaben:
  • optional int ["articledetailsID"] Übergabe einer Artikeldetail ID (s_articles_details.id) oder
  • optional array["articledetailsIDs"] Array an Artikeldetail IDs (s_articles_details.id)
Rückgabe array
Werte Zuordnung Artikel ID -> Preiseinformationen

Code-Beispiel:

 
//Beispiel 1
$export->sArticlePrices ( array("articledetailsID"=>3) );
 
//Beispiel 2
$export->sArticlePrices ( array("articledetailsIDs"=>array(3, 4)) );
 

Rückgabe:

//Beispiel 1
Array
(
    [3] => Array
        (
            [0] => Array
                (
                    [pricegroup] => EK
                    [from] => 1
                    [to] => beliebig
                    [articleID] => 3
                    [articledetailsID] => 3
                    [price] => 560.19
                    [pseudoprice] => 0
                    [net_pseudoprice] => 0
                    [net_price] => 470.74789916
                    [baseprice] => 0
                    [percent] => 0
                    [taxID] => 1
                    [tax] => 19
                    [netto] => 0
                )

        )
)

//Beispiel 2
Array
(
    [3] => Array
        (
            [0] => Array
                (
                    [pricegroup] => EK
                    [from] => 1
                    [to] => beliebig
                    [articleID] => 3
                    [articledetailsID] => 3
                    [price] => 560.19
                    [pseudoprice] => 0
                    [net_pseudoprice] => 0
                    [net_price] => 470.74789916
                    [baseprice] => 0
                    [percent] => 0
                    [taxID] => 1
                    [tax] => 19
                    [netto] => 0
                )

        )

    [4] => Array
        (
            [0] => Array
                (
                    [pricegroup] => EK
                    [from] => 1
                    [to] => beliebig
                    [articleID] => 4
                    [articledetailsID] => 4
                    [price] => 871.81
                    [pseudoprice] => 0
                    [net_pseudoprice] => 0
                    [net_price] => 732.613178907
                    [baseprice] => 0
                    [percent] => 0
                    [taxID] => 1
                    [tax] => 19
                    [netto] => 0
                )

        )
)

sArticles

function sArticles ()

Erklärung Liest alle Artikel aus und gibt sie zurück (Artikelstammdaten)
Rückgabe array
Werte Alle Artikel

Code-Beispiel:

 
$export->sArticles ();
 

Rückgabe:

Array
(
    [2] => Array
        (
            [articleID] => 2
            [articledetailsID] => 2
            [ordernumber] => AT226637ad9f9
            [name] => Hardware
            [description] => 
            [description_long] => 
Taschentuch mein Anruf Strand Rudi Haus Hallo Rudi Papier Computer 
Taschentuch Code Zettel Anruf 
Office zufall Klaus 99 Stift Medizin Flasche Brenner Edding Spiegel Stift Haus dein mein Hardware Geld 
Stern Edding Hundert  Hallo
            [shippingtime] => 0
            [added] => 2009-09-02
            [changed] => 2009-09-02 15:39:23
            [releasedate] => 
            [shippingfree] => 0
            [topseller] => 0
            [keywords] => 
            [minpurchase] => 0
            [purchasesteps] => 0
            [maxpurchase] => 0
            [purchaseunit] => 0
            [referenceunit] => 0
            [packunit] => 
            [unitID] => 0
            [pricegroupID] => 0
            [pricegroupActive] => 0
            [laststock] => 0
            [suppliernumber] => 
            [additionaltext] => 
            [impressions] => 10
            [sales] => 0
            [active] => 1
            [kind] => 1
            [instock] => 453
            [stockmin] => 0
            [esd] => 0
            [weight] => 0
            [supplier] => Haus
            [unit] => 
            [tax] => 7
            [attributegroupID] => 0
            [configurator] => 0
            [attr] => Array
                (
                    [1] => 0
                    [2] => 0
                    [3] => 0
                    [4] => 
                    [5] => 
                    [6] => 
                    [7] => 
                    [8] => 0
                    [9] => 
                    [10] => 
                    [11] => 
                    [12] => 
                    [13] => 0
                    [14] => 
                    [15] => 
                    [16] => 
                    [17] => 0000-00-00
                    [18] => 
                    [19] => 
                    [20] => 
                )

        )

    [3] => Array
        (
            [articleID] => 3
            [articledetailsID] => 3
            [ordernumber] => SW8272h 
            .......
            ....
            ..

sArticlesDetails

function sArticlesDetails (array $article_details)

Erklärung Liest Artikeldetails aus, die den in $article_details übermittelten Artikel IDs zugeordnet sind. (Downloads [s_articles_downloads], Links [s_articles_information] und Cross-Selling [s_articles_relationships; s_articles_similar])
Parameter $article_details Mögliche Parameterübergaben:
  • optional int ["articleID"] Übergabe einer Artikel ID (s_articles.id) oder
  • optional array["articleIDs"] Array an Artikel IDs (s_articles.id)
Rückgabe array
Werte Zuordnung Artikel ID -> Artikeldetails (Downloads, Links und Cross-Selling)

Code-Beispiel:

 
//Beispiel 1
$export->sArticlesDetails ( array("articleID"=>16) );
 
//Beispiel 2
$export->sArticlesDetails ( array("articleIDs"=>array(16, 24)) );
 

Rückgabe:

//Bespiel 1
Array
(
    [16] => Array
        (
            [downloads] => Array
                (
                    [0] => Array
                        (
                            [description] => picture
                            [filename] => sofort_neu-165134.jpg
                            [size] => 36576
                            [articleID] => 16
                        )

                )

            [information] => Array
                (
                    [0] => Array
                        (
                            [description] => Link1
                            [link] => http://www.testdomain1.de
                            [target] => _blank
                            [articleID] => 16
                        )

                    [1] => Array
                        (
                            [description] => Link2
                            [link] => http://www.testdomain2.de
                            [target] => _blank
                            [articleID] => 16
                        )

                )

            [relationships] => Array
                (
                    [0] => SW1184_4788
                    [1] => SW1190
                )

            [similar] => Array
                (
                    [0] => SW1194
                )

        )

)

sCategories

function sArticlesDetails (array $categories = array(), int $parentID = 1)

Erklärung Export der Kategorien
Parameter $categories Optionale Übergabe eines bestehenden sCategories-Results
Parameter $parentID $parentID der Elternkategorie, bei der der Export starten soll (1 = alle Kategorien) (optional)
Rückgabe array
Werte Kategoriedaten

Code-Beispiel:

 
//Beispiel 1
//Auslesen aller Kategorien
$export->sCategories ();
 
//Beispiel 2
//Exportstart ab Elternkategorie mit der ID 11
$cats = $export->sCategories (array(), 11);
 
//Beispiel 2 Erweiterung
//Zum bestehenden Array Kategorien ab der Elternkategorie mit der ID 335 hinzufügen
$cats = $export->sCategories ($cats, 335);
 

//Beispiel 2
Array
(
    [12] => Array
        (
            [categoryID] => 12
            [parentID] => 11
            [description] => Diskette Schrank Tür
            [position] => 1
            [alias] => 0
            [metakeywords] => 
            [metadescription] => 
            [cmsheadline] => 
            [cmstext] => 
            [template] => article_listing_4col.tpl
            [aliassql] => 
            [active] => 1
            [ac_attr1] => 
            [ac_attr2] => 
            [ac_attr3] => 
            [ac_attr4] => 
            [ac_attr5] => 
            [ac_attr6] => 
        )

    [13] => Array
        (
            [categoryID] => 13
            [parentID] => 11
            [description] => möchte Hardware Marlboro
            [position] => 2
            [alias] => 0
            [metakeywords] => 
            [metadescription] => 
            [cmsheadline] => 
            [cmstext] => 
            [template] => article_listing_4col.tpl
            [aliassql] => 
            [active] => 1
            [ac_attr1] => 
            [ac_attr2] => 
            [ac_attr3] => 
            [ac_attr4] => 
            [ac_attr5] => 
            [ac_attr6] => 
        )
)

//Beispiel 2 Erweiterung
Array
(
    [12] => Array
        (
            [categoryID] => 12
            [parentID] => 11
            [description] => Diskette Schrank Tür
            [position] => 1
            [alias] => 0
            [metakeywords] => 
            [metadescription] => 
            [cmsheadline] => 
            [cmstext] => 
            [template] => article_listing_4col.tpl
            [aliassql] => 
            [active] => 1
            [ac_attr1] => 
            [ac_attr2] => 
            [ac_attr3] => 
            [ac_attr4] => 
            [ac_attr5] => 
            [ac_attr6] => 
        )

    [13] => Array
        (
            [categoryID] => 13
            [parentID] => 11
            [description] => möchte Hardware Marlboro
            [position] => 2
            [alias] => 0
            [metakeywords] => 
            [metadescription] => 
            [cmsheadline] => 
            [cmstext] => 
            [template] => article_listing_4col.tpl
            [aliassql] => 
            [active] => 1
            [ac_attr1] => 
            [ac_attr2] => 
            [ac_attr3] => 
            [ac_attr4] => 
            [ac_attr5] => 
            [ac_attr6] => 
        )
        
    [342] => Array
        (
            [categoryID] => 342
            [parentID] => 335
            [description] => Eis
            [position] => 7
            [alias] => 0
            [metakeywords] => 
            [metadescription] => 
            [cmsheadline] => 
            [cmstext] => 
            [template] => article_listing_4col.tpl
            [aliassql] => 
            [active] => 1
            [ac_attr1] => 
            [ac_attr2] => 
            [ac_attr3] => 
            [ac_attr4] => 
            [ac_attr5] => 
            [ac_attr6] => 
        )
)

sCategoryTree

function sCategoryTree (array $category_mask = array(), int $parentID = 1, bool $rek=true)

Erklärung Export der Kategorien als Baumstruktur
Parameter $category_mask Optionales Mapping-Array zur Bestimmung der Exportfelder.
  • string ["id"] Bezeichnung für das Feld "id"
  • string ["parent"] Bezeichnung für das Feld "parent"
  • string ["description"] Bezeichnung für das Feld "description"
  • string ["childs"] Bezeichnung für das Feld "childs"
Parameter $parentID $parentID der Elternkategorie, bei der der Export starten soll (1 = alle Kategorien) (optional)
Parameter $rek Gibt an, ob die Kategorien rekursiv ausgelesen werden sollen.
Rückgabe array
Werte Kategoriebaumstruktur

Code-Beispiel:

 
//Beispiel 1
//Auslesen aller Kategorien
$export->sCategoryTree();
 
//Beispiel 2
//Exportstart ab Elternkategorie mit der ID 3 (deutsch)
$export->sCategoryTree(array(), 3);
 
//Beispiel 3
//Exportstart ab Elternkategorie mit der ID 11
$mapping = array("id"=>"id", 
		"parent"=>"elternelement", 
		"description"=>"beschreibung", 
		"childs"=>"kindelemente");
$export->sCategoryTree($mapping, 11);
 

Rückgabe:

//Beispiel 2
Array
(
    [9] => Array
        (
            [id] => 9
            [parent] => 3
            [description] => Test3
        )

    [11] => Array
        (
            [id] => 11
            [parent] => 3
            [description] => Test2#1#
            [childs] => Array
                (
                    [10] => Array
                        (
                            [id] => 10
                            [parent] => 11
                            [description] => Konfigurator
                        )

                    [15] => Array
                        (
                            [id] => 15
                            [parent] => 11
                            [description] => test
                        )

                )

        )

    [16] => Array
        (
            [id] => 16
            [parent] => 3
            [description] => Aktivtest
        )

    [17] => Array
        (
            [id] => 17
            [parent] => 3
            [description] => Detent
        )

)

//Beispiel 3
Array
(
    [10] => Array
        (
            [index] => 10
            [elternelement] => 11
            [beschreibung] => Konfigurator
        )

    [15] => Array
        (
            [index] => 15
            [elternelement] => 11
            [beschreibung] => test
        )

)

sCustomers

function sCustomers (array $user)

Erklärung Liest die Kundendaten eines / mehrerer oder aller Kunden aus
Parameter $user Optionaler Array der Kunden ID/s (s_user.id)
Rückgabe array
Werte Kundendaten

Code-Beispiel:

 
//Beispiel 1
//Kundendaten eines Kunden auslesen
$export->sCustomers (array("userIDs"=>array(4)));
 
//Beispiel 2
//Kundendaten mehrerer Kunden auslesen
$export->sCustomers (array("userIDs"=>array(1, 2, 17)));
 
//Beispiel 3
//Kundendaten aller Kunden auslesen
$export->$export->sCustomers();
 

Rückgabe:

//Beispiel 1
Array
(
    [4] => Array
        (
            [userID] => 4
            [billing_company] => Muster GmbH
            [billing_department] => Marketing
            [billing_salutation] => mr
            [customernumber] => 19319
            [billing_firstname] => Max
            [billing_lastname] => Mustermann
            [billing_street] => Musterstraße
            [billing_streetnumber] => 14
            [billing_zipcode] => 12345
            [billing_city] => Musterstadt
            [billing_phoney] => 02114/54785
            [billing_fax] => 02114/54786
            [billing_countryID] => 2
            [ustid] => 
            [billing_text1] => Freitextfeld 1
            [billing_text2] => Freitextfeld 2
            [billing_text3] => Freitextfeld 3
            [billing_text4] => Freitextfeld 4
            [billing_text5] => Freitextfeld 5
            [billing_text6] => Freitextfeld 6
            [shipping_company] => 
            [shipping_department] => 
            [shipping_salutation] => mr
            [shipping_firstname] => 
            [shipping_lastname] => 
            [shipping_street] => 
            [shipping_streetnumber] => 
            [shipping_zipcode] => 
            [shipping_city] => 
            [shipping_countryID] => 2
            [shipping_text1] => 
            [shipping_text2] => 
            [shipping_text3] => 
            [shipping_text4] => 
            [shipping_text5] => 
            [shipping_text6] => 
            [email] => m.mustermann@domain.de
            [paymentID] => 2
            [newsletter] => 0
            [affiliate] => 0
            [customergroup] => EK
            [subshopID] => 1
            [billing_country] => Deutschland
            [billing_country_iso] => DE
            [billing_country_area] => deutschland
            [billing_country_en] => GERMANY
            [shipping_country] => Deutschland
            [shipping_country_iso] => DE
            [shipping_country_area] => deutschland
            [shipping_country_en] => GERMANY
        )
)

//Beispiel 2 und 3
Array
(
    [1] => Array
        (
            [userID] => 1
            [billing_company] => 
            [billing_department] => 
            [billing_salutation] => mr
            [customernumber] => 19316
            [billing_firstname] => test
            [billing_lastname] => test
            [billing_street] => test
            [billing_streetnumber] => 22
            [billing_zipcode] => 23232
            [billing_city] => test
            [billing_phoney] => 242141414
            [billing_fax] => 
            [billing_countryID] => 2
            [ustid] => 
            [billing_text1] => 
            [billing_text2] => 
            [billing_text3] => 
            [billing_text4] => 
            [billing_text5] => 
            [billing_text6] => 
            [shipping_company] => 
            [shipping_department] => 
            [shipping_salutation] => 
            [shipping_firstname] => 
            [shipping_lastname] => 
            [shipping_street] => 
            [shipping_streetnumber] => 
            [shipping_zipcode] => 
            [shipping_city] => 
            [shipping_countryID] => 
            [shipping_text1] => 
            [shipping_text2] => 
            [shipping_text3] => 
            [shipping_text4] => 
            [shipping_text5] => 
            [shipping_text6] => 
            [email] => esd@shopware.ag
            [paymentID] => 4
            [newsletter] => 0
            [affiliate] => 0
            [customergroup] => EK
            [subshopID] => 1
            [billing_country] => Deutschland
            [billing_country_iso] => DE
            [billing_country_area] => deutschland
            [billing_country_en] => GERMANY
            [shipping_country] => 
            [shipping_country_iso] => 
            [shipping_country_area] => 
            [shipping_country_en] => 
        )

    [2] => Array
        (
            [userID] => 2
            [billing_company] => 
            [billing_department] => 
            ......
            ....
            ..

sFullArticles

function sFullArticles ()

Erklärung Liest alle Artikel inkl. Kategorie- und Bildzuordnungen, sowie Preisen aus
Rückgabe array
Werte Artikeldaten

Code-Beispiel:

 
$export->sFullArticles ();
 

Rückgabe:

Array
(
    [2] => Array
        (
            [articleID] => 2
            [articledetailsID] => 3
            [ordernumber] => AT71367075816
            [name] => Mein Artikel
            [description] => Beschreibung kurz
            [description_long] => 

Beschreibungstext lang

            [shippingtime] => 5
            [added] => 2009-08-14
            [changed] => 2009-08-14 15:29:43
            [releasedate] => 
            [shippingfree] => 0
            [topseller] => 0
            [keywords] => 
            [minpurchase] => 0
            [purchasesteps] => 0
            [maxpurchase] => 0
            [purchaseunit] => 0
            [referenceunit] => 0
            [packunit] => 
            [unitID] => 0
            [pricegroupID] => 0
            [pricegroupActive] => 0
            [laststock] => 0
            [suppliernumber] => 
            [additionaltext] => 
            [impressions] => 1
            [sales] => 0
            [active] => 1
            [kind] => 1
            [instock] => 102
            [stockmin] => 0
            [esd] => 0
            [weight] => 0
            [supplier] => 1
            [unit] => 
            [tax] => 19
            [attributegroupID] => 0
            [configurator] => 0
            [attr] => Array

                (
                    [1] => 0
                    [2] => 0
                    [3] => 0
                    [4] => 
                    [5] => 
                    [6] => 
                    [7] => 
                    [8] => 0
                    [9] => 
                    [10] => 
                    [11] => 
                    [12] => 
                    [13] => 0
                    [14] => 
                    [15] => 
                    [16] => 
                    [17] => 0000-00-00
                    [18] => 
                    [19] => 
                    [20] => 
                )

            [information] => Array
                (
                    [0] => Array
                        (
                            [description] => Verweis zum Hersteller
                            [link] => http://www.testdomain2.de
                            [target] => _blank
                            [articleID] => 2
                        )

                )

            [relationships] => Array
                (
                    [0] => SW1188
                )

            [similar] => Array
                (
                    [0] => SW1184_1056
                    [1] => SW1185_2258_5084
                )

            [categories] => Array
                (
                    [0] => 16
                    [1] => 9
                )

            [images] => Array
                (
                    [0] => Array
                        (
                            [id] => 2
                            [articleID] => 2
                            [img] => 46702720b82e1cbc4fc8e6551fac2373
                            [main] => 1
                            [description] => 
                            [position] => 0
                            [width] => 140
                            [height] => 106
                            [link] => http://www.shopwareshop.de/images/articles/46702720b82e1cbc4fc8e6551fac2373.jpg
                        )

                )

            [prices] => Array
                (
                    [0] => Array
                        (
                            [pricegroup] => EK
                            [from] => 1
                            [to] => 4
                            [articleID] => 2
                            [articledetailsID] => 2
                            [price] => 17.85
                            [pseudoprice] => 0
                            [baseprice] => 0
                            [percent] => 0
                            [taxID] => 1
                            [tax] => 19
                            [net] => 1
                            [net_pseudoprice] => 0
                            [gro_pseudoprice] => 0
                            [net_price] => 15
                            [gro_price] => 17.85
                        )

                    [1] => Array
                        (
                            [pricegroup] => EK
                            [from] => 5
                            [to] => beliebig
                            [articleID] => 2
                            [articledetailsID] => 2
                            [price] => 14.999999999992
                            [pseudoprice] => 0
                            [baseprice] => 0
                            [percent] => 15.97
                            [taxID] => 1
                            [tax] => 19
                            [net] => 1
                            [net_pseudoprice] => 0
                            [gro_pseudoprice] => 0
                            [net_price] => 12.6050420168
                            [gro_price] => 15
                        )

                    [2] => Array
                        (
                            [pricegroup] => H
                            [from] => 1
                            [to] => beliebig
                            [articleID] => 2
                            [articledetailsID] => 2
                            [price] => 14
                            [pseudoprice] => 0
                            [baseprice] => 0
                            [percent] => 0
                            [taxID] => 1
                            [tax] => 19
                            [net] => 0
                            [net_pseudoprice] => 0
                            [gro_pseudoprice] => 0
                            [net_price] => 14
                            [gro_price] => 16.66
                        )

                )

        )


    [3] => Array
        (
            [articleID] => 3
            .......
            .....
            ...

sGetLastOrderID

function sGetLastOrderID ()

Erklärung Gibt die Anzahl der Bestellungen (COUNT), sowie die höchste Bestell-ID (MAX(s_order.id)) zurück
Rückgabe array
Werte Anzahl der Bestellungen / höchste Bestell-ID

Code-Beispiel:

 
$export->sGetLastOrderID ();
 

Rückgabe:

Array
(
    [lastID] => 141 //höchste Bestell-ID
    [count] => 33 //Anzahl der Bestellungen
)

sGetOpenOrders

function sGetOpenOrders ()

Erklärung Gibt einen Array mit allen offenen Bestellungen zurück
Rückgabe array
Werte Array aller offenen Bestellungen

Code-Beispiel:

 
$export->sGetOpenOrders ();
 

Rückgabe:

Array
(
    [3] => Array
        (
            [details] => Array
                (
                    [3] => Array
                        (
                            [orderdetailsID] => 3
                            [orderID] => 3
                            [ordernumber] => 10001
                            [articleID] => 1
                            [articleordernumber] => SW2000
                            [price] => 5
                            [quantity] => 1
                            [invoice] => 5
                            [name] => TEst
                            [status] => 0
                            [shipped] => 0
                            [shippedgroup] => 0
                            [releasedate] => 0000-00-00
                            [modus] => 0
                            [esdarticle] => 0
                            [taxID] => 1
                            [tax] => 19
                            [esd] => 0
                        )

                )

        )

    [5] => Array
        (
            [details] => Array
                (
                    [5] => Array
                        (
                            [orderdetailsID] => 5
                            [orderID] => 5
                            [ordernumber] => 10002
                            [articleID] => 1
                            [articleordernumber] => SW2000
                            [price] => 5
                            [quantity] => 1
                            [invoice] => 5
                            [name] => TEst
                            [status] => 0
                            [shipped] => 0
                            [shippedgroup] => 0
                            [releasedate] => 0000-00-00
                            [modus] => 0
                            [esdarticle] => 0
                            [taxID] => 1
                            [tax] => 19
                            [esd] => 0
                        )

                )

        )

    [9] => Array
        (
            [orderID] => 9
            [ordernumber] => 10003
            [order_number] => 10003
            [userID] => 4
            [customerID] => 4
            [invoice_amount] => 5.0005
            [invoice_amount_net] => 4.20042016807
            [invoice_shipping] => 5
            [invoice_shipping_net] => 4.2
            [ordertime] => 2009-07-16 16:57:54
            [status] => 0
            [statusID] => 0
            [cleared] => 21
            [clearedID] => 21
            [paymentID] => 16
            [transactionID] => 1234
            [comment] => 
            [customercomment] => ''
            [net] => 0
            [netto] => 0
            [partnerID] => 
            [temporaryID] => 02cfbac9414cef442f1beda51cdebdb2
            [referer] => 
            [cleareddate] => 0000-00-00 00:00:00
            [cleared_date] => 0000-00-00 00:00:00
            [trackingcode] => 
            [language] => de
            [currency] => EUR
            [currencyFactor] => 1
            [subshopID] => 1
            [dispatchID] => 9
            [currencyID] => 1
            [cleared_description] => Überprüfung notwendig
            [status_description] => Offen
            [payment_description] => PayPal
            [dispatch_description] => 
            [currency_description] => Euro
            [billing_company] => 
            [billing_department] => 
            [billing_salutation] => mr
            [customernumber] => 20005
            [billing_firstname] => Stefan
            [billing_lastname] => Hamann
            [billing_street] => Test
            [billing_streetnumber] => 22
            [billing_zipcode] => 2332
            [billing_city] => Test
            [phone] => 23223
            [billing_phone] => 23223
            [fax] => 
            [billing_fax] => 
            [billing_countryID] => 2
            [billing_country] => Deutschland
            [billing_countryiso] => DE
            [billing_countryarea] => deutschland
            [billing_countryen] => GERMANY
            [ustid] => 
            [billing_text1] => 
            [billing_text2] => 
            [billing_text3] => 
            [billing_text4] => 
            [billing_text5] => 
            [billing_text6] => 
            [shipping_company] => 
            [shipping_department] => 
            [shipping_salutation] => mr
            [shipping_firstname] => Stefan
            [shipping_lastname] => Hamann
            [shipping_street] => Test
            [shipping_streetnumber] => 22
            [shipping_zipcode] => 2332
            [shipping_city] => Test
            [shipping_countryID] => 2
            [shipping_country] => Deutschland
            [shipping_countryiso] => DE
            [shipping_countryarea] => deutschland
            [shipping_countryen] => GERMANY
            [shipping_text1] => 
            [shipping_text2] => 
            [shipping_text3] => 
            [shipping_text4] => 
            [shipping_text5] => 
            [shipping_text6] => 
            [id] => 4
            [password] => cb32154ec178b88cb055c4b8f50aeaae
            [email] => sth22@shopware.ag
            [active] => 1
            [accountmode] => 0
            [confirmationkey] => 
            [firstlogin] => 2009-07-16
            [lastlogin] => 2009-07-16 16:57:54
            [sessionID] => fce3646f4ba355edaa7dd7a00f1e5069
            [newsletter] => 0
            [validation] => 
            [affiliate] => 0
            [customergroup] => EK
            [paymentpreset] => 0
            [pricegroupID] => 1
            [birthday] => 0000-00-00
            [details] => Array
                (
                    [9] => Array
                        (
                            [orderdetailsID] => 9
                            [orderID] => 9
                            [ordernumber] => 10003
                            [articleID] => 3
                            [articleordernumber] => SW2003
                            [price] => 0.0001
                            [quantity] => 5
                            [invoice] => 0.0005
                            [name] => Test
                            [status] => 0
                            [shipped] => 0
                            [shippedgroup] => 0
                            [releasedate] => 0000-00-00
                            [modus] => 0
                            [esdarticle] => 0
                            [taxID] => 1
                            [tax] => 19
                            [esd] => 0
                        )

                )

        )

    [12] => Array
        (
            [orderID] => 12
            [ordernumber] => 10004
            .....
            ...
            .

sGetOrders

function sGetOrders (array $order = null)

Erklärung Liest eine, mehrere oder alle Bestellungen aus.

Optional kann eine WHERE-Bedingung hinzugefügt werden

Parameter $order Geben Sie einen der folgenden Schlüssel an (optional):
  • int ["orderID"] Bestell-ID (s_order.id)
  • array ["orderIDs"] Array an Bestell-IDs (s_order.id)

Optional kann eine WHERE-Bedingung hinzugefügt werden

  • optional string ["where"] bspw.: "status=0 OR status=1"
Rückgabe array
Werte Array der Bestelldaten

Code-Beispiel:

 
//Beispiel 1
//Auslesen einer Bestellung
$export->sGetOrders (array("where"=>"`o`.`id` = 3"));
 
//Beispiel 2
//Auslesen mehrerer Bestellungen
$export->sGetOrders (array("where"=>"`o`.`id` IN (3,8)"));
 
//Beispiel 3
//Auslesen aller Bestellungen
$export->sGetOrders ();
 
//Beispiel 4
//Auslesen mit WHERE-Bedingung
$export->sGetOrders (array("where"=>"`ordernumber`=11207"));
 

Rückgabe:

Array
(
    [3] => Array
        (
            [orderID] => 3
            [ordernumber] => 11207
            [order_number] => 11207
            [userID] => 1
            [customerID] => 1
            [invoice_amount] => 15
            [invoice_amount_net] => 12.61
            [invoice_shipping] => 0
            [invoice_shipping_net] => 0
            [ordertime] => 2008-11-27 16:22:50
            [status] => 0
            [statusID] => 0
            [cleared] => 0
            [clearedID] => 0
            [paymentID] => 4
            [transactionID] => 
            [comment] => 
            [customercomment] => 
            [net] => 0
            [netto] => 0
            [partnerID] => 
            [temporaryID] => 
            [referer] => 
            [cleareddate] => 0000-00-00 00:00:00
            [cleared_date] => 0000-00-00 00:00:00
            [trackingcode] => 
            [language] => de
            [currency] => EUR
            [currencyFactor] => 1
            [subshopID] => 1
            [dispatchID] => 6
            [currencyID] => 1
            [cleared_description] => Offen
            [status_description] => Offen
            [payment_description] => Rechnung
            [dispatch_description] => Versandart 1
            [currency_description] => Euro
        )

    [8] => Array
        (
            [orderID] => 8
            [ordernumber] => 11208
            [order_number] => 11208
            [userID] => 3
            [customerID] => 3
            [invoice_amount] => 15
            [invoice_amount_net] => 12.61
            [invoice_shipping] => 0
            [invoice_shipping_net] => 0
            [ordertime] => 2009-01-08 22:50:33
            [status] => 0
            [statusID] => 0
            [cleared] => 16
            [clearedID] => 16
            [paymentID] => 4
            [transactionID] => 
            [comment] => 
            [customercomment] => 
            [net] => 0
            [netto] => 0
            [partnerID] => 
            [temporaryID] => 
            [referer] => 
            [cleareddate] => 0000-00-00 00:00:00
            [cleared_date] => 0000-00-00 00:00:00
            [trackingcode] => 
            [language] => de
            [currency] => EUR
            [currencyFactor] => 1
            [subshopID] => 1
            [dispatchID] => 6
            [currencyID] => 1
            [cleared_description] => Inkasso
            [status_description] => Offen
            [payment_description] => Rechnung
            [dispatch_description] => Versandart 1
            [currency_description] => Euro
        )

)

sOrderCustomers

function sOrderCustomers (array $order)

Erklärung Liest die Kundendaten zu einer oder mehreren Bestellungen aus.
Parameter $order Geben Sie einen der folgenden Schlüssel an:
  • int ["orderID"] Bestell-ID (s_order.id)
  • array ["orderIDs"] Array an Bestell-IDs (s_order.id)
Rückgabe array
Werte Array der Kundendatenbestelldaten

Code-Beispiel:

 
//Auslesen der Kundendaten einer Bestellung
$export->sOrderCustomers (array("orderID"=>8));
 
//Auslesen der Kundendaten mehrerer Bestellungen
$export->sOrderCustomers (array("orderIDs"=>array(3,8)));
 

Rückgabe:

Array
(
    [3] => Array
        (            
            [billing_company] => 
            [billing_department] => 
            [billing_salutation] => mr
            [customernumber] => 20005
            [billing_firstname] => Dirk
            [billing_lastname] => Meier
            [billing_street] => Schorlemerstr
            [billing_streetnumber] => 22
            [billing_zipcode] => 48561
            [billing_city] => Wuppertal
            [phone] => 0215 / 55412
            [billing_phone] => 0215 / 55412
            [fax] => 0215 / 55412
            [billing_fax] => 0215 / 55412
            [billing_countryID] => 2
            [billing_country] => Deutschland
            [billing_countryiso] => DE
            [billing_countryarea] => deutschland
            [billing_countryen] => GERMANY
            [ustid] => 
            [billing_text1] => 
            [billing_text2] => 
            [billing_text3] => 
            [billing_text4] => 
            [billing_text5] => 
            [billing_text6] => 
            [orderID] => 9
            [shipping_company] => 
            [shipping_department] => 
            [shipping_salutation] => mr
            [shipping_firstname] => Dirk
            [shipping_lastname] => Meier
            [shipping_street] => Schorlemerstr
            [shipping_streetnumber] => 22
            [shipping_zipcode] => 48561
            [shipping_city] => Wuppertal
            [shipping_countryID] => 2
            [shipping_country] => Deutschland
            [shipping_countryiso] => DE
            [shipping_countryarea] => deutschland
            [shipping_countryen] => GERMANY
            [shipping_text1] => 
            [shipping_text2] => 
            [shipping_text3] => 
            [shipping_text4] => 
            [shipping_text5] => 
            [shipping_text6] => 
            [id] => 4
            [password] => cb3215cec178b84cb055c4b8f50abaae
            [email] => dirk.meier@test.tld
            [active] => 1
            [accountmode] => 0
            [confirmationkey] => 
            [paymentID] => 16
            [firstlogin] => 2009-07-16
            [lastlogin] => 2009-07-16 16:57:54
            [sessionID] => fce3646f4ba355edaa7dd7a00f1e5069
            [newsletter] => 0
            [validation] => 
            [affiliate] => 0
            [customergroup] => EK
            [paymentpreset] => 0
            [language] => de
            [subshopID] => 1
            [referer] => 
            [pricegroupID] => 1
            [birthday] => 1981-06-04

        )

    [8] => Array
        (
            [billing_company] => 
            ......
            ....
            ..

sOrderDetails

function sOrderDetails (array $order)

Erklärung Liest die Bestelldetails zu einer oder mehreren Bestellungen aus.
Parameter $order Geben Sie einen der folgenden Schlüssel an:
  • int ["orderID"] Bestell-ID (s_order.id)
  • array ["orderIDs"] Array an Bestell-IDs (s_order.id)
Rückgabe array
Werte Array der Bestelldetaildaten

Code-Beispiel:

 
//Beispiel 1
//Auslesen der Bestelldetails einer Bestellung
$export->sOrderDetails  (array("orderID"=>90));
 
//Beispiel 2
//Auslesen der Bestelldetails mehrerer Bestellungen
$export->sOrderDetails  (array("orderIDs"=>array(90, 101)));
 

Rückgabe:

//Beispiel 1
Array
(
    [101] => Array
        (
            [orderdetailsID] => 101
            [orderID] => 90
            [ordernumber] => 11215
            [articleID] => 14
            [articleordernumber] => SW1197.13
            [price] => 99
            [quantity] => 1
            [invoice] => 99
            [name] => Test2 
Farbe: weiß
Größe: 43
Material: Leder
            [status] => 0
            [shipped] => 0
            [shippedgroup] => 0
            [releasedate] => 0000-00-00
            [modus] => 0
            [esdarticle] => 0
            [taxID] => 1
            [tax] => 19
            [esd] => 0
        )

    [102] => Array
        (
            [orderdetailsID] => 102
            [orderID] => 90
            [ordernumber] => 11215
            [articleID] => 1
            [articleordernumber] => 12422
            [price] => -2
            [quantity] => 1
            [invoice] => -2
            [name] => Gutschein
            [status] => 0
            [shipped] => 0
            [shippedgroup] => 0
            [releasedate] => 0000-00-00
            [modus] => 2
            [esdarticle] => 0
            [taxID] => 0
            [tax] => 
            [esd] => 0
        )

)

//Beispiel 2
Array
(
    [90] => Array
        (
            [101] => Array
                (
                    [orderdetailsID] => 101
                    [orderID] => 90
                    [ordernumber] => 11215
                    [articleID] => 14
                    [articleordernumber] => SW1197.13
                    [price] => 99
                    [quantity] => 1
                    [invoice] => 99
                    [name] => Test2 
Farbe: weiß
Größe: 43
Material: Leder
                    [status] => 0
                    [shipped] => 0
                    [shippedgroup] => 0
                    [releasedate] => 0000-00-00
                    [modus] => 0
                    [esdarticle] => 0
                    [taxID] => 1
                    [tax] => 19
                    [esd] => 0
                )

            [102] => Array
                (
                    [orderdetailsID] => 102
                    [orderID] => 90
                    [ordernumber] => 11215
                    [articleID] => 1
                    [articleordernumber] => 12422
                    [price] => -2
                    [quantity] => 1
                    [invoice] => -2
                    [name] => Gutschein
                    [status] => 0
                    [shipped] => 0
                    [shippedgroup] => 0
                    [releasedate] => 0000-00-00
                    [modus] => 2
                    [esdarticle] => 0
                    [taxID] => 0
                    [tax] => 
                    [esd] => 0
                )

        )

    [101] => Array
        (
            [120] => Array
                (
                    [orderdetailsID] => 120
            	    [orderID] => 101
                    .......
                    ....
                    ...

sSettings

function sSettings ()

Erklärung Liest shopware Einstellungen aus, die für den Wiwi-Abgleich notwendig sind. Hierzu zählen:
  • Shopware MwSt. - Sätze
  • Shopware Bestell Statús
  • Shopware Zahlstatús
  • Shopware Preiseinheiten
  • Shopware Kundengruppen
Rückgabe array
Werte Array der Shopware Einstellungen

Code-Beispiel:

 
$export->sSettings();
 

Rückgabe:

Array
(
    [tax] => Array
        (
            [1] => Array
                (
                    [tax] => 19
                    [description] => 19%
                )

            [4] => Array
                (
                    [tax] => 7
                    [description] => 7 %
                )

        )

    [order_states] => Array
        (
            [0] => Array
                (
                    [description] => Offen
                )

            [1] => Array
                (
                    [description] => In Bearbeitung (Wartet)
                )

            [2] => Array
                .....
                ...
                .

        )

    [payment_states] => Array
        (
            [17] => Array
                (
                    [description] => Offen
                )

            [9] => Array
                (
                    [description] => Teilweise in Rechnung gestellt
                )

            [10] => Array
                (
                    ......
                    ..
                    .

        )

    [payment_means] => Array
        (
            [19] => Array
                (
                    [name] => ClickandBuy
                    [description] => ClickandBuy 
                    [debit_percent] => 0
                    [surcharge] => 0
                    [position] => 1
                    [active] => 1
                    [esd] => 1
                )

            [5] => Array
                (
                    [name] => prepayment
                    [description] => Vorkasse
                    [debit_percent] => 0
                    [surcharge] => 0
                    [position] => 1
                    [active] => 1
                    [esd] => 0
                )

            [20] => Array
                (
                    .......
                    .....
                    ..

        )

    [units] => Array
        (
            [1] => Array
                (
                    [unit] => l
                    [description] => Liter
                )

            [2] => Array
                (
                 ......
                 ...
                 .

        )

    [customer_groups] => Array
        (
            [EK] => Array
                (
                    [description] => Shopkunden
                    [tax] => 1
                    [taxinput] => 1
                    [minimumorder] => 0
                    [minimumordersurcharge] => 0
                )

            [H] => Array
                (
                    [description] => Händler
                    [tax] => 0
                    [taxinput] => 0
                    [minimumorder] => 0
                    [minimumordersurcharge] => 0
                )

        )

    [manufacturers] => Array
        (
            [1] => Array
                (
                    [name] => HerstellerXY
                )

            [2] => Array
                (
                    [name] => Herstellername
                )
            .....
            ....
            .

        )

)

sSuppliers

function sSuppliers ()

Erklärung Liest alle Herstellerinformationen aus und gibt sie als Array zurück
Rückgabe array
Werte Herstellerinformationen

Code-Beispiel:

 
$export->sSuppliers();
 

Rückgabe:

Array
(
    [1] => Array
        (
            [supplierID] => 1
            [name] => Test
            [img] => 
            [link] => 
            [img_link] => http://www.shopwareshop.de/304/images/supplier/
        )

    [2] => Array
        (
            [supplierID] => 2
            ......
            ...
            .

sUpdateOrderStatus

function sUpdateOrderStatus($order)

Erklärung Ändert den Status ein oder mehrerer Bestellungen
Parameter $order Geben Sie einen der folgenden Schlüssel an:
  • int ["orderID"] ID der Bestellung (s_order.id) oder
  • array ["orderIDs"] mehrere Bestell-IDs
  • optional int ["status"] neue StatusID (s_order.status) (default:1 [In Bearbeitung])
  • optional string ["status"] Ein Kommentar der dem Kunden angezeigt werden soll
Rückgabe bool
Werte Erfolgsmeldung

Code-Beispiel:

 
//Hinweis
//Die ID eines Status können in der Tabelle s_core_states eingesehen werden
 
//Beispiel 1
//Setzt die Bestellung mit der orderID 9 auf den Default-Status 1 ("In Bearbeitung")
$export->sUpdateOrderStatus(array("orderID"=>9));
 
//Beispiel 2
//Setzt die Bestellungen mit der orderID 9 und 12 auf den Status -1 und setzt einen entsprechenden Kommentar
$export->sUpdateOrderStatus(array("orderIDs"=>array(4, 12), "status"=>-1, "comment"=>"Kommentar");
 

sSetCustomernumber

function sSetCustomernumber($userID, $customernumber)

Erklärung Setzt die Kundennummer eines Kunden
Parameter $userID Die ID des Kunden (s_user.id)
Parameter $customernumber Neue Kundennummer ( setzt s_user_billingaddress.customernumber)
Rückgabe bool
Werte Erfolgsmeldung

Code-Beispiel:

 
 
//Beispiel 1
//Setzt dem Kunden mit der ID 15 die Kundennummer 14002
$export->sSetCustomernumber(15, 14002);
 

sSetTrackingID

function sSetTrackingID($order, $trackingcode)

Erklärung Setzt den Tracking-Code einer Bestellung (s_order.trackingcode)
Parameter $order Geben Sie einen der folgenden Typen an:
  • int ID der Bestellung (s_order.id) oder
  • string Bestellnummer (s_order.ordernumber) oder
  • array ID der Bestellung oder Bestellnummer
    • int ["orderID"] ID der Bestellung oder
    • string ["ordernumber"] Bestellnummer
Parameter string $trackingcode Tracking-ID/URL
Rückgabe bool
Werte Erfolgsmeldung

Code-Beispiel:

 
 
//Beispiel 1
//Setzt den Tracking-Code der Bestellung mit der ID 45
$export->sSetTrackingID(45, "NEUER_TRACK_1234");
 
//Beispiel 2
//Alternative Schreibweise (Beispiel 1)
$export->sSetTrackingID(array("orderID"=>45), "NEUER_TRACK_1234");
 
//Beispiel 3
//Setzt den Tracking-Code der Bestellung mit der Bestellnummer 52368
$export->sSetTrackingID("52368", "NEUER_TRACK_1234");
 
//Beispiel 4
//Alternative Schreibweise (Beispiel 3)
$export->sSetTrackingID(array("ordernumber"=>"52368"), "NEUER_TRACK_1234");
 

Artikel-PDF erstellen

Artikel bewerten

Waren diese Informationen hilfreich? Ja Nein


Kommentare:

Artikel kommentieren


Die mit einem * markierten Felder sind Pflichtfelder.

Weitere interessante Artikel:

Bezeichnung:
Rating:
Klicks:
Datum:
7 Punkte
6745
10.06.2009
7 Punkte
3934
10.06.2009

Bestell-Nr.: SW1208

Lieferzeit ca. 5 Tage

€ 1,00

Preise inkl. gesetzlicher
MwSt. zzgl. Versandkosten*

€ 1,00

Preise inkl. gesetzlicher
MwSt. + Versandkosten*

Kategorien: