Title: Freeshipping
Last modified: October 5, 2022

---

# Freeshipping

 *  [p206ab](https://wordpress.org/support/users/p206ab/)
 * (@p206ab)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/freeshipping/)
 * Hello,
 * your plugin works great, but I was wondering how to set it up to be “free” for
   orders eligible for free shipping? Obviously it can be hidden, so it’s not charged,
   but then parcelshop cannot be selected and the whole point of this plugin is 
   lost so.. any ideas?
 * Thanks.

Viewing 1 replies (of 1 total)

 *  [mattq321](https://wordpress.org/support/users/mattq321/)
 * (@mattq321)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/freeshipping/#post-16084443)
 * I solved it by pasting this code into child theme’s functions.php file. It sets
   the shipping fees for all shipping methods to 0.
 *     ```
       function filter_woocommerce_package_rates( $rates, $package ) {
           // Cart total amount (integer)
           $cart_total = WC()->cart->cart_contents_total;
   
           // Greater than or equal to
           if ( $cart_total >= 59.99 ) {
               foreach ( $rates as $rate_key => $rate ) {
                   // For "free shipping" method (enabled), remove it
                   if ( $rate->method_id == 'free_shipping' ) {
                       unset( $rates[$rate_key] );
                   // For other shipping methods
                   } else {
                       // Append rate label titles (free)
                       $rates[$rate_key]->label .= ' ' . __( '(free)', 'woocommerce' );
   
                       // Set rate cost
                       $rates[$rate_key]->cost = 0;
   
                       // Set taxes rate cost (if enabled)
                       $taxes = array();
   
                       foreach ( $rates[$rate_key]->taxes as $key => $tax ) {
                           if ( $rates[$rate_key]->taxes[$key] > 0 ) {
                               $taxes[$key] = 0;
                           }
                       }
   
                       $rates[$rate_key]->taxes = $taxes;
                   }
               }
           }
   
           return $rates;
       }
       add_filter( 'woocommerce_package_rates','filter_woocommerce_package_rates', 10, 2 );
       ```
   

Viewing 1 replies (of 1 total)

The topic ‘Freeshipping’ is closed to new replies.

 * ![](https://ps.w.org/invelity-gls-parcelshop/assets/icon-256x256.png?rev=2395912)
 * [Invelity GLS ParcelShop](https://wordpress.org/plugins/invelity-gls-parcelshop/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/invelity-gls-parcelshop/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/invelity-gls-parcelshop/)
 * [Active Topics](https://wordpress.org/support/plugin/invelity-gls-parcelshop/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/invelity-gls-parcelshop/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/invelity-gls-parcelshop/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [mattq321](https://wordpress.org/support/users/mattq321/)
 * Last activity: [3 years, 8 months ago](https://wordpress.org/support/topic/freeshipping/#post-16084443)
 * Status: not resolved