Plugin Directory

Changeset 3484903


Ignore:
Timestamp:
03/17/2026 03:30:15 PM (2 weeks ago)
Author:
fuvarhu
Message:

gls support

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

Legend:

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

    r3435026 r3484903  
    55      Plugin URI: https://app.packli.hu
    66      description: Bővítmény segítségével hozzáadhatod a packli.hu által kínált szolgáltatásokat a webshopodhoz
    7       Version: 3.0.2
     7      Version: 3.0.3
    88      Author: Packli Logistic KFT
    99      License: GPL2
  • fuvar-hu-api/trunk/inc/shipping_method.php

    r3435026 r3484903  
    1212    $methods[ 'fuvarhu_aut_fxp' ] = 'WC_Shipping_fuvarhu_AUT_FXP';
    1313
     14    $methods[ 'fuvarhu_hazhoz_gls' ] = 'WC_Shipping_fuvarhu_HAZ_GLS';
     15    $methods[ 'fuvarhu_csp_gls' ] = 'WC_Shipping_fuvarhu_CSP_GLS';
     16    $methods[ 'fuvarhu_aut_gls' ] = 'WC_Shipping_fuvarhu_AUT_GLS';
     17
    1418    return $methods;
    1519}
    1620add_action( 'woocommerce_admin_order_data_after_order_details', 'fuvarhu_display_order_data_in_admin', 10, 1 );
    1721function fuvarhu_display_order_data_in_admin( $order ){
    18     echo '<div class="order_data_column"> <h4>' . __( "Fuvar.hu Szállítás", "woocommerce" ) . '</h4>';
     22    echo '<div class="order_data_column"> <h4>' . __( "Packli.hu Szállítás", "woocommerce" ) . '</h4>';
    1923
    2024    foreach( $order->get_items( 'shipping' ) as $item_id => $item ){
     
    8185                    $this->id                    = 'fuvarhu_hazhoz';
    8286                    $this->instance_id           = absint( $instance_id );
    83                     $this->method_title          = __( 'Fuvar.hu - Házhoz szállítás (MPL)' );
    84                     $this->method_description    = __( 'Házhozszállítás a Fuvar.hu szerződött partnere által' );
     87                    $this->method_title          = __( 'Packli.hu - Házhoz szállítás (MPL)' );
     88                    $this->method_description    = __( 'Házhozszállítás a Packli.hu szerződött partnere által' );
    8589                    $this->supports              = array(
    8690                        'shipping-zones',
     
    123127                    $this->id                    = 'fuvarhu_hazhoz_dpd';
    124128                    $this->instance_id           = absint( $instance_id );
    125                     $this->method_title          = __( 'Fuvar.hu - Házhoz szállítás (DPD)' );
    126                     $this->method_description    = __( 'Házhozszállítás a Fuvar.hu szerződött partnere által' );
     129                    $this->method_title          = __( 'Packli.hu - Házhoz szállítás (DPD)' );
     130                    $this->method_description    = __( 'Házhozszállítás a Packli.hu szerződött partnere által' );
    127131                    $this->supports              = array(
    128132                        'shipping-zones',
     
    165169                    $this->id                    = 'fuvarhu_aut_dpd';
    166170                    $this->instance_id           = absint( $instance_id );
    167                     $this->method_title          = __( 'Fuvar.hu - Automata & Csomagpont (DPD)' );
    168                     $this->method_description    = __( 'DPD Automata & Csomagpont a Fuvar.hu szerződött partnere által' );
     171                    $this->method_title          = __( 'Packli.hu - Automata & Csomagpont (DPD)' );
     172                    $this->method_description    = __( 'DPD Automata & Csomagpont a Packli.hu szerződött partnere által' );
    169173                    $this->supports              = array(
    170174                        'shipping-zones',
     
    207211                    $this->id                    = 'fuvarhu_aut_pck';
    208212                    $this->instance_id           = absint( $instance_id );
    209                     $this->method_title          = __( 'Fuvar.hu - Automata & Csomagpont (Packeta)' );
    210                     $this->method_description    = __( 'Packeta Automata & Csomagpont a Fuvar.hu szerződött partnere által' );
     213                    $this->method_title          = __( 'Packli.hu - Automata & Csomagpont (Packeta)' );
     214                    $this->method_description    = __( 'Packeta Automata & Csomagpont a Packli.hu szerződött partnere által' );
    211215                    $this->supports              = array(
    212216                        'shipping-zones',
     
    249253                $this->id                    = 'fuvarhu_aut_fxp';
    250254                $this->instance_id           = absint( $instance_id );
    251                 $this->method_title          = __( 'Fuvar.hu - Automata (Foxpost)' );
    252                 $this->method_description    = __( 'Foxpost Automata a Fuvar.hu szerződött partnere által' );
     255                $this->method_title          = __( 'Packli.hu - Automata (Foxpost)' );
     256                $this->method_description    = __( 'Foxpost Automata a Packli.hu szerződött partnere által' );
    253257                $this->supports              = array(
    254258                    'shipping-zones',
     
    292296                    $this->id                    = 'fuvarhu_pop';
    293297                    $this->instance_id           = absint( $instance_id );
    294                     $this->method_title          = __( 'Fuvar.hu - MPL PostaPontra (MOL, Coop)' );
     298                    $this->method_title          = __( 'Packli.hu - MPL PostaPontra (MOL, Coop)' );
    295299                    $this->method_description    = __( 'Kiszállítás MPL PostaPontra' );
    296300                    $this->supports              = array(
     
    334338                    $this->id                    = 'fuvarhu_pos';
    335339                    $this->instance_id           = absint( $instance_id );
    336                     $this->method_title          = __( 'Fuvar.hu - Postára kézbesítés' );
     340                    $this->method_title          = __( 'Packli.hu - Postára kézbesítés' );
    337341                    $this->method_description    = __( 'Kiszállítás postán maradó csomagként' );
    338342                    $this->supports              = array(
     
    376380                    $this->id                    = 'fuvarhu_csp';
    377381                    $this->instance_id           = absint( $instance_id );
    378                     $this->method_title          = __( 'Fuvar.hu - MPL Csomagautoma' );
     382                    $this->method_title          = __( 'Packli.hu - MPL Csomagautoma' );
    379383                    $this->method_description    = __( 'Kiszállítás MPL Csomagautomatába' );
    380384                    $this->supports              = array(
     
    399403                    $this->enabled              = $this->get_option( 'enabled' );
    400404                    $this->title                = 'Automata (MPL)';
     405
     406                    add_action( 'woocommerce_update_options_shipping_' . $this->id, array( $this, 'process_admin_options' ) );
     407                }
     408
     409                public function calculate_shipping( $package = array() ) {
     410                    $this->add_rate( array(
     411                        'id'    => $this->id . $this->instance_id,
     412                        'label' => $this->title,
     413                        'cost'  => $this->get_option('shipping_fee'),
     414                    ) );
     415                }
     416        }
     417    }
     418
     419
     420    if(!class_exists("WC_Shipping_fuvarhu_HAZ_GLS")){
     421            class WC_Shipping_fuvarhu_HAZ_GLS extends WC_Shipping_Method {
     422                public function __construct( $instance_id = 0 ) {
     423                    $this->id                    = 'fuvarhu_hazhoz_gls';
     424                    $this->instance_id           = absint( $instance_id );
     425                    $this->method_title          = __( 'Packli.hu - Házhoz szállítás (GLS)' );
     426                    $this->method_description    = __( 'Házhozszállítás a Packli.hu szerződött partnere által' );
     427                    $this->supports              = array(
     428                        'shipping-zones',
     429                        'instance-settings',
     430                    );
     431                    $this->instance_form_fields = array(
     432                        'enabled' => array(
     433                            'title'         => __( 'Engedélyezve' ),
     434                            'type'          => 'checkbox',
     435                            'label'         => __( 'Szállítási mód engedélyezése' ),
     436                            'default'       => 'yes',
     437                        ),
     438                        'shipping_fee' => array(
     439                            'title'         => __( 'Szállítás összege' ),
     440                            'type'          => 'number',
     441                            'description'   => __( 'A vevőre terhelt szállítási díj' ),
     442                            'default'       => __( '0' ),
     443                            'desc_tip'      => true
     444                        )
     445                    );
     446                    $this->enabled              = $this->get_option( 'enabled' );
     447                    $this->title                = 'Házhoz szállítás (GLS)';
     448
     449                    add_action( 'woocommerce_update_options_shipping_' . $this->id, array( $this, 'process_admin_options' ) );
     450                }
     451
     452                public function calculate_shipping( $package = array() ) {
     453                    $this->add_rate( array(
     454                        'id'    => $this->id . $this->instance_id,
     455                        'label' => $this->title,
     456                        'cost'  => $this->get_option('shipping_fee'),
     457                    ) );
     458                }
     459        }
     460    }
     461
     462    if(!class_exists("WC_Shipping_fuvarhu_CSP_GLS")){
     463            class WC_Shipping_fuvarhu_CSP_GLS extends WC_Shipping_Method {
     464                public function __construct( $instance_id = 0 ) {
     465                    $this->id                    = 'fuvarhu_csp_gls';
     466                    $this->instance_id           = absint( $instance_id );
     467                    $this->method_title          = __( 'Csomagpont (GLS)' );
     468                    $this->method_description    = __( 'GLS Csomagpont a Packli.hu szerződött partnere által' );
     469                    $this->supports              = array(
     470                        'shipping-zones',
     471                        'instance-settings',
     472                    );
     473                    $this->instance_form_fields = array(
     474                        'enabled' => array(
     475                            'title'         => __( 'Engedélyezve' ),
     476                            'type'          => 'checkbox',
     477                            'label'         => __( 'Szállítási mód engedélyezése' ),
     478                            'default'       => 'yes',
     479                        ),
     480                        'shipping_fee' => array(
     481                            'title'         => __( 'Szállítás összege' ),
     482                            'type'          => 'number',
     483                            'description'   => __( 'A vevőre terhelt szállítási díj' ),
     484                            'default'       => __( '0' ),
     485                            'desc_tip'      => true
     486                        )
     487                    );
     488                    $this->enabled              = $this->get_option( 'enabled' );
     489                    $this->title                = 'Csomagpont (GLS)';
     490
     491                    add_action( 'woocommerce_update_options_shipping_' . $this->id, array( $this, 'process_admin_options' ) );
     492                }
     493
     494                public function calculate_shipping( $package = array() ) {
     495                    $this->add_rate( array(
     496                        'id'    => $this->id . $this->instance_id,
     497                        'label' => $this->title,
     498                        'cost'  => $this->get_option('shipping_fee'),
     499                    ) );
     500                }
     501        }
     502    }
     503
     504    if(!class_exists("WC_Shipping_fuvarhu_AUT_GLS")){
     505            class WC_Shipping_fuvarhu_AUT_GLS extends WC_Shipping_Method {
     506                public function __construct( $instance_id = 0 ) {
     507                    $this->id                    = 'fuvarhu_aut_gls';
     508                    $this->instance_id           = absint( $instance_id );
     509                    $this->method_title          = __( 'Automata (GLS)' );
     510                    $this->method_description    = __( 'GLS Automata a Packli.hu szerződött partnere által' );
     511                    $this->supports              = array(
     512                        'shipping-zones',
     513                        'instance-settings',
     514                    );
     515                    $this->instance_form_fields = array(
     516                        'enabled' => array(
     517                            'title'         => __( 'Engedélyezve' ),
     518                            'type'          => 'checkbox',
     519                            'label'         => __( 'Szállítási mód engedélyezése' ),
     520                            'default'       => 'yes',
     521                        ),
     522                        'shipping_fee' => array(
     523                            'title'         => __( 'Szállítás összege' ),
     524                            'type'          => 'number',
     525                            'description'   => __( 'A vevőre terhelt szállítási díj' ),
     526                            'default'       => __( '0' ),
     527                            'desc_tip'      => true
     528                        )
     529                    );
     530                    $this->enabled              = $this->get_option( 'enabled' );
     531                    $this->title                = 'Automata (GLS)';
    401532
    402533                    add_action( 'woocommerce_update_options_shipping_' . $this->id, array( $this, 'process_admin_options' ) );
     
    458589    }
    459590
     591    if(strpos($chosen_method_id,"fuvarhu_aut_gls") !== false){
     592        $selected = "aut";
     593    }
     594
     595    if(strpos($chosen_method_id,"fuvarhu_csp_gls") !== false){
     596        $selected = "csp";
     597    }
     598
    460599    if($selected != "haz" && ($selected == "pos" || $selected == "csp" || $selected = "pop" || $selected = "aut")){
    461600        if(!isset($_POST['pickup_store']) || empty($_POST['pickup_store'])){
     
    521660
    522661        $packli_service_id = [11];
     662    }
     663
     664    if(strpos($chosen_method_id,"fuvarhu_aut_gls") !== false){
     665        $selected = "aut";
     666        $provider = "gls";
     667        $show_for = "fuvarhu_aut_gls";
     668
     669        $packli_service_id = [14];
     670    }
     671
     672    if(strpos($chosen_method_id,"fuvarhu_csp_gls") !== false){
     673        $selected = "csp";
     674        $provider = "gls";
     675        $show_for = "fuvarhu_csp_gls";
     676
     677        $packli_service_id = [13];
    523678    }
    524679
  • fuvar-hu-api/trunk/readme.txt

    r3435026 r3484903  
    44Requires at least: 5.6.1
    55Tested up to: 6.1
    6 Stable tag: 3.0.2
     6Stable tag: 3.0.3
    77Requires PHP: 8.1
    88License: GPLv2 or later
Note: See TracChangeset for help on using the changeset viewer.