WooCommerce: Lieferkosten als Position anfügen
[kivitendo-erp.git] / SL / ShopConnector / Shopware.pm
index 04cd69a..79f7cd6 100644 (file)
@@ -265,13 +265,22 @@ sub get_categories {
   my @daten      = @{$import->{data}};
   my %categories = map { ($_->{id} => $_) } @daten;
 
+  my @categories_tree;
   for(@daten) {
+    # ignore root with id=1
+    if( $_->{id} == 1) {
+      next;
+    }
     my $parent = $categories{$_->{parentId}};
-    $parent->{children} ||= [];
-    push @{$parent->{children}},$_;
+    if($parent && $parent->{id} != 1) {
+      $parent->{children} ||= [];
+      push @{$parent->{children}},$_;
+    } else {
+      push @categories_tree, $_;
+    }
   }
 
-  return \@daten;
+  return \@categories_tree;
 }
 
 sub get_version {
@@ -407,7 +416,7 @@ sub update_part {
   return $upload_content->{success};
 }
 
-sub get_article {
+sub get_parts_info {
   my ($self,$partnumber) = @_;
 
   my $url       = $self->url;