Plugin Directory

Changeset 3366850


Ignore:
Timestamp:
09/24/2025 03:40:47 AM (6 months ago)
Author:
aarsiv
Message:

Flat rate support added

Location:
a2z-ups-shipping
Files:
31 added
4 edited

Legend:

Unmodified
Added
Removed
  • a2z-ups-shipping/trunk/a2zups_basic.php

    r3361931 r3366850  
    55 * Plugin URI: https://a2zplugins.com/product/ups-express-shipping-with-label-printing/
    66 * Description: Realtime Shipping Rates, Shipping label, commercial invoice automation included.
    7  * Version: 4.3.9
     7 * Version: 4.4.0
    88 * Author: Shipi
    99 * Author URI: https://myshipi.com/
     
    20212021                            "wight_dim_unit" => $general_settings['hit_ups_auto_weight_unit'],
    20222022                            "plt" => ($general_settings['hit_ups_auto_ppt'] == 'yes') ? "Y" : "N",
     2023                            "simple_rate" => ($general_settings['hit_ups_auto_simple_rate'] == 'yes') ? "Y" : "N",
    20232024                            "airway_bill" => ($general_settings['hit_ups_auto_aabill'] == 'yes') ? "Y" : "N",
    20242025                            "sd" => ($general_settings['hit_ups_auto_sat'] == 'yes') ? "Y" : "N",
     
    23642365                                "wight_dim_unit" => $general_settings['hit_ups_auto_weight_unit'],
    23652366                                "plt" => ($general_settings['hit_ups_auto_ppt'] == 'yes') ? "Y" : "N",
     2367                                "simple_rate" => ($general_settings['hit_ups_auto_simple_rate'] == 'yes') ? "Y" : "N",
    23662368                                "airway_bill" => ($general_settings['hit_ups_auto_aabill'] == 'yes') ? "Y" : "N",
    23672369                                "sd" => ($general_settings['hit_ups_auto_sat'] == 'yes') ? "Y" : "N",
     
    27832785                                // "total_product_weg" => $total_weg,
    27842786                                "plt" => ($general_settings['hit_ups_auto_ppt'] == 'yes') ? "Y" : "N",
     2787                                "simple_rate" => ($general_settings['hit_ups_auto_simple_rate'] == 'yes') ? "Y" : "N",
    27852788                                "airway_bill" => ($general_settings['hit_ups_auto_aabill'] == 'yes') ? "Y" : "N",
    27862789                                "sd" => ($general_settings['hit_ups_auto_sat'] == 'yes') ? "Y" : "N",
  • a2z-ups-shipping/trunk/controllors/ups_rest_main.php

    r3079078 r3366850  
    115115                foreach ($packs as $p_key => $pack) {
    116116                    $curr_pack_info = [];
     117                    // Calculate Simple Rate
     118                    if (isset($general_settings['hit_ups_auto_simple_rate']) && $general_settings['hit_ups_auto_simple_rate'] == "yes") {
     119                        $length = isset($pack['Dimensions']['Length']) ? substr(number_format($pack['Dimensions']['Length'], 4), 0, 6) : "0.5000";
     120                        $width = isset($pack['Dimensions']['Width']) ? substr(number_format($pack['Dimensions']['Width'], 4), 0, 6) : "0.5000";
     121                        $height = isset($pack['Dimensions']['Height']) ? substr(number_format($pack['Dimensions']['Height'], 4), 0, 6) : "0.5000"; 
     122                        $volume = $length * $width * $height;
     123                        if ($volume <= 100) {
     124                            $simple_rate_code = "XS";
     125                        } elseif ($volume <= 250) {
     126                            $simple_rate_code = "S";
     127                        } elseif ($volume <= 650) {
     128                            $simple_rate_code = "M";
     129                        } elseif ($volume <= 1050) {
     130                            $simple_rate_code = "L";
     131                        } else {
     132                            $simple_rate_code = "XL";
     133                        }
     134                        $curr_pack_info['SimpleRate'] = [
     135                            "Description" => "SimpleRateDescription",
     136                            "Code" => $simple_rate_code
     137                        ];
     138                    }
     139                   
    117140                    $curr_pack_info['PackagingType'] = ["Code" => "02"];
    118141                    $curr_pack_info['PackageWeight']['UnitOfMeasurement'] = [
  • a2z-ups-shipping/trunk/controllors/views/hit_ups_automated_settings_view.php

    r3223352 r3366850  
    639639        $general_settings['hit_ups_auto_sat'] = sanitize_text_field(isset($_POST['hit_ups_auto_sat']) ? 'yes' :'no');
    640640        $general_settings['hit_ups_auto_ppt'] = sanitize_text_field(isset($_POST['hit_ups_auto_ppt']) ? 'yes' :'no');
     641        $general_settings['hit_ups_auto_simple_rate'] = sanitize_text_field(isset($_POST['hit_ups_auto_simple_rate']) ? 'yes' :'no');
    641642        $general_settings['hit_ups_auto_label_automation'] = sanitize_text_field(isset($_POST['hit_ups_auto_label_automation']) ? 'yes' :'no');
    642643        $general_settings['hit_ups_add_shipping_invoice'] = sanitize_text_field(isset($_POST['hit_ups_add_shipping_invoice']) ? 'yes' :'no');
     
    13551356        <td><span style="float:right;padding-right:10px;"><input type="checkbox" name="hit_ups_add_shipping_invoice" <?php _e((isset($general_settings['hit_ups_add_shipping_invoice']) && $general_settings['hit_ups_add_shipping_invoice'] == 'yes') ? 'checked="true"' : '','hit_ups_auto'); ?> value="yes" ><small style="color:gray">Add Shipping Cost to invoice</small></span></td>
    13561357        <td><span style="float:right;padding-right:10px;"><input type="checkbox" name="hit_ups_auto_ppt" <?php _e((isset($general_settings['hit_ups_auto_ppt']) && $general_settings['hit_ups_auto_ppt'] == 'yes') || ($initial_setup) ? 'checked="true"' : '','hit_ups_auto'); ?> value="yes" ><small style="color:gray"> Paperless Trade.</small></span></td>
     1358        <td><span style="float:right;padding-right:10px;"><input type="checkbox" name="hit_ups_auto_simple_rate" <?php _e((isset($general_settings['hit_ups_auto_simple_rate']) && $general_settings['hit_ups_auto_simple_rate'] == 'yes') || ($initial_setup) ? 'checked="true"' : '','hit_ups_auto'); ?> value="yes" ><small style="color:gray"> Simple rate.</small></span></td>
    13571359    </table>
    13581360       
  • a2z-ups-shipping/trunk/readme.txt

    r3361931 r3366850  
    66Tested up to: 6.8
    77Requires PHP: 5.6
    8 Stable tag: 4.3.9
     8Stable tag: 4.4.0
    99License: GPLv3 or later License
    1010URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    9797
    9898== Changelog ==
     99
     100= 4.4.0 =
     101    > Introduced Simple Rate support in the API for more flexible shipping costs.
     102
    99103= 4.3.9 =
    100104    > Fixed "Unsupported operand types" error.
Note: See TracChangeset for help on using the changeset viewer.