Plugin Directory

Changeset 2961017


Ignore:
Timestamp:
08/31/2023 08:38:14 AM (3 years ago)
Author:
protport4991
Message:

tested php to 8.1

Location:
wc-nova-poshta-for-shop/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • wc-nova-poshta-for-shop/trunk/Classes/CheckoutField.php

    r2461744 r2961017  
    99
    1010    function npfw_add_to_wooc_fields( $fields ) {
    11         $options = get_option( 'my_option_name' );
     11        $options = get_option( 'npfw_my_option_name' );
    1212        $enable_loader              = !(empty($options['enable_loader'])) ? 'is-loader' : '';
    1313        $class_warehouses_wrapper   = !empty($options['class_warehouses_wrapper']) ? $options['class_warehouses_wrapper'] : '';
    1414        $class_warehouses_select    = !empty($options['class_warehouses_select']) ? $options['class_warehouses_select'] : '';
    15        
    16         if($options['output_fields'] == 'output_fields1'){
    17             $fields['billing']['billing_warehouses'] = array(
    18                 'type'      => 'select',
    19                 'options'   => array(
    20                     ''      => __('Please select warehouses','npfw')
    21                 ),
    22                 'label'     => __('Warehouses', 'npfw'),
    23                 'required'  => true,
    24                 'class'     => array($class_warehouses_wrapper),
    25                 'input_class' => array('billing_warehouses_sumoselect'.' '.$enable_loader.' '. $class_warehouses_select),
    26                 'clear'     => true,
    27                 'priority'  => 75
    28             );
    29         }
    30         else if($options['output_fields'] == 'output_fields2'){
    31             $fields['billing']['billing_np_city'] = array(
    32                 'label'     => __('City', 'npfw'),
    33                 'placeholder' => __('Please select city', 'npfw'),
    34                 'required'  => true,
    35                 'class'     => array('form-row-wide'),
    36                 'clear'     => true,
    37                 'priority'  => 190
    38             );
     15         
    3916
    40             $fields['billing']['billing_warehouses'] = array(
    41                 'type'      => 'select',
    42                 'placeholder' => __('Please select warehouses', 'npfw'),
    43                 'options'   => array(
    44                     ''      => __('Please select warehouses', 'npfw'),
    45                 ),
    46                 'label'     => __('Warehouses', 'npfw'),
    47                 'required'  => true,
    48                 'class'     => array($class_warehouses_wrapper),
    49                 'input_class' => array('billing_warehouses_sumoselect'.' '.$enable_loader.' '. $class_warehouses_select),
    50                 'clear'     => true,
    51                 'priority'  => 200
    52             );
    53         }
     17        if($options != '1' && !empty(get_option( 'npfw_my_option_name' ))){   
     18            if($options['output_fields'] == 'output_fields1'){
     19                $fields['billing']['billing_warehouses'] = array(
     20                    'type'      => 'select',
     21                    'options'   => array(
     22                        ''      => __('Please select warehouses','npfw')
     23                    ),
     24                    'label'     => __('Warehouses', 'npfw'),
     25                    'required'  => true,
     26                    'class'     => array($class_warehouses_wrapper),
     27                    'input_class' => array('billing_warehouses_sumoselect'.' '.$enable_loader.' '. $class_warehouses_select),
     28                    'clear'     => true,
     29                    'priority'  => 75
     30                );
     31            }
     32            else if($options['output_fields'] == 'output_fields2'){
     33                $fields['billing']['billing_np_city'] = array(
     34                    'label'     => __('City', 'npfw'),
     35                    'placeholder' => __('Please select city', 'npfw'),
     36                    'required'  => true,
     37                    'class'     => array('form-row-wide'),
     38                    'clear'     => true,
     39                    'priority'  => 190
     40                );
     41
     42                $fields['billing']['billing_warehouses'] = array(
     43                    'type'      => 'select',
     44                    'placeholder' => __('Please select warehouses', 'npfw'),
     45                    'options'   => array(
     46                        ''      => __('Please select warehouses', 'npfw'),
     47                    ),
     48                    'label'     => __('Warehouses', 'npfw'),
     49                    'required'  => true,
     50                    'class'     => array($class_warehouses_wrapper),
     51                    'input_class' => array('billing_warehouses_sumoselect'.' '.$enable_loader.' '. $class_warehouses_select),
     52                    'clear'     => true,
     53                    'priority'  => 200
     54                );
     55            }
     56        }
    5457
    5558       
  • wc-nova-poshta-for-shop/trunk/Classes/NovaPoshtaAdapter.php

    r2956550 r2961017  
    88   
    99    public function __construct() {
    10         $this->$options         = get_option( 'my_option_name' );
     10        // $this->$options         = get_option( 'my_option_name' );
    1111        $this->server_url       = 'https://api.novaposhta.ua/v2.0/json/';
    1212        $this->Parser           = new NPFW_Parser();
     
    5757            $resultParse = $this->Parser->npfw_parseJSON($result['body']);
    5858
    59             $options = get_option( 'my_option_name' );
     59            $options = get_option( 'npfw_my_option_name' );
    6060            $languague     = !empty($options['languague']) ? $options['languague'] : '';
    6161            $enable_loader = !empty($options['enable_loader']) ? 'is-laoder' : '';
  • wc-nova-poshta-for-shop/trunk/Classes/Shortcode.php

    r2461744 r2961017  
    66
    77    function npfw_shortcode_output($html_field) {
    8         $options = get_option( 'my_option_name' );
     8        $options = get_option( 'npfw_my_option_name' );
    99        $class_warehouses_select = !empty($options['class_warehouses_select']) ? $options['class_warehouses_select'] : '';
    1010        $html = '';
  • wc-nova-poshta-for-shop/trunk/assets_file/css/style.css

    r2956550 r2961017  
    1010    content: '';
    1111    right: 30px;
    12     top: 50px;
     12    top: 40px;
    1313    width: 30px;
    1414    height: 30px;
     
    2626    width: 100%;
    2727    z-index: 99;
    28     bottom: auto;
     28    top: 75px;
    2929    overflow: hidden;
    3030}
     
    4747    cursor: pointer;
    4848}
     49.sumo_billing_warehouses ul li{
     50    color: #666 !important;
     51    padding: 0px 8px;
     52}
     53.SumoSelect>.CaptionCont>span{
     54    line-height: 28px;
     55}
     56.SumoSelect>.CaptionCont{
     57    height: 40px;
     58}
     59.SumoSelect>.CaptionCont>label>i{
     60    display: none;
     61}
  • wc-nova-poshta-for-shop/trunk/nova_poshta_for_woocommerce.php

    r2956565 r2961017  
    22/**
    33 * @package Shipping of Nova Poshta for WooCommerce
    4  * @version 1.1.3
     4 * @version 1.1.4
    55 */
    66/*
     
    99Description: Підключення служби доставки Нова Пошта до вашого магазину (WooCommerce)
    1010Author: Andriy Prots
    11 Version: 1.1.3
     11Version: 1.1.4
    1212Text Domain: npfw
    1313Domain Path: /languages
     
    7676
    7777    function npfw_register_setting() {
    78         register_setting( 'npw_submenu-page', 'my_option_name' );
     78        register_setting( 'npw_submenu-page', 'npfw_my_option_name' );
    7979        add_settings_section( 'section_id', '', '', 'npw_submenu-page' );
    8080     
     
    9595
    9696
    97 include __DIR__ .'\Classes\Parser.php';
    98 include __DIR__ .'\Classes\View.php';
    99 include __DIR__ .'\Classes\API.php';
    100 include __DIR__ .'\Classes\NovaPoshtaAdapter.php';
    101 include __DIR__ .'\Classes\CheckoutField.php';
    102 include __DIR__ .'\Classes\Shortcode.php';
    103 include __DIR__ .'\Classes\DeliveryMethod.php';
     97include __DIR__ .'/Classes/Parser.php';
     98include __DIR__ .'/Classes/View.php';
     99include __DIR__ .'/Classes/API.php';
     100include __DIR__ .'/Classes/NovaPoshtaAdapter.php';
     101include __DIR__ .'/Classes/CheckoutField.php';
     102include __DIR__ .'/Classes/Shortcode.php';
     103include __DIR__ .'/Classes/DeliveryMethod.php';
    104104
    105105require_once('includes/enqueue-admin.php');
  • wc-nova-poshta-for-shop/trunk/readme.txt

    r2956565 r2961017  
    77Tested up to: 6.3
    88Requires PHP: 5.6
    9 Stable tag: 1.1.2
     9Stable tag: 1.1.4
    1010License: GPLv2 or later
    1111License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    7070Fix bugs
    7171Update version
     72
     73= 1.1.4 =
     74Tested php to 8.1
  • wc-nova-poshta-for-shop/trunk/views/settings.php

    r2956550 r2961017  
    1010        do_settings_sections(  'npw_submenu-page' );
    1111       
    12         $options = get_option( 'my_option_name' );
     12        $options = get_option( 'npfw_my_option_name' );
    1313        $class_warehouses_select    = !(empty($options['class_warehouses_select'])) ? $options['class_warehouses_select'] : '';
    1414        $class_warehouses_wrapper   = !(empty($options['class_warehouses_wrapper'])) ? $options['class_warehouses_wrapper'] : '';
     
    1717        $region_send                = !(empty($options['region_send'])) ? $options['region_send'] : '';
    1818        $city_sender                = !(empty($options['city_sender'])) ? $options['city_sender'] : '';
    19          ?>
     19        $api_key                    = !(empty($options['api_key'])) ? $options['api_key'] : '';
     20        $languague                  = !(empty($options['languague'])) ? $options['languague'] : '';
     21        $output_fields              = !(empty($options['output_fields'])) ? $options['output_fields'] : '';
     22
     23     
     24        ?>
    2025        <div class="item_form_np">
    2126            <label style="width: 220px; display: inline-block;"><?php _e('Api key','npfw'); ?></label>
    22             <input style="width: 260px;" type='text' name='my_option_name[api_key]' value='<?php echo $options['api_key']; ?>'>
     27            <input style="width: 260px;" type='text' name='npfw_my_option_name[api_key]' value='<?php echo $api_key; ?>'>
    2328        </div>
    2429       
    2530        <div class="item_form_np">
    2631            <label style="width: 220px; display: inline-block;"><?php _e('Select languague','npfw'); ?></label>
    27             <input type="radio" name="my_option_name[languague]" value="Ua" <?php checked('Ua', $options['languague']); ?>>Ukraine
    28             <input type="radio" name="my_option_name[languague]" value="Ru" <?php checked('Ru', $options['languague']); ?>>Russian
     32            <input type="radio" name="npfw_my_option_name[languague]" value="Ua" <?php checked('Ua', $languague); ?>>Ukraine
     33            <input type="radio" name="npfw_my_option_name[languague]" value="Ru" <?php checked('Ru', $languague); ?>>Russian
    2934        </div>
    3035        <div class="item_form_np">
    3136            <label style="width: 220px; display: inline-block;"><?php _e('Output fields','npfw'); ?></label>
    32             <input type="radio" name="my_option_name[output_fields]" value="output_fields1" <?php checked('output_fields1', $options['output_fields']); ?>>Standart (Woocommerce)
    33             <input type="radio" name="my_option_name[output_fields]" value="output_fields2" <?php checked('output_fields2', $options['output_fields']); ?>>Custom fields
    34             <input type="radio" name="my_option_name[output_fields]" value="output_fields3" <?php checked('output_fields3', $options['output_fields']); ?>>Shortcode
     37            <input type="radio" name="npfw_my_option_name[output_fields]" value="output_fields1" <?php checked('output_fields1', $output_fields); ?>>Standart (Woocommerce)
     38            <input type="radio" name="npfw_my_option_name[output_fields]" value="output_fields2" <?php checked('output_fields2', $output_fields); ?>>Custom fields
     39            <input type="radio" name="npfw_my_option_name[output_fields]" value="output_fields3" <?php checked('output_fields3', $output_fields); ?>>Shortcode
    3540        </div>
    3641
    3742        <div class="item_form_np">
    3843            <label style="width: 220px; display: inline-block;"><?php _e('Enable loader','npfw'); ?></label>
    39             <input type="checkbox" name="my_option_name[enable_loader]" value="1" <?php echo !empty($options['enable_loader']) ? 'checked' : ''; ?>>
     44            <input type="checkbox" name="npfw_my_option_name[enable_loader]" value="1" <?php echo !empty($options['enable_loader']) ? 'checked' : ''; ?>>
    4045        </div>
    4146
     
    4752        <div class="item_form_np">
    4853            <label style="width: 220px; display: inline-block;"><?php _e('Add html class to select warhouse','npfw'); ?></label>
    49             <input style="width: 260px;" type='text' name='my_option_name[class_warehouses_select]' value='<?php echo $city_sender; ?>'>
     54            <input style="width: 260px;" type='text' name='npfw_my_option_name[class_warehouses_select]' value='<?php echo $city_sender; ?>'>
    5055        </div>
    5156        <?/* <div class="item_form_np">
Note: See TracChangeset for help on using the changeset viewer.