Plugin Directory

Changeset 2399263


Ignore:
Timestamp:
10/14/2020 08:59:30 AM (5 years ago)
Author:
invelity
Message:

css fixes
added notification after install
renamed default shipping method
fixed notices

Location:
invelity-gls-parcelshop/trunk
Files:
6 added
8 edited

Legend:

Unmodified
Added
Removed
  • invelity-gls-parcelshop/trunk/README.txt

    r2394221 r2399263  
    4343= 1.0.0 =
    4444* Plugin Release
     45
     46= 1.0.1 =
     47* Plugin Release
     48css fixes
     49added notification after install
     50renamed default shipping method
     51fixed notices
  • invelity-gls-parcelshop/trunk/admin/class.InvelityGlsParcelShopAdmin.php

    r2394221 r2399263  
    2222    }
    2323
     24    public function enqueueStyles(){
     25
     26    }
    2427
    2528    public function customAdminNotices()
     
    2831        global $pagenow;
    2932
    30         if ($pagenow == 'admin.php' && $_GET['page'] == 'wc-settings' && $_GET['tab'] == 'shipping') {
     33        if (isset($_GET['tab'])) {
     34            if ($pagenow == 'admin.php' && $_GET['page'] == 'wc-settings' && $_GET['tab'] == 'shipping') {
    3135
    32             global $wpdb;
    33             $table_name = $wpdb->prefix . 'inv_gls_parcel_shop';
    34             $result = $wpdb->get_results('SELECT * FROM ' . $table_name . '');
    35             if (!$result) {
    36                 echo "<div class=\"error\">";
    37                 echo "<p>'Chyba pri aktualizovaní pobočiek GlsParcelShop'</p>";
    38                 echo "</div>";
     36                global $wpdb;
     37                $table_name = $wpdb->prefix . 'inv_gls_parcel_shop';
     38                $result = $wpdb->get_results('SELECT * FROM ' . $table_name . '');
     39                if (!$result) {
     40                    echo "<div class=\"error\">";
     41                    echo "<p>'Chyba pri aktualizovaní pobočiek GlsParcelShop'</p>";
     42                    echo "</div>";
    3943
    40             }else{
    41                 echo "<div class=\"success\">";
    42                 echo "<p>'Pobočky GlsParcelShop pridané'</p>";
    43                 echo "</div>";
     44                } else {
     45                    echo "<div class=\"success\">";
     46                    echo "<p>'Pobočky GlsParcelShop pridané'</p>";
     47                    echo "</div>";
     48                }
     49
    4450            }
    45 
    4651        }
    4752    }
  • invelity-gls-parcelshop/trunk/includes/WC_Gls_Parcel_Shop_Shipping_Method.php

    r2394221 r2399263  
    5252                        'type'          => 'text',
    5353                        'description'   => __( 'This controls the title which the user sees during checkout.', 'woocommerce' ),
    54                         'default'       => __( 'Custom Shipping Method', 'woocommerce' ),
     54                        'default'       => __( 'GLS ParcelShop', 'woocommerce' ),
    5555                    ),
    5656
  • invelity-gls-parcelshop/trunk/includes/class.InvelityGlsParcelShop.php

    r2394221 r2399263  
    2727        $this->loadDependencies();
    2828        $this->setLocale();
    29         $this->defineAdminHooks();
    3029        $this->definePublicHooks();
    3130        $this->addShippingMethod();
     
    6261    }
    6362
    64 
    65     private function defineAdminHooks()
    66     {
    67 
    68         $plugin_admin = new InvelityGlsParcelShopAdmin($this->getPluginName(), $this->getVersion());
    69 
    70 
    71         $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueueStyles');
    72         $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueueScripts');
    73 
    74     }
    7563
    7664
  • invelity-gls-parcelshop/trunk/invelity-gls-parcelshop.php

    r2394221 r2399263  
    88Author: Invelity
    99Author URI: https://www.invelity.com
    10 Version: 1.0.0
     10Version: 1.0.1
    1111*/
    1212
     
    8888}
    8989
    90 
    9190add_action ('invelityGlsParcelShopCron', 'invelityGlsParcelShopCronJobAction');
    9291
     92
     93
     94function activateInvelityGlsParcelShopPluginShowMessage() {
     95    set_transient( 'invelity-admin-message-gls-parcelshop', true, 5 );
     96}
     97
     98add_action( 'admin_notices', 'invelityAdminMessageGlsParcelshop' );
     99
     100function invelityAdminMessageGlsParcelshop(){
     101
     102    if( get_transient( 'invelity-admin-message-gls-parcelshop' ) ){
     103        ?>
     104        <div class="updated notice is-dismissible">
     105            <p>Plugin úspešne nainštalovaný.Pridajte GLS ParcelShop<a href="<?= admin_url()?>admin.php?page=wc-settings&tab=shipping"> dopravnú metódu</a>.</p>
     106        </div>
     107        <?php
     108        delete_transient( 'invelity-admin-message-gls-parcelshop' );
     109    }
     110}
     111
    93112register_activation_hook(__FILE__, 'activateInvelityGlsParcelShopPlugin');
     113register_activation_hook( __FILE__, 'activateInvelityGlsParcelShopPluginShowMessage' );
    94114register_deactivation_hook(__FILE__, 'deactivateInvelityGlsParcelShopPlugin');
    95115register_deactivation_hook (__FILE__, 'invelityGlsParcelShopCronDeactivation');
  • invelity-gls-parcelshop/trunk/public/class.InvelityGlsParcelShopPublic.php

    r2394221 r2399263  
    2424                    if (WC()->session->chosen_shipping_methods[0] == 'inv_gls_parcel_shop') {
    2525                        ?>
    26                         <img src="<?= plugin_dir_url(__FILE__) ?>img/gls-logo.png" style="width: 50px;height: auto">
    27                         <br>
    28                         <a id="gls_parcel_shop_map_init" class="gls_parcel_shop_map_init">Vybrať pobočku</a>
    29                         <span id="inv_gls_parcel_shop_picked_shop_name"></span>
    30                         <input type="hidden" name="inv_gls_picked_shop_id" value="">
    31                         <input type="hidden" name="inv_gls_picked_shop_name" value="">
    32                         <input type="hidden" name="inv_gls_picked_shop_address" value="">
     26                        <div class="invelity-gls-parcelshop-box">
     27                            <div>
     28                                <img src="<?= plugin_dir_url(__FILE__) ?>img/gls-logo.png"
     29                                     style="width: 50px;height: auto">
     30                                <a id="gls_parcel_shop_map_init" class="gls_parcel_shop_map_init">Vybrať pobočku</a>
     31                            </div>
     32                            <div>
     33                                <span id="inv_gls_parcel_shop_picked_shop_name"></span>
     34                                <input type="hidden" name="inv_gls_picked_shop_id" value="">
     35                                <input type="hidden" name="inv_gls_picked_shop_name" value="">
     36                                <input type="hidden" name="inv_gls_picked_shop_address" value="">
     37                            </div>
     38                        </div>
    3339                        <?php
    3440                    }
     
    4955        add_action('woocommerce_checkout_update_order_meta', [$this, 'updateOrderMetaParcelShopInformations'], 15, 2);
    5056        add_action('wp_ajax_invGlsParcelShopOpenMap', [$this, 'invGlsParcelShopOpenMap']);
     57        add_action('wp_ajax_nopriv_invGlsParcelShopOpenMap', [$this, 'invGlsParcelShopOpenMap']);
    5158
    5259
     
    141148
    142149        <?php
    143        echo ob_get_clean();
     150        echo ob_get_clean();
    144151        wp_die();
    145152
     
    168175            wp_localize_script($this->plugin_name, 'inv_globals', [
    169176                'pluginUrl' => plugin_dir_url(__FILE__),
    170                 'ajax_url' => admin_url( 'admin-ajax.php' ),
     177                'ajax_url' => admin_url('admin-ajax.php'),
    171178            ]);
    172179        }
     
    192199            $saniteText = sanitize_text_field($_POST['inv_gls_picked_shop_id']);
    193200
    194             if (!empty($saniteText) ){
     201            if (!empty($saniteText)) {
    195202
    196203                global $wpdb;
  • invelity-gls-parcelshop/trunk/public/css/invelity-gls-parcel-shop-public.css

    r2394221 r2399263  
    55.gls_parcel_shop_map_init {
    66    cursor: pointer;
    7 }
     7    margin-left: 10px;
     8}
     9
    810
    911#big-canvas {
     
    2123
    2224.inv_gls_parcelshop_map {
    23     height: 650px;
     25    height: 700px;
    2426    width: 650px;
     27    max-height: 100%;
    2528}
    2629
     
    3235}
    3336
     37.invelity-gls-parcelshop-box{
     38    display: flex;
     39    flex-direction: column;
     40    flex-wrap:wrap;
     41    justify-content: space-evenly;
     42    align-content: flex-end;
     43    align-items: center;
     44}
     45.invelity-gls-parcelshop-box >div:first-of-type{
     46    display: flex;
     47    align-items: center;
     48}
     49
     50
    3451.inv_gls_parcelshop_map_section_container {
    3552    float: left;
    3653    width: 70%;
    3754    display: block;
    38     height: 650px;
     55    height: 100%;
     56    display: flex;
    3957}
    4058
     
    6482    z-index: 100001;
    6583    width: 100%;
    66     height: 100%;
     84    height: 80vh;
    6785    top: 0px;
    6886    left: 0px;
     
    7391    max-height: initial;
    7492    overflow: hidden;
    75     top: 10%;
     93    top: 5vh;
    7694    margin: 0 auto;
    7795    padding-top: 45px
    7896}
    79 
     97.inv_gls_parcelshop_list_shops_wrapper{
     98    overflow-y: scroll;
     99    overflow-x: hidden;
     100}
    80101.inv_gls_parcelshop_pop_up_wrapper .inv_gls_parcelshop_pop_up_container {
    81102    display: none;
     
    100121    vertical-align: middle;
    101122    width: 100%;
     123    height: 100%;
     124    display: flex;
    102125}
    103126
     
    113136    padding-right: 1em;
    114137    border-top: 5px solid #fdc344;
     138    display: flex;
     139    height: 100%;
     140    flex-direction: column;
    115141}
    116142
     
    122148
    123149.inv_gls_parcelshop_pop-up_list h6 {
    124     font-size: 20px;
    125     color: #333;
    126     font-weight: 600;
     150    font-size: 18px!important;
     151    color: #333!important;
     152    font-weight: 600!important;
    127153    margin-top: 0.5em;
    128154    margin-bottom: 0.5em;
    129155    margin-left: 2em;
     156    width:80%;
     157    text-transform: none;
    130158}
    131159
     
    173201    margin: 0;
    174202    height: 415px;
    175     overflow-y: scroll;
    176203    margin-bottom: 10px;
    177204
     205}
     206.checkbox-custom-label{
     207    display: flex;
    178208}
    179209
     
    184214    padding: 0.5em;
    185215    padding-left: 2em;
     216    margin-bottom: 0px!important;
    186217}
    187218
     
    374405    display: -webkit-box;
    375406    display: -ms-flexbox;
    376     display: flex;
     407    display: flex!important;
    377408    -webkit-box-align: center;
    378409    -ms-flex-align: center;
     
    387418    opacity: 0;
    388419    width: 0px;
     420    margin:0!important;
     421    display: none;
    389422}
    390423
     
    393426    display: block;
    394427    font-size: 12px;
     428    text-align: left;
    395429}
    396430
     
    511545        height: 150px;
    512546    }
    513 
    514 }
     547    .inv_gls_parcelshop_pop_up_wrapper .inv_gls_parcelshop_pop_up_container{
     548        flex-direction: column;
     549    }
     550    .inv_gls_parcelshop_list_shop{
     551        padding-bottom: 0px;
     552    }
     553
     554    .inv_gls_parcelshop_map_container{
     555        height: 250px;
     556        max-height: 100%;
     557    }
     558    .inv_gls_parcelshop_pop-up_list h6{
     559        font-size:15px!important;
     560    }
     561    .inv_gls_parcelshop_pop-up_list{
     562        margin-bottom:10px;
     563    }
     564
     565}
  • invelity-gls-parcelshop/trunk/public/js/invelity-gls-parcel-shop-public.js

    r2394221 r2399263  
    196196
    197197    function mapPopUpClose() {
     198        $('body').css('overflow', 'auto');
     199        $('html').css('overflow-x', 'auto');
    198200        $('#inv_gls_map_init_container').removeClass('show');
    199201    }
     
    209211            cache: false,
    210212            success: function (result) {
     213                $('body').css('overflow', 'hidden');
     214                $('html').css('overflow-x', 'inherit');
    211215                $("#inv_gls_map_init_container").html(result);
    212216                $('#inv_gls_map_init_container').addClass('show');
Note: See TracChangeset for help on using the changeset viewer.