Plugin Directory

Changeset 3283903


Ignore:
Timestamp:
04/29/2025 08:17:09 AM (11 months ago)
Author:
bobgroup
Message:

Deploy version 3.0.81

Location:
uafrica-shipping/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uafrica-shipping/trunk/app/class-shipping.php

    r3267713 r3283903  
    5757            ),
    5858            'hide'          => array(
    59                 'title'       => __( 'Hide WooCommerce Shipping Rates', 'uafrica-shipping' ),
     59                'title'       => __( 'Hide WooCommerce shipping rates', 'uafrica-shipping' ),
    6060                'type'        => 'checkbox',
    6161                'description' => __( 'Hide other WooCommerce shipping rates if Bob Go returns rates.', 'uafrica-shipping' ),
  • uafrica-shipping/trunk/app/class-woocommerce.php

    r3267713 r3283903  
    245245
    246246            if ( ! empty($uafrica_shipping_settings['Additional_rate_info']) && $uafrica_shipping_settings['Additional_rate_info'] === 'yes') {
    247                 // Get shipping rates for the current package
    248                 $available_shipping_methods = WC()->session->get('shipping_for_package_0')['rates'];
    249 
    250                 foreach ($available_shipping_methods as $rate_id => $rate) {
    251                     $meta_data = self::get_shipping_metadata($rate);
    252 
    253                     $deliveryTimeFrame = self::calculate_delivery_timeframe($meta_data);
    254                     $description       = ! empty($meta_data['method_description']) ? $meta_data['method_description'] : '';
    255 
    256                     // Construct the description output
    257                     $descriptions[$rate_id] = self::format_description_output($deliveryTimeFrame, $description);
    258                 }
     247                // Get shipping package information from the session
     248                $shipping_package = WC()->session->get('shipping_for_package_0');
     249
     250                // Check if the shipping package and rates exist before accessing
     251                if ( isset($shipping_package['rates']) && is_array($shipping_package['rates']) ) {
     252                    $available_shipping_methods = $shipping_package['rates'];
     253
     254                    foreach ($available_shipping_methods as $rate_id => $rate) {
     255                        $meta_data = self::get_shipping_metadata($rate);
     256
     257                        $deliveryTimeFrame = self::calculate_delivery_timeframe($meta_data);
     258                        $description = !empty($meta_data['method_description']) ? $meta_data['method_description'] : '';
     259
     260                        // Construct the description output
     261                        $descriptions[$rate_id] = self::format_description_output($deliveryTimeFrame, $description);
     262                    }
     263                }
    259264            }
    260265
  • uafrica-shipping/trunk/readme.txt

    r3268433 r3283903  
    66Tested up to: 6.7
    77Requires PHP: 7.0.0
    8 Stable tag: 3.0.72
     8Stable tag: 3.0.81
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    7878== Changelog ==
    7979
     80= 3.0.81 =
     81* Fix handling rates in the shipping package
     82
    8083= 3.0.72 =
    8184* Declare support for WordPress version 6.7
  • uafrica-shipping/trunk/uafrica-shipping.php

    r3268433 r3283903  
    1313 * Requires at least: 5.0
    1414 * Requires PHP:      7.0
    15  * Version:           3.0.72
     15 * Version:           3.0.81
    1616 * License:           GPLv2 or later
    1717 *
     
    2525 */
    2626
    27 define( 'UAFRICA_SHIPPING_VERSION', '3.0.72' );
     27define( 'UAFRICA_SHIPPING_VERSION', '3.0.81' );
    2828// Endpoints for tracking orders.
    2929define( 'UAFRICA_SHIPPING_API_TRACKING_V3', 'https://api.bobgo.co.za/tracking?channel=DOMAIN&tracking_reference=NUMBER' );
Note: See TracChangeset for help on using the changeset viewer.