Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 6fc71499

Von Werner Hahn vor mehr als 7 Jahren hinzugefügt

  • ID 6fc7149912e64138860968035ea2f1aff2b2265a
  • Vorgänger cd74874b

Shopmodul: Nicht neötigte funktionen raus, Typo

Unterschiede anzeigen:

SL/ShopConnector/Shopware.pm
24 24
  'scalar --get_set_init' => [ qw(connector url) ],
25 25
);
26 26

  
27
sub get_order_max {
28
  my ($self) = @_;
29
  my %params = ( sort  => { property  => 'number',
30
                            direction => 'DESC',
31
                          },
32
               );
33
  my $url       = $self->url;
34
  my $data      = $self->connector->get($url . "api/orders?limit=1", %params);
35
  my $data_json = $data->content;
36
  my $import    = SL::JSON::decode_json($data_json);
37
}
38

  
39 27
sub get_new_orders {
40 28
  my ($self, $id) = @_;
41 29

  
42
  my $url       = $self->url;
43
  my $ordnumber = $self->config->last_order_number + 1;
44
  my $otf       = $self->config->orders_to_fetch;
45
  my $of        = 0;
46
    my %params = ( filter => [  property   => 'customerId',
47
                                  value      => 1,
48

  
49
                             ],
50
                 );
51
    my @filter = (  { property   => 'customerId',
52
                        value      => 1,
53
                      }
54

  
55
                 );
56
                 %params = ( filter => [ @filter ]);
57
    my $orders_data      = $self->connector->get($url . "api/orders?limit=$otf&filter[0][property]=number&filter[0][expression]=>&filter[0][value]=" . $self->config->last_order_number);
58
    my $orders_data_json = $orders_data->content;
59
    my $orders_import    = SL::JSON::decode_json($orders_data_json);
30
  my $url              = $self->url;
31
  my $ordnumber        = $self->config->last_order_number + 1;
32
  my $otf              = $self->config->orders_to_fetch;
33
  my $of               = 0;
34
  my $orders_data      = $self->connector->get($url . "api/orders?limit=$otf&filter[0][property]=number&filter[0][expression]=>&filter[0][value]=" . $self->config->last_order_number);
35
  my $orders_data_json = $orders_data->content;
36
  my $orders_import    = SL::JSON::decode_json($orders_data_json);
60 37

  
61
    if ($orders_import->{success}){
62
      foreach my $shoporder(@{ $orders_import->{data} }){
38
  if ($orders_import->{success}){
39
    foreach my $shoporder(@{ $orders_import->{data} }){
63 40

  
64
        my $data      = $self->connector->get($url . "api/orders/" . $shoporder->{id});
65
        my $data_json = $data->content;
66
        my $import    = SL::JSON::decode_json($data_json);
41
      my $data      = $self->connector->get($url . "api/orders/" . $shoporder->{id});
42
      my $data_json = $data->content;
43
      my $import    = SL::JSON::decode_json($data_json);
67 44

  
68 45
      my $shop_order = $self->map_data_to_shoporder($import);
69 46

  

Auch abrufbar als: Unified diff