Plugin Directory

Changeset 3179911


Ignore:
Timestamp:
11/01/2024 11:54:59 AM (17 months ago)
Author:
eshoplogistic
Message:

Добавлен Магнит Пост

Location:
eshoplogisticru/trunk
Files:
1 added
8 edited

Legend:

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

    r3166450 r3179911  
    120120                'order' => array(
    121121                    'packing' => ''
     122                )
     123            );
     124        }
     125
     126        if ( $name === 'magnit' ) {
     127            $result = array(
     128                'receiver' => array(
     129                    'last_name' => ''
     130                ),
     131                'order' => array(
     132                    'combine_places' => array(
     133                        'apply' => '',
     134                        'dimensions' => '',
     135                        'weight' => ''
     136                    )
    122137                )
    123138            );
     
    335350        }
    336351
     352        if ( $name === 'magnit' ) {
     353            $optionsRepository = new OptionsRepository();
     354            $exportFormSettings = $optionsRepository->getOption('wc_esl_shipping_export_form');
     355            $result = array(
     356                'receiver' => array(
     357                    'last_name||text||Фамилия получателя' => ''
     358                ),
     359                'order[combine_places]' => array(
     360                    'apply||checkbox||Объединить все грузовые места в одно' => ($exportFormSettings['combine-places-apply'] == 'on')?'checked':'',
     361                    'dimensions||text||Габариты итогового грузового места (Д*Ш*В)' => ($exportFormSettings['combine-places-dimensions'])??'',
     362                    'weight||text||Вес итогового грузового места в кг' => ($exportFormSettings['combine-places-weight'])??''
     363                ),
     364            );
     365        }
     366
    337367        return $result;
    338368    }
  • eshoplogisticru/trunk/Modules/Ajax.php

    r3149256 r3179911  
    7373        add_action('wp_ajax_wc_esl_shipping_save_status_form', [$this, 'unloadingStatus']);
    7474        add_action('wp_ajax_wc_esl_shipping_unloading_status_update', [$this, 'unloadingStatusUpdate']);
     75        add_action('wp_ajax_wc_esl_shipping_unloading_delete', [$this, 'unloadingDelete']);
     76
    7577    }
    7678
     
    608610    }
    609611
     612    public function unloadingDelete()
     613    {
     614        if(!isset($_POST['order_id']))
     615            return false;
     616        if(!isset($_POST['order_type']))
     617            return false;
     618
     619
     620        $unloading = new Unloading();
     621        $result = $unloading->infoOrder($_POST['order_id'], $_POST['order_type'], 'delete');
     622
     623        wp_send_json([
     624            'success' => true,
     625            'data' => $result,
     626            'msg' => __("Удаление заказа для выгрузки", WC_ESL_DOMAIN)
     627        ]);
     628    }
     629
    610630    public function unloadingInfo()
    611631    {
  • eshoplogisticru/trunk/Modules/Unloading.php

    r3150114 r3179911  
    401401            'Почта России'    => 'postrf',
    402402            'ПЭК'             => 'pecom',
     403            'Магнит Пост'     => 'magnit',
    403404        );
    404405
     
    600601    }
    601602
    602     public function infoOrder( $id, $type ) {
     603    public function infoOrder( $id, $type, $action = 'get' ) {
    603604
    604605        $optionsRepository = new OptionsRepository();
     
    617618        }
    618619
    619 
    620620        $data             = array(
    621621            'key'      => $apiKey,
    622             'action'   => 'get',
     622            'action'   => $action,
    623623            'order_id' => $id,
    624624            'service'  => $type
  • eshoplogisticru/trunk/assets/js/settings_unloading.js

    r3154034 r3179911  
    5252            }
    5353        },
     54        clickOnDelete: function (event) {
     55            let order_id = document.getElementById("order_info_id").value
     56            let order_type = document.getElementById("order_info_type").value
     57            const xhr = new XMLHttpRequest()
     58            xhr.open("POST", wc_esl_shipping_global.ajaxUrl);
     59            let params = 'action=wc_esl_shipping_unloading_delete&order_id='+order_id+'&order_type='+order_type;
     60            xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded')
     61            xhr.send(params)
     62            xhr.onload = () => {
     63                let obj = JSON.parse(xhr.responseText);
     64                console.log(obj)
     65            }
     66        },
    5467        clickOnStatusUpdate: function (event) {
    5568            let order_id = document.getElementById("order_info_id").value
     
    8093    let els_terminals_info = document.getElementById('esl_unloading_status')
    8194    els_terminals_info.addEventListener('click', bindEvents.clickOnInfo, false)
     95
     96    let els_terminals_delete = document.getElementById('esl_unloading_delete')
     97    if(els_terminals_delete)
     98        els_terminals_delete.addEventListener('click', bindEvents.clickOnDelete, false)
    8299
    83100    let els_terminals_status_update = document.getElementById('esl_unloading_status_update')
  • eshoplogisticru/trunk/readme.txt

    r3174318 r3179911  
    44Requires at least: 5.3
    55Tested up to: 6.6
    6 Stable tag: 2.1.34
     6Stable tag: 2.1.35
    77License: GPLv2
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • eshoplogisticru/trunk/views/settings.php

    r3166450 r3179911  
    974974                                            <div class="input-group">
    975975                                                <label for="" class="col-sm-4 col-form-label">
     976                                                    <?php echo __( 'Код терминала (Магнит Пост)', WC_ESL_DOMAIN ) ?>
     977                                                    <label>
     978                                                        <div class="help-tip">
     979                                                            <p>
     980                                                                Код терминала в случае самостоятельной доставки на
     981                                                                терминал транспортной компании.
     982                                                                Узнайте у своего менеджера.
     983                                                            </p>
     984                                                        </div>
     985                                                    </label>
     986                                                </label>
     987                                                <?php
     988                                                $sender_terminal = '';
     989                                                if ( isset( $export_form['sender-terminal-magnit'] ) ) {
     990                                                    $sender_terminal = $export_form['sender-terminal-magnit'];
     991                                                }
     992                                                ?>
     993                                                <input
     994                                                        type="text"
     995                                                        class="form-control"
     996                                                        placeholder="<?php echo __( 'Код терминала', WC_ESL_DOMAIN ) ?>"
     997                                                        name="sender-terminal-magnit"
     998                                                        class="col-sm-8"
     999                                                        value="<?php echo esc_attr( $sender_terminal ) ?>"
     1000                                                />
     1001                                            </div>
     1002                                            <div class="input-group">
     1003                                                <label for="" class="col-sm-4 col-form-label">
    9761004                                                    <?php echo __( 'Тип заказа (СДЭК)', WC_ESL_DOMAIN ) ?>
    9771005                                                </label>
  • eshoplogisticru/trunk/views/unloading-button.php

    r2930077 r3179911  
    2222    <span class="dashicons dashicons-update-alt"></span>
    2323</button>
     24<?php if(isset($_GET['eslD'])): ?>
     25<button type="button" id="esl_unloading_delete" class="button button-primary" title="Удалить выгрузку">
     26    <span class="dashicons dashicons-trash"></span>
     27</button>
     28<?php endif; ?>
  • eshoplogisticru/trunk/wc-eshop-logistic.php

    r3174318 r3179911  
    66 *
    77 * @link              https://wp.eshoplogistic.ru/
    8  * @since             2.1.34
     8 * @since             2.1.35
    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.34
     15 * Version:           2.1.35
    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.34' );
     43define( 'WC_ESL_VERSION', '2.1.35' );
    4444
    4545define( 'WC_ESL_DOMAIN', 'wc-esl' );
Note: See TracChangeset for help on using the changeset viewer.