Plugin Directory

Changeset 3197499


Ignore:
Timestamp:
11/26/2024 02:21:15 PM (16 months ago)
Author:
eshoplogistic
Message:

В выгрузку добавлен DPD

Location:
eshoplogisticru/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • eshoplogisticru/trunk/Classes/Shipping/ExportFileds.php

    r3182461 r3197499  
    171171                        )
    172172                    )
     173                ),
     174            );
     175        }
     176
     177        if ( $name === 'dpd' ) {
     178            $result = array(
     179                'receiver' => array(
     180                    'email' => ''
     181                ),
     182                'order' => array(
     183                    'content' => '',
     184                    'costly' => '',
     185                    'combine_places' => array(
     186                        'apply' => '',
     187                        'dimensions' => '',
     188                        'weight' => ''
     189                    )
     190                ),
     191                'delivery' => array(
     192                    'produce_date' => '',
     193                    'produce_time' => '',
     194                    'tariff' => '',
    173195                ),
    174196            );
     
    454476        }
    455477
     478        if ( $name === 'dpd'){
     479            $eshopLogisticApi = new EshopLogisticApi( new WpHttpClient() );
     480            $tariffs          = $eshopLogisticApi->apiServiceTariffs( $name );
     481            $tariffs          = $tariffs->data();
     482            $optionsRepository = new OptionsRepository();
     483            $exportFormSettings = $optionsRepository->getOption('wc_esl_shipping_export_form');
     484            $date = new DateTime();
     485            $date->modify('+1 day');
     486            $produce_date = $date->format('Y-m-d');
     487            if ( isset( $shippingMethods['tariff'] ) ) {
     488                $selectedTariffCode = $shippingMethods['tariff']['code'];
     489                if ( isset( $tariffs[ $selectedTariffCode ] ) ) {
     490                    $value[ $selectedTariffCode ] = $tariffs[ $selectedTariffCode ];
     491                    unset( $tariffs[ $selectedTariffCode ] );
     492                    $tariffs = $value + $tariffs;
     493                }
     494            }
     495
     496            $result = array(
     497                'receiver' => array(
     498                    'email||text||Адрес электронной почты' => ''
     499                ),
     500                'order' => array(
     501                    'content||text||Содержимое отправления (что за товары)' => '',
     502                    'costly||checkbox||Флаг «Ценный груз»' => '',
     503                ),
     504                'order[combine_places]' => array(
     505                    'apply||checkbox||Объединить все грузовые места в одно' => ($exportFormSettings['combine-places-apply'] == 'on')?'checked':'',
     506                    'dimensions||text||Габариты итогового грузового места (Д*Ш*В)' => ($exportFormSettings['combine-places-dimensions'])??'',
     507                    'weight||text||Вес итогового грузового места в кг' => ($exportFormSettings['combine-places-weight'])??''
     508                ),
     509                'delivery' => array(
     510                    'produce_date||date||Дата приёма груза' => $produce_date,
     511                    'produce_time||text||Интервал времени приёма груза (Пример: 9-18)' => '',
     512                    'tariff||select||Тариф' => $tariffs,
     513                ),
     514            );
     515        }
     516
    456517        return $result;
    457518    }
  • eshoplogisticru/trunk/Modules/Unloading.php

    r3182966 r3197499  
    404404            'Магнит Пост'     => 'magnit',
    405405            'Байкал Сервис'   => 'baikal',
     406            'DPD'   => 'dpd',
    406407            'Фулфилмент-оператор «Почтальон»'   => 'pochtalion',
    407408        );
  • eshoplogisticru/trunk/readme.txt

    r3196637 r3197499  
    44Requires at least: 5.3
    55Tested up to: 6.6
    6 Stable tag: 2.1.39
     6Stable tag: 2.1.40
    77License: GPLv2
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • eshoplogisticru/trunk/wc-eshop-logistic.php

    r3196637 r3197499  
    66 *
    77 * @link              https://wp.eshoplogistic.ru/
    8  * @since             2.1.39
     8 * @since             2.1.40
    99 * @package           WC_Eshop_Logistic
    1010 *
     
    1313 * Plugin URI:        https://wp.eshoplogistic.ru/
    1414 * Description:       Несколько служб доставки в одной интеграции: CDEK, DPD, Boxberry, IML, Почта России, Деловые Линии, ПЭК, Dostavista, GTD, Байкал Сервис и др.
    15  * Version:           2.1.39
     15 * Version:           2.1.40
    1616 * Author:            eShopLogistic
    1717 * Author URI:        https://eshoplogistic.ru/p747575
     
    4141define( 'WC_ESL_PLUGIN_DIR', plugin_dir_path(__FILE__) );
    4242
    43 define( 'WC_ESL_VERSION', '2.1.39' );
     43define( 'WC_ESL_VERSION', '2.1.40' );
    4444
    4545define( 'WC_ESL_DOMAIN', 'wc-esl' );
Note: See TracChangeset for help on using the changeset viewer.