{"id":5076,"date":"2018-03-09T10:53:49","date_gmt":"2018-03-09T15:53:49","guid":{"rendered":"https:\/\/themespress.ca\/?p=5076"},"modified":"2022-10-01T14:39:28","modified_gmt":"2022-10-01T18:39:28","slug":"woocommerce-disabling-shipping-charges-when-offering-free-shipping","status":"publish","type":"post","link":"https:\/\/themespress.ca\/en\/woocommerce-disabling-shipping-charges-when-offering-free-shipping\/","title":{"rendered":"WooCommerce: Disabling Shipping Charges When Offering Free Shipping"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><div class=\"vc_row wpb_row vc_row-fluid\"><div class=\"wpb_column vc_column_container vc_col-sm-12\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\"><\/div><\/div><\/div><\/div><div class=\"vc_row wpb_row vc_row-fluid\"><div class=\"wpb_column vc_column_container vc_col-sm-12\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\n\t<div class=\"wpb_text_column wpb_content_element\" >\n\t\t<div class=\"wpb_wrapper\">\n\t\t\t<p>With this tutorial, we will show you how to disable shipping charges when you want to offer free shipping. For example, with WooCommerce you can add a rule where if customers orders for a minimum 75$, they can get free shipping.<\/p>\n<p>The problem is that WooCommerce leaves all types of shipping charges as default settings. So it can leave customers confused as they might not understand if shipping is free or not. Additionally, they cannot select a different shipping method.<\/p>\n<p>Here&#8217;s a function that will help you disable shiping charges. First, you&#8217;ll notice that both values are displayed in the unset with Firebug. Note the values with their number.<\/p>\n\n\t\t<\/div>\n\t<\/div>\n<div class=\"vc_row wpb_row vc_inner vc_row-fluid\"><div class=\"wpb_column vc_column_container vc_col-sm-6\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\n\t<div  class=\"wpb_single_image wpb_content_element vc_align_left wpb_content_element\">\n\t\t\n\t\t<figure class=\"wpb_wrapper vc_figure\">\n\t\t\t<a class=\"\" data-lightbox=\"lightbox[rel-5076-2593593972]\" href=\"https:\/\/themespress.ca\/wp-content\/uploads\/2018\/03\/screenshot_20180309_103159-1-1024x175.jpg\" target=\"_self\" class=\"vc_single_image-wrapper   vc_box_border_grey\"><img decoding=\"async\" width=\"1202\" height=\"205\" src=\"https:\/\/themespress.ca\/wp-content\/uploads\/2018\/03\/screenshot_20180309_103159-1.jpg\" class=\"vc_single_image-img attachment-full\" alt=\"\" title=\"screenshot_20180309_103159\" srcset=\"https:\/\/themespress.ca\/wp-content\/uploads\/2018\/03\/screenshot_20180309_103159-1.jpg 1202w, https:\/\/themespress.ca\/wp-content\/uploads\/2018\/03\/screenshot_20180309_103159-1-600x102.jpg 600w, https:\/\/themespress.ca\/wp-content\/uploads\/2018\/03\/screenshot_20180309_103159-1-300x51.jpg 300w, https:\/\/themespress.ca\/wp-content\/uploads\/2018\/03\/screenshot_20180309_103159-1-1024x175.jpg 1024w, https:\/\/themespress.ca\/wp-content\/uploads\/2018\/03\/screenshot_20180309_103159-1-768x131.jpg 768w\" sizes=\"(max-width: 1202px) 100vw, 1202px\" \/><\/a>\n\t\t<\/figure>\n\t<\/div>\n<\/div><\/div><\/div><div class=\"wpb_column vc_column_container vc_col-sm-6\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\n\t<div  class=\"wpb_single_image wpb_content_element vc_align_left wpb_content_element\">\n\t\t\n\t\t<figure class=\"wpb_wrapper vc_figure\">\n\t\t\t<a class=\"\" data-lightbox=\"lightbox[rel-5076-3882020265]\" href=\"https:\/\/themespress.ca\/wp-content\/uploads\/2018\/03\/shipping-methode-free-300x57-1.jpg\" target=\"_self\" class=\"vc_single_image-wrapper   vc_box_border_grey\"><img decoding=\"async\" width=\"300\" height=\"57\" src=\"https:\/\/themespress.ca\/wp-content\/uploads\/2018\/03\/shipping-methode-free-300x57-1.jpg\" class=\"vc_single_image-img attachment-full\" alt=\"\" title=\"shipping-methode-free-300x57\" \/><\/a>\n\t\t<\/figure>\n\t<\/div>\n<\/div><\/div><\/div><\/div><\/div><\/div><\/div><\/div><div class=\"vc_row wpb_row vc_row-fluid\"><div class=\"wpb_column vc_column_container vc_col-sm-12\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\n\t<div class=\"wpb_text_column wpb_content_element\" >\n\t\t<div class=\"wpb_wrapper\">\n\t\t\t<p>In the images above, you&#8217;ll notice each input for each shipping charge.<br \/>\nIn the first one, we can see <strong>free_shipping:9<\/strong>, whereas with the shipping charge input, we can see <strong>flat_rate:6<\/strong>. So with this function, we will say that if the shiping method works, disable all other shipping methods.<\/p>\n\n\t\t<\/div>\n\t<\/div>\n<div id=\"ts-enlighterjs-container-5217465\" class=\"ts-enlighterjs-container-single-enabled  \" style=\"width: 100%;  margin-top: 0px; margin-bottom: 0px;\" data-enlighter-doubleclick=\"true\" data-enlighter-windowbutton=\"true\" data-enlighter-windowtext=\"New Window\" data-enlighter-rawbutton=\"true\" data-enlighter-rawtext=\"RAW Code\" data-enlighter-infobutton=\"false\" data-enlighter-infotext=\"EnlighterJS\" data-enlighter-indent=\"2\"><pre id=\"ts-enlighterjs-pre-5217465\" class=\"\" style=\"white-space: pre-wrap; height: 100%; margin: 0; padding: 0;\" data-enlighter-language=\"php\" data-enlighter-theme=\"enlighter\" data-enlighter-group=\"\" data-enlighter-title=\"\" data-enlighter-linenumbers=\"true\" data-enlighter-lineoffset=\"1\" data-enlighter-highlight=\"\">add_filter( &#039;woocommerce_package_rates&#039;, &#039;montheme_unset_shipping_when_free_is_available_in_zone&#039;, 10, 2 );\nfunction montheme_unset_shipping_when_free_is_available_in_zone( $rates, $package ) {\n    \/\/ Only unset rates if free_shipping is available\n    if ( isset( $rates[&#039;free_shipping:9&#039;] ) ) {\n    unset( $rates[&#039;flat_rate:6&#039;] );\n}   \n    return $rates;\n}<\/pre><\/div><\/div><\/div><\/div><\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"With this tutorial, we will show you how to disable shipping charges when you want to offer free shipping. For example, with WooCommerce you can add a rule where if<div class=\"read-more\"><a class=\"btn button-secondary\" href=\"https:\/\/themespress.ca\/en\/woocommerce-disabling-shipping-charges-when-offering-free-shipping\/\">Read More<\/a><\/div>","protected":false},"author":81,"featured_media":5081,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[283],"tags":[],"class_list":["post-5076","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/posts\/5076","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/users\/81"}],"replies":[{"embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/comments?post=5076"}],"version-history":[{"count":0,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/posts\/5076\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/media\/5081"}],"wp:attachment":[{"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/media?parent=5076"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/categories?post=5076"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/themespress.ca\/en\/wp-json\/wp\/v2\/tags?post=5076"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}