Plugin Directory

Changeset 3374567


Ignore:
Timestamp:
10/07/2025 04:24:24 PM (3 months ago)
Author:
aarsiv
Message:

imporvments

Location:
a2z-canada-post-automated-shipping
Files:
32 added
2 edited

Legend:

Unmodified
Added
Removed
  • a2z-canada-post-automated-shipping/trunk/hit_canadapost_auto_basic.php

    r3347108 r3374567  
    44 * Plugin URI: https://wordpress.org/plugins/a2z-canada-post-automated-shipping/#developers
    55 * Description: Realtime Shipping Rates, Shipping label, commercial invoice automation included.
    6  * Version: 3.0.3
     6 * Version: 3.0.4
    77 * Author: Shipi
    88 * Author URI: https://myshipi.com/
     
    8080                $general_settings = get_option('hit_cp_auto_main_settings');
    8181                $general_settings = empty($general_settings) ? array() : $general_settings;
     82
     83                add_action( 'woocommerce_view_order', array($this, 'add_tracking_info_to_order_view'), 10 );
    8284           
     85            }
     86
     87            function add_tracking_info_to_order_view( $order_id ) {
     88                // print_r($order_id);die;
     89                $data = $this->hit_cp_get_meta($order_id, 'values', false);
     90                if($data){
     91                    $shipment_data = json_decode($data, true);
     92                    if ($shipment_data){
     93                        if(isset($shipment_data["tracking_num"])){
     94                            $key = 0;
     95                            ?>
     96                            <script>
     97                                // Listener in the parent window
     98                                function receiveMessage(event) {
     99                                    // Optionally check the event origin for security
     100                                    if (event.data && event.data.type === 'setHeight') {
     101                                        var iframe = document.getElementById('shipi_canadapostcontentFrame<?php echo $key;?>');
     102                                        iframe.style.height = event.data.height + 'px';
     103                                    }
     104                                }
     105                                window.addEventListener('message', receiveMessage, false);
     106                            </script>
     107                            <iframe src="https://track.myshipi.com/?no=<?php echo $shipment_data["tracking_num"]; ?>&track=1&embed=1" scrolling="no" id="shipi_canadapostcontentFrame<?php echo $key;?>" style="width: 100%;border: 0px;background: transparent;"></iframe>
     108                            <?php
     109                        }
     110                    }
     111                }
     112            }
     113
     114            function hit_cp_get_meta($order_id, $meta_key, $default = false) {
     115                $option_name = 'hit_cp_auto_' . $meta_key . '_' . $order_id;
     116                $meta_value = get_option($option_name, $default);
     117                return $meta_value;
    83118            }
    84119
  • a2z-canada-post-automated-shipping/trunk/readme.txt

    r3347108 r3374567  
    55Tested up to: 6.8
    66Requires PHP: 5.6
    7 Stable tag: 3.0.3
     7Stable tag: 3.0.4
    88License: GPLv3 or later License
    99URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    8080
    8181== Changelog ==
     82= 3.0.4 =
     83    > Added Tracking Status
     84
    8285= 3.0.3 =
    8386    > Bug Fix
Note: See TracChangeset for help on using the changeset viewer.