Changeset 2961017
- Timestamp:
- 08/31/2023 08:38:14 AM (3 years ago)
- Location:
- wc-nova-poshta-for-shop/trunk
- Files:
-
- 7 edited
-
Classes/CheckoutField.php (modified) (1 diff)
-
Classes/NovaPoshtaAdapter.php (modified) (2 diffs)
-
Classes/Shortcode.php (modified) (1 diff)
-
assets_file/css/style.css (modified) (3 diffs)
-
nova_poshta_for_woocommerce.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
-
views/settings.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wc-nova-poshta-for-shop/trunk/Classes/CheckoutField.php
r2461744 r2961017 9 9 10 10 function npfw_add_to_wooc_fields( $fields ) { 11 $options = get_option( ' my_option_name' );11 $options = get_option( 'npfw_my_option_name' ); 12 12 $enable_loader = !(empty($options['enable_loader'])) ? 'is-loader' : ''; 13 13 $class_warehouses_wrapper = !empty($options['class_warehouses_wrapper']) ? $options['class_warehouses_wrapper'] : ''; 14 14 $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 39 16 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 } 54 57 55 58 -
wc-nova-poshta-for-shop/trunk/Classes/NovaPoshtaAdapter.php
r2956550 r2961017 8 8 9 9 public function __construct() { 10 $this->$options = get_option( 'my_option_name' );10 // $this->$options = get_option( 'my_option_name' ); 11 11 $this->server_url = 'https://api.novaposhta.ua/v2.0/json/'; 12 12 $this->Parser = new NPFW_Parser(); … … 57 57 $resultParse = $this->Parser->npfw_parseJSON($result['body']); 58 58 59 $options = get_option( ' my_option_name' );59 $options = get_option( 'npfw_my_option_name' ); 60 60 $languague = !empty($options['languague']) ? $options['languague'] : ''; 61 61 $enable_loader = !empty($options['enable_loader']) ? 'is-laoder' : ''; -
wc-nova-poshta-for-shop/trunk/Classes/Shortcode.php
r2461744 r2961017 6 6 7 7 function npfw_shortcode_output($html_field) { 8 $options = get_option( ' my_option_name' );8 $options = get_option( 'npfw_my_option_name' ); 9 9 $class_warehouses_select = !empty($options['class_warehouses_select']) ? $options['class_warehouses_select'] : ''; 10 10 $html = ''; -
wc-nova-poshta-for-shop/trunk/assets_file/css/style.css
r2956550 r2961017 10 10 content: ''; 11 11 right: 30px; 12 top: 50px;12 top: 40px; 13 13 width: 30px; 14 14 height: 30px; … … 26 26 width: 100%; 27 27 z-index: 99; 28 bottom: auto;28 top: 75px; 29 29 overflow: hidden; 30 30 } … … 47 47 cursor: pointer; 48 48 } 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 2 2 /** 3 3 * @package Shipping of Nova Poshta for WooCommerce 4 * @version 1.1. 34 * @version 1.1.4 5 5 */ 6 6 /* … … 9 9 Description: Підключення служби доставки Нова Пошта до вашого магазину (WooCommerce) 10 10 Author: Andriy Prots 11 Version: 1.1. 311 Version: 1.1.4 12 12 Text Domain: npfw 13 13 Domain Path: /languages … … 76 76 77 77 function npfw_register_setting() { 78 register_setting( 'npw_submenu-page', ' my_option_name' );78 register_setting( 'npw_submenu-page', 'npfw_my_option_name' ); 79 79 add_settings_section( 'section_id', '', '', 'npw_submenu-page' ); 80 80 … … 95 95 96 96 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';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'; 104 104 105 105 require_once('includes/enqueue-admin.php'); -
wc-nova-poshta-for-shop/trunk/readme.txt
r2956565 r2961017 7 7 Tested up to: 6.3 8 8 Requires PHP: 5.6 9 Stable tag: 1.1. 29 Stable tag: 1.1.4 10 10 License: GPLv2 or later 11 11 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 70 70 Fix bugs 71 71 Update version 72 73 = 1.1.4 = 74 Tested php to 8.1 -
wc-nova-poshta-for-shop/trunk/views/settings.php
r2956550 r2961017 10 10 do_settings_sections( 'npw_submenu-page' ); 11 11 12 $options = get_option( ' my_option_name' );12 $options = get_option( 'npfw_my_option_name' ); 13 13 $class_warehouses_select = !(empty($options['class_warehouses_select'])) ? $options['class_warehouses_select'] : ''; 14 14 $class_warehouses_wrapper = !(empty($options['class_warehouses_wrapper'])) ? $options['class_warehouses_wrapper'] : ''; … … 17 17 $region_send = !(empty($options['region_send'])) ? $options['region_send'] : ''; 18 18 $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 ?> 20 25 <div class="item_form_np"> 21 26 <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; ?>'> 23 28 </div> 24 29 25 30 <div class="item_form_np"> 26 31 <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']); ?>>Ukraine28 <input type="radio" name=" my_option_name[languague]" value="Ru" <?php checked('Ru', $options['languague']); ?>>Russian32 <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 29 34 </div> 30 35 <div class="item_form_np"> 31 36 <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 fields34 <input type="radio" name=" my_option_name[output_fields]" value="output_fields3" <?php checked('output_fields3', $options['output_fields']); ?>>Shortcode37 <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 35 40 </div> 36 41 37 42 <div class="item_form_np"> 38 43 <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' : ''; ?>> 40 45 </div> 41 46 … … 47 52 <div class="item_form_np"> 48 53 <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; ?>'> 50 55 </div> 51 56 <?/* <div class="item_form_np">
Note: See TracChangeset
for help on using the changeset viewer.