Plugin Directory

Changeset 3445113


Ignore:
Timestamp:
01/22/2026 07:08:55 PM (2 months ago)
Author:
steadfastit
Message:

Show Courier Score Check Limit Message on Popup

Location:
steadfast-api
Files:
25 added
6 edited

Legend:

Unmodified
Added
Removed
  • steadfast-api/trunk/assets/admin/css/dashboard.css

    r3407125 r3445113  
    1111    padding: 25px 30px;
    1212    border-radius: 12px;
    13     box-shadow: 0 2px 4px rgb(16 168 16 / 44%), 0 4px 8px rgb(42 136 42 / 12%);
     13    box-shadow: 0 2px 4px rgb(255, 255, 255), 0 4px 8px rgb(255, 255, 255);
    1414    max-width: 550px;
    1515    margin: 20px auto;
     
    115115
    116116.tab-content.std-admin-menu {
    117     background: #f4f4f4;
    118     padding: 2px;
     117    background: #cfffda;
     118    padding: 10px;
    119119}
    120120
     121
     122.tab-content.std-admin-menu .submit .button-primary{
     123    background: #006400 !important;
     124    border-radius: 4px !important;
     125}
    121126
    122127a.nav-tab.nav-tab-active {
  • steadfast-api/trunk/assets/admin/js/scripts.js

    r3407125 r3445113  
    66
    77    var check = jQuery("#stdf_settings_tab_checkbox").is(':checked'),
    8         disableFieldCss = {'pointer-events': 'none', 'border': '1px solid lightcyan', 'color': 'lightgray'};
     8        disableFieldCss = { 'pointer-events': 'none', 'border': '1px solid lightcyan', 'color': 'lightgray' };
    99
    1010    if (check === true) {
     
    9797            success: function (response) {
    9898                if (response.data.message === 'success') {
    99                     thisField.css({'border': '1px solid #5b841b'});
     99                    thisField.css({ 'border': '1px solid #5b841b' });
    100100                }
    101101            }
     
    124124                    var data = response.data;
    125125                    if ('failed' === data) {
    126                         thisButton.html('Failed!').css({'width': '80px', 'background': '#ff3737', 'border': 'none', 'font-weight': '400', 'pointer-events': 'none'});
     126                        thisButton.html('Failed!').css({ 'width': '80px', 'background': '#ff3737', 'border': 'none', 'font-weight': '400', 'pointer-events': 'none' });
    127127                    } else if ('unauthorized' === data) {
    128                         thisButton.html('Unauthorized').css({'width': '99px', 'border': 'none', 'background': '#fb3c3ca8', 'font-weight': '400', 'pointer-events': 'none'});
     128                        thisButton.html('Unauthorized').css({ 'width': '99px', 'border': 'none', 'background': '#fb3c3ca8', 'font-weight': '400', 'pointer-events': 'none' });
    129129                    } else {
    130130                        showBalance.find(".balance").html(data + " TK");
    131131                        showBalance.removeClass("hidden");
    132                         thisButton.html('Balance').css({'background': '#3f9668', 'border': 'none', 'color': 'white', 'pointer-events': 'none'});
     132                        thisButton.html('Balance').css({ 'background': '#3f9668', 'border': 'none', 'color': 'white', 'pointer-events': 'none' });
    133133                    }
    134134                }
     
    140140    jQuery(document).on('click', "#std-delivery-status", function (e) {
    141141        e.preventDefault();
    142        
     142
    143143        var thisButton = jQuery(this),
    144144            consignmentID = thisButton.data("consignment-id"),
     
    212212
    213213        var statusButton = thisButton.siblings('span');
    214         statusButton.html('Checking..').css({'line-height': 'inherit'});
     214        statusButton.html('Checking..').css({ 'line-height': 'inherit' });
    215215
    216216        jQuery.ajax({
     
    258258        });
    259259    });
    260    
    261    
     260
     261
    262262    jQuery('.amount-disable').attr('disabled', 'disabled');
    263263    jQuery('.steadfast-send-success').html('Success').attr('disabled', 'disabled').addClass('tooltip');
     
    266266
    267267
    268    // Check Courier Score
     268// Check Courier Score
    269269jQuery(document).ready(function ($) {
    270270    var $modal = $('#stdf-customer-info-modal');
     
    290290
    291291            success: function (response) {
     292                console.log(response)
    292293                if (response.success) {
    293294                    let success_ratio = response.data.success_ratio;
    294                     var content = `
     295                    let errorMessage = response.data.error;
     296                    let current = response.data.current;
     297                    let limit = response.data.limit;
     298
     299                    if (errorMessage) {
     300                        content = `
     301                        <h2>Sorry!</h2>
     302                        <p>${errorMessage}</p>
     303                        <p><strong>Already Checked:</strong> ${current}</p>
     304                        <p><strong>Your Limit :</strong> ${limit}</p>
     305                    `;
     306                    } else {
     307                        var content = `
     308                        <h2>📊 SteadFast Success Rate</h2>
    295309                        <p><strong>📦Total Orders :</strong> ${response.data.total_parcels || 0}</p>
    296310                        <p><strong>✅Total Delivered :</strong> ${response.data.total_delivered || 0}</p>
    297311                        <p><strong>❌Total Cancelled:</strong> ${response.data.total_cancelled || 0}</p>
    298312                    `;
     313                    }
     314
    299315                    $('#stdf-customer-info-content').html(content);
    300316
  • steadfast-api/trunk/includes/class-admin-menu.php

    r3407125 r3445113  
    1515            add_action( 'admin_menu', array( $this, 'register_steadfast_admin_menu_page' ) );
    1616            add_action( 'admin_init', array( $this, 'register_admin_settings_fields' ) );
    17         }
     17
     18            add_action( 'admin_init',array($this,'remove_admin_notice'));
     19        }
     20
     21
     22        function remove_admin_notice()
     23        {
     24            if (isset($_GET['page']) && $_GET['page'] === 'steadfast') {
     25
     26                remove_all_actions('admin_notices');
     27                remove_all_actions('all_admin_notices');
     28
     29            }
     30        }
     31
    1832
    1933
     
    4660                    'title'    => esc_html__( 'Notes', 'steadfast-api'),
    4761                    'type'     => 'checkbox',
    48                     'subtitle' => esc_html__( 'Please enable this check box for send customer notes', 'steadfast-api'),
     62                    'subtitle' => esc_html__( 'Please enable this checkbox for send customer notes', 'steadfast-api'),
    4963                ),
    5064
     
    5266                    'title'       => esc_html__( 'API Key *', 'steadfast-api'),
    5367                    'type'        => 'password',
    54                     'placeholder' => esc_html__( 'enter your api key', 'steadfast-api'),
     68                    'placeholder' => esc_html__( 'Enter your api key', 'steadfast-api'),
    5569                    'subtitle'    => esc_html__( 'This field is required', 'steadfast-api'),
    5670                ),
     
    5973                    'title'       => esc_html__( 'Secret Key *', 'steadfast-api'),
    6074                    'type'        => 'password',
    61                     'placeholder' => esc_html__( 'enter your secret key', 'steadfast-api'),
     75                    'placeholder' => esc_html__( 'Enter your secret key', 'steadfast-api'),
    6276                    'subtitle'    => esc_html__( 'This field is required', 'steadfast-api'),
    6377                ),
  • steadfast-api/trunk/includes/class-hooks.php

    r3260117 r3445113  
    5454
    5555            <div id="stdf-customer-info-modal">
    56                 <h2><?php echo esc_html__('📊 SteadFast Success Rate', 'steadfast-api'); ?></h2>
     56                <h2><?php // echo esc_html__('📊 SteadFast Success Rate', 'steadfast-api'); ?></h2>
    5757                <div id="stdf-customer-info-content">
    5858               
  • steadfast-api/trunk/readme.txt

    r3407125 r3445113  
    55Tags: steadfast, steadfast courier, send to steadfast, steadfast api
    66Requires at least: 6.5.5
    7 Tested up to: 6.8.3
     7Tested up to: 6.9
    88Requires PHP: 8.0
    9 Stable tag: 1.0.3
     9Stable tag: 1.0.4
    1010Tested up to WooCommerce: 10.3.5
    1111Text Domain: steadfast-api
     
    9494== Changelog ==
    9595
     96= 1.0.4 = 
     97* Show Courier Score Check Limit Message.
     98
    9699= 1.0.3 = 
    97100* Fix Courier Score API issue.
  • steadfast-api/trunk/steadfast-api.php

    r3407125 r3445113  
    44 * Plugin Name: SteadFast API
    55 * Description: Send to SteadFast gives you the ability to send your parcel request to SteadFast directly from your WooCommerce dashboard, it enables booking automation from your WordPress website. You can send your parcel to SteadFast one by one, or you can choose bulk send from "bulk action" dropdown.
    6  * Version: 1.0.3
     6 * Version: 1.0.4
    77 * Author: SteadFast Courier LTD
    88 * Text Domain: steadfast-api
    99 * Author URI: https://steadfast.com.bd/
     10 * Requires Plugins: woocommerce
    1011 * License: GPLv2
    1112 * License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    6263         */
    6364        function admin_script() {
     65       
    6466            $page = isset( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : '';
    65             if ( $page == 'steadfast'){
    66                 wp_enqueue_style( 'stdf-style-dashboard', STDF_PLUGIN_URL . 'assets/admin/css/dashboard.css', array(), STDF_PLUGIN_VERSION, 'all' );
     67            if ($page == 'steadfast') {
     68                wp_enqueue_style('stdf-style-dashboard', STDF_PLUGIN_URL . 'assets/admin/css/dashboard.css', array(), STDF_PLUGIN_VERSION, 'all');
     69                wp_enqueue_script('stdf-script-dashboard', STDF_PLUGIN_URL . 'assets/admin/js/dashboard.js', array(), STDF_PLUGIN_VERSION);
    6770            }
    6871
Note: See TracChangeset for help on using the changeset viewer.