API Import Variante Bildwechsel

Hi, sorry aber ich muss euch leider hiermit weiter nervern, denn ich komme hier nicht weiter. Ich schreibe noch mal zusammengefasst meine Beobachtungen auf: über das Import per API ergibt sich ein Problem bei der Zuordnung zwischen dem Bild und der Configurator Option. dies niederschlägt sich in der Tabelle ‘s_article_img_mapping_rules’. Dort werden beim Import eines ConfiguratorSets mit mehreren Optionen dann nur eine Option für alle Einträge gemappt: 1) es wird ein Set für den Artikel angelegt (s_article_configurator_sets): 2) es wird eine Gruppe für den Set angelegt (s_article_configurator_groups): Name filtere ich per htmlentities, da ich dachte, der Fehler könnte durch irgendwelche Sonderzeichen kommen 3) die Set - Group Zuordnung ist soweit richtig (s_article_configurator_set_group_relations): 4) die Optionen der Gruppe wurden ebenfalls angelegt und der Gruppe zugeordnet, drei verschiedene Größen (s_article_configurator_options): 5) die Optionen werden auch dem passenden Set zugeordnet: 6) das Bild das zu den Optionen gemappt werden soll, wird über mediaId zugeordnet (s_articles_img): 7) hier sind die drei entsprechenden Varianten (s_articles_details), die articleID entspricht der articleID aus ders_articles_img Tabelle: 8) für die drei Varianten werden drei Mappings zur passenden image_id erstellt (s_article_img_mappings): 9) [color=red]FEHLER[/color]: in der Tabelle s_article_img_mapping_rules wird in der Spalte option_id anstelle der drei verschiedenen Optionen immer die gleiche Option gewählt, und zwar die erste importierte: print_r vom API Importierten Artikel ist: Array ( [name] =\> Bontrager Unterhose Sport Cycleliner [metaTitle] =\> Bontrager Unterhose Sport Cycleliner kaufen [active] =\> 1 [supplier] =\> Bontrager [categories] =\> Array ( [0] =\> Array ( [id] =\> 1634 ) ) [mainDetail] =\> Array ( [number] =\> 7610 [unitId] =\> 9 [inStock] =\> 0 [prices] =\> Array ( [0] =\> Array ( [customerGroupKey] =\> EK [price] =\> 29.99 ) ) ) [taxId] =\> 1 [filterGroupId] =\> 1 [configuratorSet] =\> Array ( [name] =\> Bontrager Unterhose Sport Cycleliner - Set [type] =\> 1 [groups] =\> Array ( [0] =\> Array ( [name] =\> Größe [options] =\> Array ( [0] =\> Array ( [name] =\> L ) [1] =\> Array ( [name] =\> M ) [2] =\> Array ( [name] =\> S ) ) ) ) ) [images] =\> Array ( [0] =\> Array ( [mediaId] =\> 12555 [options] =\> Array ( [0] =\> Array ( [0] =\> Array ( [name] =\> L ) ) [1] =\> Array ( [0] =\> Array ( [name] =\> M ) ) [2] =\> Array ( [0] =\> Array ( [name] =\> S ) ) ) ) ) [variants] =\> Array ( [0] =\> Array ( [isMain] =\> 1 [number] =\> 411243 [prices] =\> Array ( [0] =\> Array ( [customerGroupKey] =\> EK [price] =\> 29.99 ) ) [inStock] =\> 0 [active] =\> 1 [configuratorOptions] =\> Array ( [0] =\> Array ( [group] =\> Größe [option] =\> L ) ) ) [1] =\> Array ( [isMain] =\> [number] =\> 411242 [prices] =\> Array ( [0] =\> Array ( [customerGroupKey] =\> EK [price] =\> 29.99 ) ) [inStock] =\> 0 [active] =\> 1 [configuratorOptions] =\> Array ( [0] =\> Array ( [group] =\> Größe [option] =\> M ) ) ) [2] =\> Array ( [isMain] =\> [number] =\> 411241 [prices] =\> Array ( [0] =\> Array ( [customerGroupKey] =\> EK [price] =\> 29.99 ) ) [inStock] =\> 0 [active] =\> 1 [configuratorOptions] =\> Array ( [0] =\> Array ( [group] =\> Größe [option] =\> S ) ) ) ) ) Dies passiert z.B. bei ersten drei Artikeln, beim vierten klappt das aufeinmal (s_article_img_mapping_rules, die letzen 5 Einträge): print_r von diesem Artikel ist: Array ( [name] =\> Bontrager Unterhemd B2 Langarm [metaTitle] =\> Bontrager Unterhemd B2 Langarm kaufen [active] =\> 1 [supplier] =\> Bontrager [categories] =\> Array ( [0] =\> Array ( [id] =\> 1636 ) ) [mainDetail] =\> Array ( [number] =\> 9242 [unitId] =\> 9 [inStock] =\> 0 [prices] =\> Array ( [0] =\> Array ( [customerGroupKey] =\> EK [price] =\> 39.99 ) ) ) [taxId] =\> 1 [filterGroupId] =\> 1 [configuratorSet] =\> Array ( [name] =\> Bontrager Unterhemd B2 Langarm - Set [type] =\> 1 [groups] =\> Array ( [0] =\> Array ( [name] =\> Größe [options] =\> Array ( [0] =\> Array ( [name] =\> L ) [1] =\> Array ( [name] =\> M ) [2] =\> Array ( [name] =\> S ) [3] =\> Array ( [name] =\> XL ) [4] =\> Array ( [name] =\> XXL ) ) ) ) ) [images] =\> Array ( [0] =\> Array ( [mediaId] =\> 12555 [options] =\> Array ( [0] =\> Array ( [0] =\> Array ( [name] =\> L ) ) [1] =\> Array ( [0] =\> Array ( [name] =\> M ) ) [2] =\> Array ( [0] =\> Array ( [name] =\> S ) ) [3] =\> Array ( [0] =\> Array ( [name] =\> XL ) ) [4] =\> Array ( [0] =\> Array ( [name] =\> XXL ) ) ) ) ) [variants] =\> Array ( [0] =\> Array ( [isMain] =\> 1 [number] =\> 423681 [prices] =\> Array ( [0] =\> Array ( [customerGroupKey] =\> EK [price] =\> 39.99 ) ) [inStock] =\> 0 [active] =\> 1 [configuratorOptions] =\> Array ( [0] =\> Array ( [group] =\> Größe [option] =\> L ) ) ) [1] =\> Array ( [isMain] =\> [number] =\> 423680 [prices] =\> Array ( [0] =\> Array ( [customerGroupKey] =\> EK [price] =\> 39.99 ) ) [inStock] =\> 0 [active] =\> 1 [configuratorOptions] =\> Array ( [0] =\> Array ( [group] =\> Größe [option] =\> M ) ) ) [2] =\> Array ( [isMain] =\> [number] =\> 423679 [prices] =\> Array ( [0] =\> Array ( [customerGroupKey] =\> EK [price] =\> 39.99 ) ) [inStock] =\> 0 [active] =\> 1 [configuratorOptions] =\> Array ( [0] =\> Array ( [group] =\> Größe [option] =\> S ) ) ) [3] =\> Array ( [isMain] =\> [number] =\> 423682 [prices] =\> Array ( [0] =\> Array ( [customerGroupKey] =\> EK [price] =\> 39.99 ) ) [inStock] =\> 0 [active] =\> 1 [configuratorOptions] =\> Array ( [0] =\> Array ( [group] =\> Größe [option] =\> XL ) ) ) [4] =\> Array ( [isMain] =\> [number] =\> 423683 [prices] =\> Array ( [0] =\> Array ( [customerGroupKey] =\> EK [price] =\> 39.99 ) ) [inStock] =\> 0 [active] =\> 1 [configuratorOptions] =\> Array ( [0] =\> Array ( [group] =\> Größe [option] =\> XXL ) ) ) ) ) Von Struktur her unterscheiden sie sich nicht. Um zu testen ob es an einzelnen Artikeln liegt, habe ich die Import Reihenfolge umgestellt. Den vierten Artikel habe ich auf der ersten Stelle, der rest verschiebt sich um eine Stelle nach hinten. Dann funktioniert jedoch der erste nicht, der zweite ja, der dritte nicht, der vierte wiederum schon. D.h. es liegt nicht an Artikeln. Ich habe jedoch die Vermutung, dass es davon abhängt, ob eine beistmmte Option einer Gruppe zum Zeitpunkt des Imports eines Artikels mit dieser Option bereits existiert oder nicht. Wird also die Option zusammen mit dem Artikel gerade angelegt, dann läuft was schief mit der s_article_img_mapping_rules Tabelle. Wurde die Option jedoch zuvor angelegt, dann läuft das die durch.