Revision b85ed480
Von Werner Hahn vor mehr als 6 Jahren hinzugefügt
SL/ShopConnector/Shopware.pm | ||
---|---|---|
150 | 150 |
# return $import; |
151 | 151 |
}; |
152 | 152 |
|
153 |
sub get_categories { |
|
154 |
my ($self) = @_; |
|
155 |
|
|
156 |
my $url = $self->url; |
|
157 |
|
|
158 |
my $data = $self->connector->get("http://$url/api/categories"); |
|
159 |
my $data_json = $data->content; |
|
160 |
my $import = SL::JSON::decode_json($data_json); |
|
161 |
my @daten = @{$import->{data}}; |
|
162 |
my %categories = map { ($_->{id} => $_) } @daten; |
|
163 |
|
|
164 |
for(@daten) { |
|
165 |
my $parent = $categories{$_->{parentId}}; |
|
166 |
$parent->{children} ||= []; |
|
167 |
push @{$parent->{children}},$_; |
|
168 |
} |
|
169 |
|
|
170 |
return \@daten; |
|
171 |
} |
|
172 |
|
|
173 |
sub get_article { |
|
174 |
} |
|
175 |
|
|
176 |
sub get_articles { |
|
177 |
} |
|
178 |
|
|
179 |
sub set_article { |
|
180 |
} |
|
181 |
|
|
153 | 182 |
sub init_url { |
154 | 183 |
my ($self) = @_; |
155 | 184 |
# TODO: validate url and port |
Auch abrufbar als: Unified diff
Shopmodul: ShopPart Bilder und Kategorien
Bilder werden als Tabelle angezeigt
Conflicts:
templates/webpages/ic/tabs/_shop.html
Shopparts: Bilder werden angezeigt TODO Bilder löschen
Shopkategorien werden aus der Api/Shop geholt und angezeigt zum markieren
Conflicts:
SL/Controller/ShopPart.pm
SL/ShopConnector/Shopware.pm
js/kivi.shop_part.js