Plugin Directory

Changeset 3425260


Ignore:
Timestamp:
12/22/2025 11:02:20 AM (3 months ago)
Author:
fuvarhu
Message:

Stable tag: 3.0.1
Support packli endpoints

Location:
fuvar-hu-api/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • fuvar-hu-api/trunk/inc/shipping_method.php

    r3259600 r3425260  
    484484        $provider = "mpl";
    485485        $show_for = "fuvarhu_csp";
     486        $packli_service_id = [2];
    486487    }
    487488
     
    490491        $provider = "mpl";
    491492        $show_for = "fuvarhu_pop";
     493        $packli_service_id = [3];
    492494    }
    493495
     
    496498        $provider = "mpl";
    497499        $show_for = "fuvarhu_pos";
     500        $packli_service_id = [4];
    498501    }
    499502
     
    502505        $provider = "dpd";
    503506        $show_for = "fuvarhu_aut_dpd";
     507        $packli_service_id = [8];
    504508    }
    505509
     
    508512        $provider = "pck";
    509513        $show_for = "fuvarhu_aut_pck";
     514        $packli_service_id = [10,9];
    510515    }
    511516
     
    514519        $provider = "fxp";
    515520        $show_for = "fuvarhu_aut_fxp";
     521
     522        $packli_service_id = [14];
    516523    }
    517524
     
    520527    }
    521528
    522     $response   = wp_remote_post("https://backend.fuvar.hu/graphql/public/",[
     529    $response   = wp_remote_get(add_query_arg([
     530        'provider_service_ids' => $packli_service_id,
     531        'page' => 0,
     532        'limit' => 10000
     533    ],"https://app.packli.hu/api/v3/provider-places"),[
    523534        'headers' => [
    524535            'Accept: application/json',
    525536            'Content-Type: application/json'
    526537        ],
    527         'body' => ['query' => 'query getMplPoints($type: String! $search: String     $provider: String) {collectorpoints(limit: 0, page: 1, type: $type, search: $search, provider: $provider) {data {id point_id title zip city address}}}', 'variables' => [
    528             'type' => $selected,
    529             'search' => '',
    530             'provider' => $provider
    531         ]]
    532538    ]);
    533539
     
    541547        $points = json_decode($mpl_points,true);
    542548       
    543         if(!isset($points['data']) || !isset($points['data']['collectorpoints']) || !isset($points['data']['collectorpoints']['data'])){
     549        if(!isset($points['data'])){
    544550            echo $pointserror;
    545551            return;
    546552        }
    547553
    548         $points = $points['data']['collectorpoints']['data'];
     554        $points = $points['data'];
    549555
    550556        foreach ($points as $key => $value) {
    551             $options[$value["title"]] = $value["city"]." - ".$value["title"]." (".$value["address"].")";
     557            $options[$value["name"]] = $value["city"]." - ".$value["name"]." (".$value["address"].")";
    552558        }
    553559
  • fuvar-hu-api/trunk/readme.txt

    r3259600 r3425260  
    1 === Fuvar.hu Szállítási Módok ===
     1=== Packli (Fuvar.hu) Szállítási Módok ===
    22Contributors: fuvarhu
    33Tags: shipping, orders
    44Requires at least: 5.6.1
    55Tested up to: 6.1
    6 Stable tag: 2.1.1
     6Stable tag: 3.0.1
    77Requires PHP: 8.1
    88License: GPLv2 or later
Note: See TracChangeset for help on using the changeset viewer.