Plugin Directory

Changeset 3051056


Ignore:
Timestamp:
03/14/2024 12:50:21 PM (2 years ago)
Author:
fuvarhu
Message:

Change names on shippings and add dpd method

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

Legend:

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

    r3030545 r3051056  
    55      Plugin URI: https://uzlet.fuvar.hu
    66      description: Fuvar.hu B2B Rendszer api
    7       Version: 1.4.2
     7      Version: 1.4.3
    88      Author: Fuvar.hu
    99      License: GPL2
  • fuvar-hu-api/trunk/inc/export.php

    r3030544 r3051056  
    8181
    8282            if(isset($geocode["status"]) && $geocode["status"] == "OK"){
    83                 $elements = [];
     83                $elements = ['street_number' => '', 'locality' => '', 'route' => ''];
    8484                foreach ($geocode["results"][0]["address_components"] as $key => $value) {
    8585                    $elements[$value["types"][0]] = $value["long_name"];
  • fuvar-hu-api/trunk/inc/shipping_method.php

    r2884491 r3051056  
    33add_filter( 'woocommerce_shipping_methods', 'fuvarhu_registerfuvarhu_method' );
    44function fuvarhu_registerfuvarhu_method( $methods ) {
     5    $methods[ 'fuvarhu_hazhozdpd' ] = 'WC_Shipping_fuvarhu_HAZ_DPD';
    56    $methods[ 'fuvarhu_hazhoz' ] = 'WC_Shipping_fuvarhu_HAZ';
    67    $methods[ 'fuvarhu_pop' ] = 'WC_Shipping_fuvarhu_POP';
     
    7677                    $this->id                    = 'fuvarhu_hazhoz';
    7778                    $this->instance_id           = absint( $instance_id );
    78                     $this->method_title          = __( 'Fuvar.hu - Házhoz szállítás' );
    79                     $this->method_description    = __( 'Házhozszállítás a Fuvar vagy szerződött partnerei által' );
    80                     $this->supports              = array(
    81                         'shipping-zones',
    82                         'instance-settings',
    83                     );
    84                     $this->instance_form_fields = array(
    85                         'enabled' => array(
    86                             'title'         => __( 'Engedélyezve' ),
    87                             'type'          => 'checkbox',
    88                             'label'         => __( 'Szállítási mód engedélyezése' ),
    89                             'default'       => 'yes',
    90                         ),
    91                         'shipping_fee' => array(
    92                             'title'         => __( 'Szállítás összege' ),
    93                             'type'          => 'number',
    94                             'description'   => __( 'A vevőre terhelt szállítási díj' ),
    95                             'default'       => __( '0' ),
    96                             'desc_tip'      => true
    97                         )
    98                     );
    99                     $this->enabled              = $this->get_option( 'enabled' );
    100                     $this->title                = 'Házhoz szállítás a Fuvarral';
     79                    $this->method_title          = __( 'Fuvar.hu - Házhoz szállítás (MPL)' );
     80                    $this->method_description    = __( 'Házhozszállítás a Fuvar.hu szerződött partnere által' );
     81                    $this->supports              = array(
     82                        'shipping-zones',
     83                        'instance-settings',
     84                    );
     85                    $this->instance_form_fields = array(
     86                        'enabled' => array(
     87                            'title'         => __( 'Engedélyezve' ),
     88                            'type'          => 'checkbox',
     89                            'label'         => __( 'Szállítási mód engedélyezése' ),
     90                            'default'       => 'yes',
     91                        ),
     92                        'shipping_fee' => array(
     93                            'title'         => __( 'Szállítás összege' ),
     94                            'type'          => 'number',
     95                            'description'   => __( 'A vevőre terhelt szállítási díj' ),
     96                            'default'       => __( '0' ),
     97                            'desc_tip'      => true
     98                        )
     99                    );
     100                    $this->enabled              = $this->get_option( 'enabled' );
     101                    $this->title                = 'Házhoz szállítás (MPL)';
     102
     103                    add_action( 'woocommerce_update_options_shipping_' . $this->id, array( $this, 'process_admin_options' ) );
     104                }
     105
     106                public function calculate_shipping( $package = array() ) {
     107                    $this->add_rate( array(
     108                        'id'    => $this->id . $this->instance_id,
     109                        'label' => $this->title,
     110                        'cost'  => $this->get_option('shipping_fee'),
     111                    ) );
     112                }
     113        }
     114    }
     115
     116    if(!class_exists("WC_Shipping_fuvarhu_HAZ_DPD")){
     117            class WC_Shipping_fuvarhu_HAZ_DPD extends WC_Shipping_Method {
     118                public function __construct( $instance_id = 0 ) {
     119                    $this->id                    = 'fuvarhu_hazhoz_dpd';
     120                    $this->instance_id           = absint( $instance_id );
     121                    $this->method_title          = __( 'Fuvar.hu - Házhoz szállítás (DPD)' );
     122                    $this->method_description    = __( 'Házhozszállítás a Fuvar.hu szerződött partnere által' );
     123                    $this->supports              = array(
     124                        'shipping-zones',
     125                        'instance-settings',
     126                    );
     127                    $this->instance_form_fields = array(
     128                        'enabled' => array(
     129                            'title'         => __( 'Engedélyezve' ),
     130                            'type'          => 'checkbox',
     131                            'label'         => __( 'Szállítási mód engedélyezése' ),
     132                            'default'       => 'yes',
     133                        ),
     134                        'shipping_fee' => array(
     135                            'title'         => __( 'Szállítás összege' ),
     136                            'type'          => 'number',
     137                            'description'   => __( 'A vevőre terhelt szállítási díj' ),
     138                            'default'       => __( '0' ),
     139                            'desc_tip'      => true
     140                        )
     141                    );
     142                    $this->enabled              = $this->get_option( 'enabled' );
     143                    $this->title                = 'Házhoz szállítás (DPD)';
    101144
    102145                    add_action( 'woocommerce_update_options_shipping_' . $this->id, array( $this, 'process_admin_options' ) );
  • fuvar-hu-api/trunk/readme.txt

    r3030544 r3051056  
    44Requires at least: 5.6.1
    55Tested up to: 6.1
    6 Stable tag: 1.4.2
     6Stable tag: 1.4.3
    77Requires PHP: 7.4
    88License: GPLv2 or later
Note: See TracChangeset for help on using the changeset viewer.