Plugin Directory

Changeset 2849665


Ignore:
Timestamp:
01/17/2023 09:48:56 AM (3 years ago)
Author:
optimum7
Message:

v1.5.9

Location:
ffl-api/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • ffl-api/trunk/README.txt

    r2723338 r2849665  
    66Tags: FFL, eCommerce checkout, WooCommerce, FFL gun dealers, map api, google maps, gun dealer
    77Requires at least: 5.0
    8 Tested up to: 6.0
     8Tested up to: 6.1.1
    99Requires PHP: 7.0
    1010Stable tag: 1.5
     
    183183
    184184== Changelog ==
     185v1.5.9 Added FFL info pop-up visibility option
    185186v1.5.8 FFL map issue solved
    186187v1.5.7 Special character usage bug solved at Firearm Warning Message
  • ffl-api/trunk/admin/class-ffl-api-admin.php

    r2250737 r2849665  
    149149        register_setting('ffl-api-settings', 'ffl_list_text_option');
    150150        register_setting('ffl-api-settings', 'ffl_init_map_location');
     151        register_setting('ffl-api-settings', 'ffl_map_show_modal', ['default' => 'yes']);
    151152    }
    152153
     
    184185                            <td><input type="text" style="width: 30%" name="ffl_api_gmaps_option"
    185186                                       value="<?php echo esc_attr(get_option('ffl_api_gmaps_option')); ?>"/>
     187                            </td>
     188                        </tr>
     189
     190                        <tr valign="top">
     191                            <th scope="row">Warning Message Modal</th>
     192
     193                            <td>
     194                                <select name="ffl_map_show_modal">
     195                                    <?php
     196                                    $selects = Array(
     197                                        'yes' => 'Show',
     198                                        'no' => 'Hide'
     199                                    );
     200                                    foreach ($selects as $val => $key) {
     201                                        echo '<option value="' . $val . '" ';
     202                                        if (get_option('ffl_map_show_modal') == $val) {
     203                                            echo 'selected="selected" ';
     204                                        }
     205                                        echo '> ' . $key . '</option>';
     206                                    }
     207                                    ?>
     208                                </select>
     209                                <p id="warnHelp" class="form-text text-muted"></p>
    186210                            </td>
    187211                        </tr>
  • ffl-api/trunk/ffl-api.php

    r2715899 r2849665  
    1717 * Plugin URI:        fflapi.com
    1818 * Description:       FFL API Woocommerce plugin
    19  * Version:           1.5.8
     19 * Version:           1.5.9
    2020 * WC requires at least: 3.0.0
    2121 * WC tested up to:   4.0
     
    4848 * Rename this for your plugin and update it as you release new versions.
    4949 */
    50 define('FFL_API_VERSION', '1.5.8');
     50define('FFL_API_VERSION', '1.5.9');
    5151
    5252/**
  • ffl-api/trunk/public/class-ffl-api-public.php

    r2691364 r2849665  
    126126                $_parent_product = wc_get_product($_product->get_data()['parent_id']);
    127127                $firearm = $_parent_product->get_meta('_firearm_product');
     128               
    128129            } else {
    129130                $firearm = $_product->get_meta('_firearm_product');
     
    149150        $gKey = esc_attr(get_option('ffl_api_gmaps_option'));
    150151        $wMes = get_option('ffl_api_warning_message') != '' ? get_option('ffl_api_warning_message') : 'You have chosen your address as a shipping address for a firearm product. Unfortunately, we are not able to ship the firearms directly to your address. Please select the closest FFL from the map using your zip code.';
    151 
     152        $showModal = get_option('ffl_map_show_modal',true);
    152153        $hok = get_option('ffl_init_map_location');
    153154        echo '<div id="ffl_container"></div>';
     
    159160    let wMes = `' . $wMes . '`
    160161    let hok = "' . $hok . '"
     162    let showModal = "' . $showModal . '"
    161163   
    162164    localStorage.removeItem("selectedFFL");
     
    164166    if(!document.getElementById("ffl-zip-code")) {
    165167        document.addEventListener("DOMContentLoaded", function() {
    166             initFFLJs(aKey,gKey,wMes,hok);
     168            initFFLJs(aKey,gKey,wMes,hok,showModal);
    167169        });
    168170    }
  • ffl-api/trunk/public/js/ffl-api-public.js

    r2715899 r2849665  
    1 function initFFLJs(fKey,gKey,message,hook) {
     1function initFFLJs(fKey,gKey,message,hook,showModal) {
    22
    33    if(hook === "woocommerce_before_checkout_billing_form") {
     
    2626        jQuery("#modalFFL").css('display','none');
    2727    });
     28   
     29    if(showModal == "no"){
     30        jQuery("#modalFFL").css('display','none');
     31    }
    2832
    2933    jQuery('.woocommerce-shipping-fields__field-wrapper').find('input').val(null);
Note: See TracChangeset for help on using the changeset viewer.