Plugin Directory

Changeset 3209680


Ignore:
Timestamp:
12/18/2024 07:58:02 AM (16 months ago)
Author:
cod24
Message:
  • Bugs fixes and improvements
Location:
cod24-shipping
Files:
22 added
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • cod24-shipping/trunk/cod24-shipping.php

    r3204044 r3209680  
    33Plugin Name: COD24 Shipping For Woocommerce
    44Description: This plugin is adding COD24 shipping methods to woocommerce.
    5 Version: 3.4.3
     5Version: 3.4.4
    66Author: COD24
    77Author URI: https://cod24.ir
  • cod24-shipping/trunk/inc/class-cod24-api.php

    r3204044 r3209680  
    243243            $customer_phone = str_replace("+98", "0" , $order->get_billing_phone() );
    244244            $customer_email = $order->get_billing_email();
     245           
     246            // analyze customer postcode
     247            if( empty( $customer_postcode ) || ( !empty( $customer_postcode ) && strlen( $customer_postcode ) != 10 ) )
     248                $customer_postcode = "0000000000";
    245249
    246250            $user_delivery_address = self::find_city( $customer_city );
  • cod24-shipping/trunk/inc/class-cod24-woo.php

    r3204044 r3209680  
    343343                }
    344344            }
     345           
     346            // Check if free shipping is available and only hide other rates for certain conditions
     347            $free_shipping_available = false;
     348       
     349            // Loop through rates to check for free shipping
     350            foreach ($rates as $rate_id => $rate) {
     351                if ('free_shipping' === $rate->method_id) {
     352                    $free_shipping_available = true; // Free shipping is available
     353                    break;
     354                }
     355            }
     356       
     357            // If free shipping is available and specific conditions are met, hide other rates
     358            if ($free_shipping_available) {
     359                foreach ($rates as $rate_id => $rate) {
     360                    if ('free_shipping' !== $rate->method_id) {
     361                        unset($rates[$rate_id]); // Remove other shipping methods
     362                    }
     363                }
     364            }
    345365
    346366            // hide cod when shipping cost delivery is required
  • cod24-shipping/trunk/readme.txt

    r3204044 r3209680  
    44Requires at least: 5.0
    55Tested up to: 6.7
    6 Stable tag: 3.4.3
     6Stable tag: 3.4.4
    77License: GPL-2.0+
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset for help on using the changeset viewer.