<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>General Snippets - CODIBU</title>
	<atom:link href="https://help.codibu.com/kbtopic/general-snippets/feed/" rel="self" type="application/rss+xml" />
	<link>https://help.codibu.com</link>
	<description>Hosting &#38; Domain,  Development &#38; Design, SEO &#38; Marketing, 2300+ Themes &#38; Plugins, Free SEO analysis &#38; tools</description>
	<lastBuildDate>Mon, 09 Nov 2020 06:49:52 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://help.codibu.com/wp-content/uploads/2022/07/favicon.png</url>
	<title>General Snippets - CODIBU</title>
	<link>https://help.codibu.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Minimum Order Amount</title>
		<link>https://help.codibu.com/blog/minimum-order-amount/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=minimum-order-amount</link>
					<comments>https://help.codibu.com/blog/minimum-order-amount/#respond</comments>
		
		<dc:creator><![CDATA[JN C]]></dc:creator>
		<pubDate>Mon, 09 Nov 2020 06:49:52 +0000</pubDate>
				<guid isPermaLink="false">https://help.codibu.com/kb/minimum-order-amount/</guid>

					<description><![CDATA[<p>Add code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Avoid adding custom code directly<span class="excerpt-hellip"> […]</span></p>
<p>The post <a href="https://help.codibu.com/blog/minimum-order-amount/">Minimum Order Amount</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><span class="s1">Add code to your child theme’s <code>functions.php</code> file or via a plugin that allows custom functions to be added, such as the <a href="https://wordpress.org/plugins/code-snippets/">Code snippets</a> plugin. Avoid adding custom code directly to your parent theme’s <code>functions.php</code> file as this will be wiped entirely when you update the theme.</span></p>
<div id="gist88077590" class="gist">
<div class="gist-file">
<div class="gist-data">
<div class="js-gist-file-update-container js-task-list-container file-box">
<div id="file-wc-min-order-amount-php" class="file my-2">
<div class="Box-body p-0 blob-wrapper data type-php  ">
<table class="highlight tab-size js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">
<tbody>
<tr>
<td id="file-wc-min-order-amount-php-L1" class="blob-num js-line-number" data-line-number="1"> </td>
<td id="file-wc-min-order-amount-php-LC1" class="blob-code blob-code-inner js-file-line">/**</td>
</tr>
<tr>
<td id="file-wc-min-order-amount-php-L2" class="blob-num js-line-number" data-line-number="2"> </td>
<td id="file-wc-min-order-amount-php-LC2" class="blob-code blob-code-inner js-file-line">* Set a minimum order amount for checkout</td>
</tr>
<tr>
<td id="file-wc-min-order-amount-php-L3" class="blob-num js-line-number" data-line-number="3"> </td>
<td id="file-wc-min-order-amount-php-LC3" class="blob-code blob-code-inner js-file-line">*/</td>
</tr>
<tr>
<td id="file-wc-min-order-amount-php-L4" class="blob-num js-line-number" data-line-number="4"> </td>
<td id="file-wc-min-order-amount-php-LC4" class="blob-code blob-code-inner js-file-line">add_action( &#8216;woocommerce_checkout_process&#8217;, &#8216;wc_minimum_order_amount&#8217; );</td>
</tr>
<tr>
<td id="file-wc-min-order-amount-php-L5" class="blob-num js-line-number" data-line-number="5"> </td>
<td id="file-wc-min-order-amount-php-LC5" class="blob-code blob-code-inner js-file-line">add_action( &#8216;woocommerce_before_cart&#8217; , &#8216;wc_minimum_order_amount&#8217; );</td>
</tr>
<tr>
<td id="file-wc-min-order-amount-php-L6" class="blob-num js-line-number" data-line-number="6"> </td>
<td id="file-wc-min-order-amount-php-LC6" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-min-order-amount-php-L7" class="blob-num js-line-number" data-line-number="7"> </td>
<td id="file-wc-min-order-amount-php-LC7" class="blob-code blob-code-inner js-file-line">function wc_minimum_order_amount() {</td>
</tr>
<tr>
<td id="file-wc-min-order-amount-php-L8" class="blob-num js-line-number" data-line-number="8"> </td>
<td id="file-wc-min-order-amount-php-LC8" class="blob-code blob-code-inner js-file-line">// Set this variable to specify a minimum order value</td>
</tr>
<tr>
<td id="file-wc-min-order-amount-php-L9" class="blob-num js-line-number" data-line-number="9"> </td>
<td id="file-wc-min-order-amount-php-LC9" class="blob-code blob-code-inner js-file-line">$minimum = 50;</td>
</tr>
<tr>
<td id="file-wc-min-order-amount-php-L10" class="blob-num js-line-number" data-line-number="10"> </td>
<td id="file-wc-min-order-amount-php-LC10" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-min-order-amount-php-L11" class="blob-num js-line-number" data-line-number="11"> </td>
<td id="file-wc-min-order-amount-php-LC11" class="blob-code blob-code-inner js-file-line">if ( WC()-<span class="pl-kos">&gt;</span>cart-<span class="pl-kos">&gt;</span>total <span class="pl-kos">&lt;</span> $minimum ) {</td>
</tr>
<tr>
<td id="file-wc-min-order-amount-php-L12" class="blob-num js-line-number" data-line-number="12"> </td>
<td id="file-wc-min-order-amount-php-LC12" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-min-order-amount-php-L13" class="blob-num js-line-number" data-line-number="13"> </td>
<td id="file-wc-min-order-amount-php-LC13" class="blob-code blob-code-inner js-file-line">if( is_cart() ) {</td>
</tr>
<tr>
<td id="file-wc-min-order-amount-php-L14" class="blob-num js-line-number" data-line-number="14"> </td>
<td id="file-wc-min-order-amount-php-LC14" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-min-order-amount-php-L15" class="blob-num js-line-number" data-line-number="15"> </td>
<td id="file-wc-min-order-amount-php-LC15" class="blob-code blob-code-inner js-file-line">wc_print_notice(</td>
</tr>
<tr>
<td id="file-wc-min-order-amount-php-L16" class="blob-num js-line-number" data-line-number="16"> </td>
<td id="file-wc-min-order-amount-php-LC16" class="blob-code blob-code-inner js-file-line">sprintf( &#8216;Your current order total is %s — you must have an order with a minimum of %s to place your order &#8216; ,</td>
</tr>
<tr>
<td id="file-wc-min-order-amount-php-L17" class="blob-num js-line-number" data-line-number="17"> </td>
<td id="file-wc-min-order-amount-php-LC17" class="blob-code blob-code-inner js-file-line">wc_price( WC()-<span class="pl-kos">&gt;</span>cart-<span class="pl-kos">&gt;</span>total ),</td>
</tr>
<tr>
<td id="file-wc-min-order-amount-php-L18" class="blob-num js-line-number" data-line-number="18"> </td>
<td id="file-wc-min-order-amount-php-LC18" class="blob-code blob-code-inner js-file-line">wc_price( $minimum )</td>
</tr>
<tr>
<td id="file-wc-min-order-amount-php-L19" class="blob-num js-line-number" data-line-number="19"> </td>
<td id="file-wc-min-order-amount-php-LC19" class="blob-code blob-code-inner js-file-line">), &#8216;error&#8217;</td>
</tr>
<tr>
<td id="file-wc-min-order-amount-php-L20" class="blob-num js-line-number" data-line-number="20"> </td>
<td id="file-wc-min-order-amount-php-LC20" class="blob-code blob-code-inner js-file-line">);</td>
</tr>
<tr>
<td id="file-wc-min-order-amount-php-L21" class="blob-num js-line-number" data-line-number="21"> </td>
<td id="file-wc-min-order-amount-php-LC21" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-min-order-amount-php-L22" class="blob-num js-line-number" data-line-number="22"> </td>
<td id="file-wc-min-order-amount-php-LC22" class="blob-code blob-code-inner js-file-line">} else {</td>
</tr>
<tr>
<td id="file-wc-min-order-amount-php-L23" class="blob-num js-line-number" data-line-number="23"> </td>
<td id="file-wc-min-order-amount-php-LC23" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-min-order-amount-php-L24" class="blob-num js-line-number" data-line-number="24"> </td>
<td id="file-wc-min-order-amount-php-LC24" class="blob-code blob-code-inner js-file-line">wc_add_notice(</td>
</tr>
<tr>
<td id="file-wc-min-order-amount-php-L25" class="blob-num js-line-number" data-line-number="25"> </td>
<td id="file-wc-min-order-amount-php-LC25" class="blob-code blob-code-inner js-file-line">sprintf( &#8216;Your current order total is %s — you must have an order with a minimum of %s to place your order&#8217; ,</td>
</tr>
<tr>
<td id="file-wc-min-order-amount-php-L26" class="blob-num js-line-number" data-line-number="26"> </td>
<td id="file-wc-min-order-amount-php-LC26" class="blob-code blob-code-inner js-file-line">wc_price( WC()-<span class="pl-kos">&gt;</span>cart-<span class="pl-kos">&gt;</span>total ),</td>
</tr>
<tr>
<td id="file-wc-min-order-amount-php-L27" class="blob-num js-line-number" data-line-number="27"> </td>
<td id="file-wc-min-order-amount-php-LC27" class="blob-code blob-code-inner js-file-line">wc_price( $minimum )</td>
</tr>
<tr>
<td id="file-wc-min-order-amount-php-L28" class="blob-num js-line-number" data-line-number="28"> </td>
<td id="file-wc-min-order-amount-php-LC28" class="blob-code blob-code-inner js-file-line">), &#8216;error&#8217;</td>
</tr>
<tr>
<td id="file-wc-min-order-amount-php-L29" class="blob-num js-line-number" data-line-number="29"> </td>
<td id="file-wc-min-order-amount-php-LC29" class="blob-code blob-code-inner js-file-line">);</td>
</tr>
<tr>
<td id="file-wc-min-order-amount-php-L30" class="blob-num js-line-number" data-line-number="30"> </td>
<td id="file-wc-min-order-amount-php-LC30" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-min-order-amount-php-L31" class="blob-num js-line-number" data-line-number="31"> </td>
<td id="file-wc-min-order-amount-php-LC31" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
<tr>
<td id="file-wc-min-order-amount-php-L32" class="blob-num js-line-number" data-line-number="32"> </td>
<td id="file-wc-min-order-amount-php-LC32" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
<tr>
<td id="file-wc-min-order-amount-php-L33" class="blob-num js-line-number" data-line-number="33"> </td>
<td id="file-wc-min-order-amount-php-LC33" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<p>&nbsp;</p>
</div>
</div>
<p>The WC Minimum Order Amount plugin is based on this snippet, if you’d prefer to use a plugin.</p>
<p>Alternatively, you may want to try Minimum Purchase for WooCommerce (not an endorsement or recommendation).</p><p>The post <a href="https://help.codibu.com/blog/minimum-order-amount/">Minimum Order Amount</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://help.codibu.com/blog/minimum-order-amount/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Change a currency symbol</title>
		<link>https://help.codibu.com/blog/change-a-currency-symbol/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=change-a-currency-symbol</link>
					<comments>https://help.codibu.com/blog/change-a-currency-symbol/#respond</comments>
		
		<dc:creator><![CDATA[JN C]]></dc:creator>
		<pubDate>Mon, 09 Nov 2020 06:49:20 +0000</pubDate>
				<guid isPermaLink="false">https://help.codibu.com/kb/change-a-currency-symbol/</guid>

					<description><![CDATA[<p>Add code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Avoid adding custom code directly<span class="excerpt-hellip"> […]</span></p>
<p>The post <a href="https://help.codibu.com/blog/change-a-currency-symbol/">Change a currency symbol</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><span class="s1">Add code to your child theme’s <code>functions.php</code> file or via a plugin that allows custom functions to be added, such as the <a href="https://wordpress.org/plugins/code-snippets/">Code snippets</a> plugin. Avoid adding custom code directly to your parent theme’s <code>functions.php</code> file as this will be wiped entirely when you update the theme.</span></p>
<div id="gist88077500" class="gist">
<div class="gist-file">
<div class="gist-data">
<div class="js-gist-file-update-container js-task-list-container file-box">
<div id="file-wc-change-currency-symbol-php" class="file my-2">
<div class="Box-body p-0 blob-wrapper data type-php  ">
<table class="highlight tab-size js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">
<tbody>
<tr>
<td id="file-wc-change-currency-symbol-php-L1" class="blob-num js-line-number" data-line-number="1"> </td>
<td id="file-wc-change-currency-symbol-php-LC1" class="blob-code blob-code-inner js-file-line">/**</td>
</tr>
<tr>
<td id="file-wc-change-currency-symbol-php-L2" class="blob-num js-line-number" data-line-number="2"> </td>
<td id="file-wc-change-currency-symbol-php-LC2" class="blob-code blob-code-inner js-file-line">* Change a currency symbol</td>
</tr>
<tr>
<td id="file-wc-change-currency-symbol-php-L3" class="blob-num js-line-number" data-line-number="3"> </td>
<td id="file-wc-change-currency-symbol-php-LC3" class="blob-code blob-code-inner js-file-line">*/</td>
</tr>
<tr>
<td id="file-wc-change-currency-symbol-php-L4" class="blob-num js-line-number" data-line-number="4"> </td>
<td id="file-wc-change-currency-symbol-php-LC4" class="blob-code blob-code-inner js-file-line">add_filter(&#8216;woocommerce_currency_symbol&#8217;, &#8216;change_existing_currency_symbol&#8217;, 10, 2);</td>
</tr>
<tr>
<td id="file-wc-change-currency-symbol-php-L5" class="blob-num js-line-number" data-line-number="5"> </td>
<td id="file-wc-change-currency-symbol-php-LC5" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-change-currency-symbol-php-L6" class="blob-num js-line-number" data-line-number="6"> </td>
<td id="file-wc-change-currency-symbol-php-LC6" class="blob-code blob-code-inner js-file-line">function change_existing_currency_symbol( $currency_symbol, $currency ) {</td>
</tr>
<tr>
<td id="file-wc-change-currency-symbol-php-L7" class="blob-num js-line-number" data-line-number="7"> </td>
<td id="file-wc-change-currency-symbol-php-LC7" class="blob-code blob-code-inner js-file-line">switch( $currency ) {</td>
</tr>
<tr>
<td id="file-wc-change-currency-symbol-php-L8" class="blob-num js-line-number" data-line-number="8"> </td>
<td id="file-wc-change-currency-symbol-php-LC8" class="blob-code blob-code-inner js-file-line">case &#8216;AUD&#8217;: $currency_symbol = &#8216;AUD$&#8217;; break;</td>
</tr>
<tr>
<td id="file-wc-change-currency-symbol-php-L9" class="blob-num js-line-number" data-line-number="9"> </td>
<td id="file-wc-change-currency-symbol-php-LC9" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
<tr>
<td id="file-wc-change-currency-symbol-php-L10" class="blob-num js-line-number" data-line-number="10"> </td>
<td id="file-wc-change-currency-symbol-php-LC10" class="blob-code blob-code-inner js-file-line">return $currency_symbol;</td>
</tr>
<tr>
<td id="file-wc-change-currency-symbol-php-L11" class="blob-num js-line-number" data-line-number="11"> </td>
<td id="file-wc-change-currency-symbol-php-LC11" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div><p>The post <a href="https://help.codibu.com/blog/change-a-currency-symbol/">Change a currency symbol</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://help.codibu.com/blog/change-a-currency-symbol/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Rename a country in WooCommerce</title>
		<link>https://help.codibu.com/blog/rename-a-country-in-woocommerce/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=rename-a-country-in-woocommerce</link>
					<comments>https://help.codibu.com/blog/rename-a-country-in-woocommerce/#respond</comments>
		
		<dc:creator><![CDATA[JN C]]></dc:creator>
		<pubDate>Mon, 09 Nov 2020 06:48:55 +0000</pubDate>
				<guid isPermaLink="false">https://help.codibu.com/kb/rename-a-country-in-woocommerce/</guid>

					<description><![CDATA[<p>Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Avoid adding custom code<span class="excerpt-hellip"> […]</span></p>
<p>The post <a href="https://help.codibu.com/blog/rename-a-country-in-woocommerce/">Rename a country in WooCommerce</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><span class="s1">Add this code to your child theme’s <code>functions.php</code> file or via a plugin that allows custom functions to be added, such as the <a href="https://wordpress.org/plugins/code-snippets/">Code snippets</a> plugin. Avoid adding custom code directly to your parent theme’s <code>functions.php</code> file, as this will be wiped entirely when you update the theme.</span></p>
<div id="gist88128399" class="gist">
<div class="gist-file">
<div class="gist-data">
<div class="js-gist-file-update-container js-task-list-container file-box">
<div id="file-wc-rename-country-example-php" class="file my-2">
<div class="Box-body p-0 blob-wrapper data type-php  ">
<table class="highlight tab-size js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">
<tbody>
<tr>
<td id="file-wc-rename-country-example-php-L1" class="blob-num js-line-number" data-line-number="1"> </td>
<td id="file-wc-rename-country-example-php-LC1" class="blob-code blob-code-inner js-file-line">/**</td>
</tr>
<tr>
<td id="file-wc-rename-country-example-php-L2" class="blob-num js-line-number" data-line-number="2"> </td>
<td id="file-wc-rename-country-example-php-LC2" class="blob-code blob-code-inner js-file-line">* Rename a country</td>
</tr>
<tr>
<td id="file-wc-rename-country-example-php-L3" class="blob-num js-line-number" data-line-number="3"> </td>
<td id="file-wc-rename-country-example-php-LC3" class="blob-code blob-code-inner js-file-line">*/</td>
</tr>
<tr>
<td id="file-wc-rename-country-example-php-L4" class="blob-num js-line-number" data-line-number="4"> </td>
<td id="file-wc-rename-country-example-php-LC4" class="blob-code blob-code-inner js-file-line">add_filter( &#8216;woocommerce_countries&#8217;, &#8216;rename_ireland&#8217; );</td>
</tr>
<tr>
<td id="file-wc-rename-country-example-php-L5" class="blob-num js-line-number" data-line-number="5"> </td>
<td id="file-wc-rename-country-example-php-LC5" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-rename-country-example-php-L6" class="blob-num js-line-number" data-line-number="6"> </td>
<td id="file-wc-rename-country-example-php-LC6" class="blob-code blob-code-inner js-file-line">function rename_ireland( $countries ) {</td>
</tr>
<tr>
<td id="file-wc-rename-country-example-php-L7" class="blob-num js-line-number" data-line-number="7"> </td>
<td id="file-wc-rename-country-example-php-LC7" class="blob-code blob-code-inner js-file-line">$countries[&#8216;IE&#8217;] = &#8216;Ireland&#8217;;</td>
</tr>
<tr>
<td id="file-wc-rename-country-example-php-L8" class="blob-num js-line-number" data-line-number="8"> </td>
<td id="file-wc-rename-country-example-php-LC8" class="blob-code blob-code-inner js-file-line">return $countries;</td>
</tr>
<tr>
<td id="file-wc-rename-country-example-php-L9" class="blob-num js-line-number" data-line-number="9"> </td>
<td id="file-wc-rename-country-example-php-LC9" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div><p>The post <a href="https://help.codibu.com/blog/rename-a-country-in-woocommerce/">Rename a country in WooCommerce</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://help.codibu.com/blog/rename-a-country-in-woocommerce/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Hide other shipping methods when “Free Shipping” is available</title>
		<link>https://help.codibu.com/blog/hide-other-shipping-methods-when-free-shipping-is-available/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=hide-other-shipping-methods-when-free-shipping-is-available</link>
					<comments>https://help.codibu.com/blog/hide-other-shipping-methods-when-free-shipping-is-available/#respond</comments>
		
		<dc:creator><![CDATA[JN C]]></dc:creator>
		<pubDate>Mon, 09 Nov 2020 06:48:18 +0000</pubDate>
				<guid isPermaLink="false">https://help.codibu.com/kb/hide-other-shipping-methods-when-free-shipping-is-available/</guid>

					<description><![CDATA[<p>If you’d like to see this feature added to WooCommerce core, visit our Ideas Board and add your vote to it. The more popular an idea becomes, the<span class="excerpt-hellip"> […]</span></p>
<p>The post <a href="https://help.codibu.com/blog/hide-other-shipping-methods-when-free-shipping-is-available/">Hide other shipping methods when “Free Shipping” is available</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>If you’d like to see this feature added to WooCommerce core, visit our <a href="http://ideas.woocommerce.com/forums/133476-woocommerce/suggestions/32436028-hide-specific-shipping-method-if-free-shipping-is" target="_blank" rel="noopener noreferrer">Ideas Board</a> and add your vote to it. The more popular an idea becomes, the more of a priority it is for our developers to review.</p>
<h3 id="section-1">Adding code</h3>
<p>Before adding snippets, clear your WooCommerce cache. Go to <strong>WooCommerce &gt; System Status &gt; Tools &gt; WooCommerce Transients &gt; Clear transients</strong></p>
<p><span class="s1">Add this code to your child theme’s <code>functions.php</code> file or via a plugin that allows custom functions to be added, such as the <a href="https://wordpress.org/plugins/code-snippets/">Code snippets</a> plugin. Please don’t add custom code directly to your parent theme’s <code>functions.php</code> file as this will be wiped entirely when you update the theme.</span></p>
<h2 id="section-2" class="p1">Snippets for WC 3.0+</h2>
<p>Hides everything but <code>free_shipping</code> if it’s available and is compatible with Shipping Zones.</p>
<div id="gist88127862" class="gist">
<div class="gist-file">
<div class="gist-data">
<div class="js-gist-file-update-container js-task-list-container file-box">
<div id="file-wc-hide-all-shipping-if-free-shipping-is-available-php" class="file my-2">
<div class="Box-body p-0 blob-wrapper data type-php  ">
<table class="highlight tab-size js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">
<tbody>
<tr>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-L1" class="blob-num js-line-number" data-line-number="1"> </td>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-LC1" class="blob-code blob-code-inner js-file-line">/**</td>
</tr>
<tr>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-L2" class="blob-num js-line-number" data-line-number="2"> </td>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-LC2" class="blob-code blob-code-inner js-file-line">* Hide shipping rates when free shipping is available.</td>
</tr>
<tr>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-L3" class="blob-num js-line-number" data-line-number="3"> </td>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-LC3" class="blob-code blob-code-inner js-file-line">* Updated to support WooCommerce 2.6 Shipping Zones.</td>
</tr>
<tr>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-L4" class="blob-num js-line-number" data-line-number="4"> </td>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-LC4" class="blob-code blob-code-inner js-file-line">*</td>
</tr>
<tr>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-L5" class="blob-num js-line-number" data-line-number="5"> </td>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-LC5" class="blob-code blob-code-inner js-file-line">* @param array $rates Array of rates found for the package.</td>
</tr>
<tr>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-L6" class="blob-num js-line-number" data-line-number="6"> </td>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-LC6" class="blob-code blob-code-inner js-file-line">* @return array</td>
</tr>
<tr>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-L7" class="blob-num js-line-number" data-line-number="7"> </td>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-LC7" class="blob-code blob-code-inner js-file-line">*/</td>
</tr>
<tr>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-L8" class="blob-num js-line-number" data-line-number="8"> </td>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-LC8" class="blob-code blob-code-inner js-file-line">function my_hide_shipping_when_free_is_available( $rates ) {</td>
</tr>
<tr>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-L9" class="blob-num js-line-number" data-line-number="9"> </td>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-LC9" class="blob-code blob-code-inner js-file-line">$free = array();</td>
</tr>
<tr>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-L10" class="blob-num js-line-number" data-line-number="10"> </td>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-LC10" class="blob-code blob-code-inner js-file-line">foreach ( $rates as $rate_id =<span class="pl-kos">&gt;</span> $rate ) {</td>
</tr>
<tr>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-L11" class="blob-num js-line-number" data-line-number="11"> </td>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-LC11" class="blob-code blob-code-inner js-file-line">if ( &#8216;free_shipping&#8217; === $rate-<span class="pl-kos">&gt;</span>method_id ) {</td>
</tr>
<tr>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-L12" class="blob-num js-line-number" data-line-number="12"> </td>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-LC12" class="blob-code blob-code-inner js-file-line">$free[ $rate_id ] = $rate;</td>
</tr>
<tr>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-L13" class="blob-num js-line-number" data-line-number="13"> </td>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-LC13" class="blob-code blob-code-inner js-file-line">break;</td>
</tr>
<tr>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-L14" class="blob-num js-line-number" data-line-number="14"> </td>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-LC14" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
<tr>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-L15" class="blob-num js-line-number" data-line-number="15"> </td>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-LC15" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
<tr>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-L16" class="blob-num js-line-number" data-line-number="16"> </td>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-LC16" class="blob-code blob-code-inner js-file-line">return ! empty( $free ) ? $free : $rates;</td>
</tr>
<tr>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-L17" class="blob-num js-line-number" data-line-number="17"> </td>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-LC17" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
<tr>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-L18" class="blob-num js-line-number" data-line-number="18"> </td>
<td id="file-wc-hide-all-shipping-if-free-shipping-is-available-php-LC18" class="blob-code blob-code-inner js-file-line">add_filter( &#8216;woocommerce_package_rates&#8217;, &#8216;my_hide_shipping_when_free_is_available&#8217;, 100 );</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<p>&nbsp;</p>
</div>
</div>
<p>You can also use this free plugin <a href="https://wordpress.org/plugins/wc-hide-shipping-methods/">https://wordpress.org/plugins/wc-hide-shipping-methods/</a>.</p>
<h2 id="section-3" class="p1">Snippets for WC 2.5</h2>
<div id="gist88127971" class="gist">
<div class="gist-file">
<div class="gist-data">
<div class="js-gist-file-update-container js-task-list-container file-box">
<div id="file-wc-only-show-free-shipping-php" class="file my-2">
<div class="Box-body p-0 blob-wrapper data type-php  ">
<table class="highlight tab-size js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">
<tbody>
<tr>
<td id="file-wc-only-show-free-shipping-php-L1" class="blob-num js-line-number" data-line-number="1"> </td>
<td id="file-wc-only-show-free-shipping-php-LC1" class="blob-code blob-code-inner js-file-line">/**</td>
</tr>
<tr>
<td id="file-wc-only-show-free-shipping-php-L2" class="blob-num js-line-number" data-line-number="2"> </td>
<td id="file-wc-only-show-free-shipping-php-LC2" class="blob-code blob-code-inner js-file-line">* woocommerce_package_rates is a 2.1+ hook</td>
</tr>
<tr>
<td id="file-wc-only-show-free-shipping-php-L3" class="blob-num js-line-number" data-line-number="3"> </td>
<td id="file-wc-only-show-free-shipping-php-LC3" class="blob-code blob-code-inner js-file-line">*/</td>
</tr>
<tr>
<td id="file-wc-only-show-free-shipping-php-L4" class="blob-num js-line-number" data-line-number="4"> </td>
<td id="file-wc-only-show-free-shipping-php-LC4" class="blob-code blob-code-inner js-file-line">add_filter( &#8216;woocommerce_package_rates&#8217;, &#8216;hide_shipping_when_free_is_available&#8217;, 10, 2 );</td>
</tr>
<tr>
<td id="file-wc-only-show-free-shipping-php-L5" class="blob-num js-line-number" data-line-number="5"> </td>
<td id="file-wc-only-show-free-shipping-php-LC5" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-only-show-free-shipping-php-L6" class="blob-num js-line-number" data-line-number="6"> </td>
<td id="file-wc-only-show-free-shipping-php-LC6" class="blob-code blob-code-inner js-file-line">/**</td>
</tr>
<tr>
<td id="file-wc-only-show-free-shipping-php-L7" class="blob-num js-line-number" data-line-number="7"> </td>
<td id="file-wc-only-show-free-shipping-php-LC7" class="blob-code blob-code-inner js-file-line">* Hide shipping rates when free shipping is available</td>
</tr>
<tr>
<td id="file-wc-only-show-free-shipping-php-L8" class="blob-num js-line-number" data-line-number="8"> </td>
<td id="file-wc-only-show-free-shipping-php-LC8" class="blob-code blob-code-inner js-file-line">*</td>
</tr>
<tr>
<td id="file-wc-only-show-free-shipping-php-L9" class="blob-num js-line-number" data-line-number="9"> </td>
<td id="file-wc-only-show-free-shipping-php-LC9" class="blob-code blob-code-inner js-file-line">* @param array $rates Array of rates found for the package</td>
</tr>
<tr>
<td id="file-wc-only-show-free-shipping-php-L10" class="blob-num js-line-number" data-line-number="10"> </td>
<td id="file-wc-only-show-free-shipping-php-LC10" class="blob-code blob-code-inner js-file-line">* @param array $package The package array/object being shipped</td>
</tr>
<tr>
<td id="file-wc-only-show-free-shipping-php-L11" class="blob-num js-line-number" data-line-number="11"> </td>
<td id="file-wc-only-show-free-shipping-php-LC11" class="blob-code blob-code-inner js-file-line">* @return array of modified rates</td>
</tr>
<tr>
<td id="file-wc-only-show-free-shipping-php-L12" class="blob-num js-line-number" data-line-number="12"> </td>
<td id="file-wc-only-show-free-shipping-php-LC12" class="blob-code blob-code-inner js-file-line">*/</td>
</tr>
<tr>
<td id="file-wc-only-show-free-shipping-php-L13" class="blob-num js-line-number" data-line-number="13"> </td>
<td id="file-wc-only-show-free-shipping-php-LC13" class="blob-code blob-code-inner js-file-line">function hide_shipping_when_free_is_available( $rates, $package ) {</td>
</tr>
<tr>
<td id="file-wc-only-show-free-shipping-php-L14" class="blob-num js-line-number" data-line-number="14"> </td>
<td id="file-wc-only-show-free-shipping-php-LC14" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-only-show-free-shipping-php-L15" class="blob-num js-line-number" data-line-number="15"> </td>
<td id="file-wc-only-show-free-shipping-php-LC15" class="blob-code blob-code-inner js-file-line">// Only modify rates if free_shipping is present</td>
</tr>
<tr>
<td id="file-wc-only-show-free-shipping-php-L16" class="blob-num js-line-number" data-line-number="16"> </td>
<td id="file-wc-only-show-free-shipping-php-LC16" class="blob-code blob-code-inner js-file-line">if ( isset( $rates[&#8216;free_shipping&#8217;] ) ) {</td>
</tr>
<tr>
<td id="file-wc-only-show-free-shipping-php-L17" class="blob-num js-line-number" data-line-number="17"> </td>
<td id="file-wc-only-show-free-shipping-php-LC17" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-only-show-free-shipping-php-L18" class="blob-num js-line-number" data-line-number="18"> </td>
<td id="file-wc-only-show-free-shipping-php-LC18" class="blob-code blob-code-inner js-file-line">// To unset a single rate/method, do the following. This example unsets flat_rate shipping</td>
</tr>
<tr>
<td id="file-wc-only-show-free-shipping-php-L19" class="blob-num js-line-number" data-line-number="19"> </td>
<td id="file-wc-only-show-free-shipping-php-LC19" class="blob-code blob-code-inner js-file-line">unset( $rates[&#8216;flat_rate&#8217;] );</td>
</tr>
<tr>
<td id="file-wc-only-show-free-shipping-php-L20" class="blob-num js-line-number" data-line-number="20"> </td>
<td id="file-wc-only-show-free-shipping-php-LC20" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-only-show-free-shipping-php-L21" class="blob-num js-line-number" data-line-number="21"> </td>
<td id="file-wc-only-show-free-shipping-php-LC21" class="blob-code blob-code-inner js-file-line">// To unset all methods except for free_shipping, do the following</td>
</tr>
<tr>
<td id="file-wc-only-show-free-shipping-php-L22" class="blob-num js-line-number" data-line-number="22"> </td>
<td id="file-wc-only-show-free-shipping-php-LC22" class="blob-code blob-code-inner js-file-line">$free_shipping = $rates[&#8216;free_shipping&#8217;];</td>
</tr>
<tr>
<td id="file-wc-only-show-free-shipping-php-L23" class="blob-num js-line-number" data-line-number="23"> </td>
<td id="file-wc-only-show-free-shipping-php-LC23" class="blob-code blob-code-inner js-file-line">$rates = array();</td>
</tr>
<tr>
<td id="file-wc-only-show-free-shipping-php-L24" class="blob-num js-line-number" data-line-number="24"> </td>
<td id="file-wc-only-show-free-shipping-php-LC24" class="blob-code blob-code-inner js-file-line">$rates[&#8216;free_shipping&#8217;] = $free_shipping;</td>
</tr>
<tr>
<td id="file-wc-only-show-free-shipping-php-L25" class="blob-num js-line-number" data-line-number="25"> </td>
<td id="file-wc-only-show-free-shipping-php-LC25" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
<tr>
<td id="file-wc-only-show-free-shipping-php-L26" class="blob-num js-line-number" data-line-number="26"> </td>
<td id="file-wc-only-show-free-shipping-php-LC26" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-only-show-free-shipping-php-L27" class="blob-num js-line-number" data-line-number="27"> </td>
<td id="file-wc-only-show-free-shipping-php-LC27" class="blob-code blob-code-inner js-file-line">return $rates;</td>
</tr>
<tr>
<td id="file-wc-only-show-free-shipping-php-L28" class="blob-num js-line-number" data-line-number="28"> </td>
<td id="file-wc-only-show-free-shipping-php-LC28" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<p>&nbsp;</p>
</div>
</div>
<h3 id="section-4" class="p1">How do I show only Local Pickup and Free Shipping?</h3>
<p>This can be done by using this free plugin <a href="https://wordpress.org/plugins/wc-hide-shipping-methods/">https://wordpress.org/plugins/wc-hide-shipping-methods/</a> or with the following code snippet</p>
<div id="gist90540795" class="gist">
<div class="gist-file">
<div class="gist-data">
<div class="js-gist-file-update-container js-task-list-container file-box">
<div id="file-hide-all-shipping-keep-local-free-php" class="file my-2">
<div class="Box-body p-0 blob-wrapper data type-php  ">
<table class="highlight tab-size js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">
<tbody>
<tr>
<td id="file-hide-all-shipping-keep-local-free-php-L1" class="blob-num js-line-number" data-line-number="1"> </td>
<td id="file-hide-all-shipping-keep-local-free-php-LC1" class="blob-code blob-code-inner js-file-line">/**</td>
</tr>
<tr>
<td id="file-hide-all-shipping-keep-local-free-php-L2" class="blob-num js-line-number" data-line-number="2"> </td>
<td id="file-hide-all-shipping-keep-local-free-php-LC2" class="blob-code blob-code-inner js-file-line">* Hide shipping rates when free shipping is available, but keep &#8220;Local pickup&#8221;</td>
</tr>
<tr>
<td id="file-hide-all-shipping-keep-local-free-php-L3" class="blob-num js-line-number" data-line-number="3"> </td>
<td id="file-hide-all-shipping-keep-local-free-php-LC3" class="blob-code blob-code-inner js-file-line">* Updated to support WooCommerce 2.6 Shipping Zones</td>
</tr>
<tr>
<td id="file-hide-all-shipping-keep-local-free-php-L4" class="blob-num js-line-number" data-line-number="4"> </td>
<td id="file-hide-all-shipping-keep-local-free-php-LC4" class="blob-code blob-code-inner js-file-line">*/</td>
</tr>
<tr>
<td id="file-hide-all-shipping-keep-local-free-php-L5" class="blob-num js-line-number" data-line-number="5"> </td>
<td id="file-hide-all-shipping-keep-local-free-php-LC5" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-hide-all-shipping-keep-local-free-php-L6" class="blob-num js-line-number" data-line-number="6"> </td>
<td id="file-hide-all-shipping-keep-local-free-php-LC6" class="blob-code blob-code-inner js-file-line">function hide_shipping_when_free_is_available( $rates, $package ) {</td>
</tr>
<tr>
<td id="file-hide-all-shipping-keep-local-free-php-L7" class="blob-num js-line-number" data-line-number="7"> </td>
<td id="file-hide-all-shipping-keep-local-free-php-LC7" class="blob-code blob-code-inner js-file-line">$new_rates = array();</td>
</tr>
<tr>
<td id="file-hide-all-shipping-keep-local-free-php-L8" class="blob-num js-line-number" data-line-number="8"> </td>
<td id="file-hide-all-shipping-keep-local-free-php-LC8" class="blob-code blob-code-inner js-file-line">foreach ( $rates as $rate_id =<span class="pl-kos">&gt;</span> $rate ) {</td>
</tr>
<tr>
<td id="file-hide-all-shipping-keep-local-free-php-L9" class="blob-num js-line-number" data-line-number="9"> </td>
<td id="file-hide-all-shipping-keep-local-free-php-LC9" class="blob-code blob-code-inner js-file-line">// Only modify rates if free_shipping is present.</td>
</tr>
<tr>
<td id="file-hide-all-shipping-keep-local-free-php-L10" class="blob-num js-line-number" data-line-number="10"> </td>
<td id="file-hide-all-shipping-keep-local-free-php-LC10" class="blob-code blob-code-inner js-file-line">if ( &#8216;free_shipping&#8217; === $rate-<span class="pl-kos">&gt;</span>method_id ) {</td>
</tr>
<tr>
<td id="file-hide-all-shipping-keep-local-free-php-L11" class="blob-num js-line-number" data-line-number="11"> </td>
<td id="file-hide-all-shipping-keep-local-free-php-LC11" class="blob-code blob-code-inner js-file-line">$new_rates[ $rate_id ] = $rate;</td>
</tr>
<tr>
<td id="file-hide-all-shipping-keep-local-free-php-L12" class="blob-num js-line-number" data-line-number="12"> </td>
<td id="file-hide-all-shipping-keep-local-free-php-LC12" class="blob-code blob-code-inner js-file-line">break;</td>
</tr>
<tr>
<td id="file-hide-all-shipping-keep-local-free-php-L13" class="blob-num js-line-number" data-line-number="13"> </td>
<td id="file-hide-all-shipping-keep-local-free-php-LC13" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
<tr>
<td id="file-hide-all-shipping-keep-local-free-php-L14" class="blob-num js-line-number" data-line-number="14"> </td>
<td id="file-hide-all-shipping-keep-local-free-php-LC14" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
<tr>
<td id="file-hide-all-shipping-keep-local-free-php-L15" class="blob-num js-line-number" data-line-number="15"> </td>
<td id="file-hide-all-shipping-keep-local-free-php-LC15" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-hide-all-shipping-keep-local-free-php-L16" class="blob-num js-line-number" data-line-number="16"> </td>
<td id="file-hide-all-shipping-keep-local-free-php-LC16" class="blob-code blob-code-inner js-file-line">if ( ! empty( $new_rates ) ) {</td>
</tr>
<tr>
<td id="file-hide-all-shipping-keep-local-free-php-L17" class="blob-num js-line-number" data-line-number="17"> </td>
<td id="file-hide-all-shipping-keep-local-free-php-LC17" class="blob-code blob-code-inner js-file-line">//Save local pickup if it&#8217;s present.</td>
</tr>
<tr>
<td id="file-hide-all-shipping-keep-local-free-php-L18" class="blob-num js-line-number" data-line-number="18"> </td>
<td id="file-hide-all-shipping-keep-local-free-php-LC18" class="blob-code blob-code-inner js-file-line">foreach ( $rates as $rate_id =<span class="pl-kos">&gt;</span> $rate ) {</td>
</tr>
<tr>
<td id="file-hide-all-shipping-keep-local-free-php-L19" class="blob-num js-line-number" data-line-number="19"> </td>
<td id="file-hide-all-shipping-keep-local-free-php-LC19" class="blob-code blob-code-inner js-file-line">if (&#8216;local_pickup&#8217; === $rate-<span class="pl-kos">&gt;</span>method_id ) {</td>
</tr>
<tr>
<td id="file-hide-all-shipping-keep-local-free-php-L20" class="blob-num js-line-number" data-line-number="20"> </td>
<td id="file-hide-all-shipping-keep-local-free-php-LC20" class="blob-code blob-code-inner js-file-line">$new_rates[ $rate_id ] = $rate;</td>
</tr>
<tr>
<td id="file-hide-all-shipping-keep-local-free-php-L21" class="blob-num js-line-number" data-line-number="21"> </td>
<td id="file-hide-all-shipping-keep-local-free-php-LC21" class="blob-code blob-code-inner js-file-line">break;</td>
</tr>
<tr>
<td id="file-hide-all-shipping-keep-local-free-php-L22" class="blob-num js-line-number" data-line-number="22"> </td>
<td id="file-hide-all-shipping-keep-local-free-php-LC22" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
<tr>
<td id="file-hide-all-shipping-keep-local-free-php-L23" class="blob-num js-line-number" data-line-number="23"> </td>
<td id="file-hide-all-shipping-keep-local-free-php-LC23" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
<tr>
<td id="file-hide-all-shipping-keep-local-free-php-L24" class="blob-num js-line-number" data-line-number="24"> </td>
<td id="file-hide-all-shipping-keep-local-free-php-LC24" class="blob-code blob-code-inner js-file-line">return $new_rates;</td>
</tr>
<tr>
<td id="file-hide-all-shipping-keep-local-free-php-L25" class="blob-num js-line-number" data-line-number="25"> </td>
<td id="file-hide-all-shipping-keep-local-free-php-LC25" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
<tr>
<td id="file-hide-all-shipping-keep-local-free-php-L26" class="blob-num js-line-number" data-line-number="26"> </td>
<td id="file-hide-all-shipping-keep-local-free-php-LC26" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-hide-all-shipping-keep-local-free-php-L27" class="blob-num js-line-number" data-line-number="27"> </td>
<td id="file-hide-all-shipping-keep-local-free-php-LC27" class="blob-code blob-code-inner js-file-line">return $rates;</td>
</tr>
<tr>
<td id="file-hide-all-shipping-keep-local-free-php-L28" class="blob-num js-line-number" data-line-number="28"> </td>
<td id="file-hide-all-shipping-keep-local-free-php-LC28" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
<tr>
<td id="file-hide-all-shipping-keep-local-free-php-L29" class="blob-num js-line-number" data-line-number="29"> </td>
<td id="file-hide-all-shipping-keep-local-free-php-LC29" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-hide-all-shipping-keep-local-free-php-L30" class="blob-num js-line-number" data-line-number="30"> </td>
<td id="file-hide-all-shipping-keep-local-free-php-LC30" class="blob-code blob-code-inner js-file-line">add_filter( &#8216;woocommerce_package_rates&#8217;, &#8216;hide_shipping_when_free_is_available&#8217;, 10, 2 );</td>
</tr>
</tbody>
</table>
</div>
<p>&nbsp;</p>
</div>
</div>
</div>
<p>&nbsp;</p>
</div>
</div>
<h3 id="section-5">Show only free shipping in all states except…</h3>
<p>Show only free shipping in all states except the exclusion list. Hide free shipping if the customer is in one of the states listed:</p>
<div id="gist88128124" class="gist">
<div class="gist-file">
<div class="gist-data">
<div class="js-gist-file-update-container js-task-list-container file-box">
<div id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php" class="file my-2">
<div class="Box-body p-0 blob-wrapper data type-php  ">
<table class="highlight tab-size js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">
<tbody>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L1" class="blob-num js-line-number" data-line-number="1"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC1" class="blob-code blob-code-inner js-file-line">/**</td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L2" class="blob-num js-line-number" data-line-number="2"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC2" class="blob-code blob-code-inner js-file-line">* Hide ALL shipping options when free shipping is available and customer is NOT in certain states</td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L3" class="blob-num js-line-number" data-line-number="3"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC3" class="blob-code blob-code-inner js-file-line">*</td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L4" class="blob-num js-line-number" data-line-number="4"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC4" class="blob-code blob-code-inner js-file-line">* Change $excluded_states = array( &#8216;AK&#8217;,&#8217;HI&#8217;,&#8217;GU&#8217;,&#8217;PR&#8217; ); to include all the states that DO NOT have free shipping</td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L5" class="blob-num js-line-number" data-line-number="5"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC5" class="blob-code blob-code-inner js-file-line">*/</td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L6" class="blob-num js-line-number" data-line-number="6"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC6" class="blob-code blob-code-inner js-file-line">add_filter( &#8216;woocommerce_package_rates&#8217;, &#8216;hide_all_shipping_when_free_is_available&#8217; , 10, 2 );</td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L7" class="blob-num js-line-number" data-line-number="7"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC7" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L8" class="blob-num js-line-number" data-line-number="8"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC8" class="blob-code blob-code-inner js-file-line">/**</td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L9" class="blob-num js-line-number" data-line-number="9"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC9" class="blob-code blob-code-inner js-file-line">* Hide ALL Shipping option when free shipping is available</td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L10" class="blob-num js-line-number" data-line-number="10"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC10" class="blob-code blob-code-inner js-file-line">*</td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L11" class="blob-num js-line-number" data-line-number="11"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC11" class="blob-code blob-code-inner js-file-line">* @param array $available_methods</td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L12" class="blob-num js-line-number" data-line-number="12"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC12" class="blob-code blob-code-inner js-file-line">*/</td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L13" class="blob-num js-line-number" data-line-number="13"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC13" class="blob-code blob-code-inner js-file-line">function hide_all_shipping_when_free_is_available( $rates, $package ) {</td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L14" class="blob-num js-line-number" data-line-number="14"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC14" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L15" class="blob-num js-line-number" data-line-number="15"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC15" class="blob-code blob-code-inner js-file-line">$excluded_states = array( &#8216;AK&#8217;,&#8217;HI&#8217;,&#8217;GU&#8217;,&#8217;PR&#8217; );</td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L16" class="blob-num js-line-number" data-line-number="16"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC16" class="blob-code blob-code-inner js-file-line">if( isset( $rates[&#8216;free_shipping&#8217;] ) AND !in_array( WC()-<span class="pl-kos">&gt;</span>customer-<span class="pl-kos">&gt;</span>shipping_state, $excluded_states ) ) :</td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L17" class="blob-num js-line-number" data-line-number="17"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC17" class="blob-code blob-code-inner js-file-line">// Get Free Shipping array into a new array</td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L18" class="blob-num js-line-number" data-line-number="18"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC18" class="blob-code blob-code-inner js-file-line">$freeshipping = array();</td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L19" class="blob-num js-line-number" data-line-number="19"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC19" class="blob-code blob-code-inner js-file-line">$freeshipping = $rates[&#8216;free_shipping&#8217;];</td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L20" class="blob-num js-line-number" data-line-number="20"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC20" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L21" class="blob-num js-line-number" data-line-number="21"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC21" class="blob-code blob-code-inner js-file-line">// Empty the $available_methods array</td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L22" class="blob-num js-line-number" data-line-number="22"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC22" class="blob-code blob-code-inner js-file-line">unset( $rates );</td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L23" class="blob-num js-line-number" data-line-number="23"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC23" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L24" class="blob-num js-line-number" data-line-number="24"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC24" class="blob-code blob-code-inner js-file-line">// Add Free Shipping back into $avaialble_methods</td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L25" class="blob-num js-line-number" data-line-number="25"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC25" class="blob-code blob-code-inner js-file-line">$rates = array();</td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L26" class="blob-num js-line-number" data-line-number="26"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC26" class="blob-code blob-code-inner js-file-line">$rates[] = $freeshipping;</td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L27" class="blob-num js-line-number" data-line-number="27"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC27" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L28" class="blob-num js-line-number" data-line-number="28"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC28" class="blob-code blob-code-inner js-file-line">endif;</td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L29" class="blob-num js-line-number" data-line-number="29"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC29" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L30" class="blob-num js-line-number" data-line-number="30"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC30" class="blob-code blob-code-inner js-file-line">if( isset( $rates[&#8216;free_shipping&#8217;] ) AND in_array( WC()-<span class="pl-kos">&gt;</span>customer-<span class="pl-kos">&gt;</span>shipping_state, $excluded_states ) ) {</td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L31" class="blob-num js-line-number" data-line-number="31"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC31" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L32" class="blob-num js-line-number" data-line-number="32"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC32" class="blob-code blob-code-inner js-file-line">// remove free shipping option</td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L33" class="blob-num js-line-number" data-line-number="33"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC33" class="blob-code blob-code-inner js-file-line">unset( $rates[&#8216;free_shipping&#8217;] );</td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L34" class="blob-num js-line-number" data-line-number="34"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC34" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L35" class="blob-num js-line-number" data-line-number="35"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC35" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L36" class="blob-num js-line-number" data-line-number="36"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC36" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L37" class="blob-num js-line-number" data-line-number="37"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC37" class="blob-code blob-code-inner js-file-line">return $rates;</td>
</tr>
<tr>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-L38" class="blob-num js-line-number" data-line-number="38"> </td>
<td id="file-wc-show-free-shipping-for-states-not-on-the-exclusion-list-php-LC38" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
</tbody>
</table>
</div>
<p>&nbsp;</p>
</div>
</div>
</div>
<p>&nbsp;</p>
</div>
</div>
<h3 id="section-6">Enable Shipping Methods on a per Class / Product Basis, split orders, or other scenarios?</h3>
<p>Need more flexibility? Take a look through our premium Shipping Method extensions.</p><p>The post <a href="https://help.codibu.com/blog/hide-other-shipping-methods-when-free-shipping-is-available/">Hide other shipping methods when “Free Shipping” is available</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://help.codibu.com/blog/hide-other-shipping-methods-when-free-shipping-is-available/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>States/counties (not in core)</title>
		<link>https://help.codibu.com/blog/states-counties-not-in-core/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=states-counties-not-in-core</link>
					<comments>https://help.codibu.com/blog/states-counties-not-in-core/#respond</comments>
		
		<dc:creator><![CDATA[JN C]]></dc:creator>
		<pubDate>Mon, 09 Nov 2020 06:47:22 +0000</pubDate>
				<guid isPermaLink="false">https://help.codibu.com/kb/states-counties-not-in-core/</guid>

					<description><![CDATA[<p>To add or modify your own states, please use the snippet at: Add/Modify States. United Kingdom WooCommerce UK Counties Plugin by Lee Willis on GitHub</p>
<p>The post <a href="https://help.codibu.com/blog/states-counties-not-in-core/">States/counties (not in core)</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>To add or modify your own states, please use the snippet at: <a href="https://help.codibu.com/blog/kb/add-modify-states/" rel="noopener noreferrer">Add/Modify States</a>.</p>
<h1 id="united-kingdom">United Kingdom</h1>
<p>WooCommerce UK Counties Plugin by Lee Willis on GitHub</p><p>The post <a href="https://help.codibu.com/blog/states-counties-not-in-core/">States/counties (not in core)</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://help.codibu.com/blog/states-counties-not-in-core/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Add/Modify States</title>
		<link>https://help.codibu.com/blog/add-modify-states/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=add-modify-states</link>
					<comments>https://help.codibu.com/blog/add-modify-states/#respond</comments>
		
		<dc:creator><![CDATA[JN C]]></dc:creator>
		<pubDate>Mon, 09 Nov 2020 06:46:52 +0000</pubDate>
				<guid isPermaLink="false">https://help.codibu.com/kb/add-modify-states/</guid>

					<description><![CDATA[<p>Add code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Avoid adding custom code directly<span class="excerpt-hellip"> […]</span></p>
<p>The post <a href="https://help.codibu.com/blog/add-modify-states/">Add/Modify States</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><span class="s1">Add code to your child theme’s <code>functions.php</code> file or via a plugin that allows custom functions to be added, such as the <a href="https://wordpress.org/plugins/code-snippets/">Code snippets</a> plugin. Avoid adding custom code directly to your parent theme’s <code>functions.php</code> file as this will be wiped entirely when you update the theme.</span></p>
<p>Add your own or modify shipping states in WooCommerce.</p>
<p>Note: You <strong>must</strong> replace both instances of <em>XX</em> with your country code. This means each state id in the array must have your two letter country code before the number you assign to the state.</p>
<div id="gist88125977" class="gist">
<div class="gist-file">
<div class="gist-data">
<div class="js-gist-file-update-container js-task-list-container file-box">
<div id="file-wc-add-modify-states-php" class="file my-2">
<div class="Box-body p-0 blob-wrapper data type-php  ">
<table class="highlight tab-size js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">
<tbody>
<tr>
<td id="file-wc-add-modify-states-php-L1" class="blob-num js-line-number" data-line-number="1"> </td>
<td id="file-wc-add-modify-states-php-LC1" class="blob-code blob-code-inner js-file-line">/**</td>
</tr>
<tr>
<td id="file-wc-add-modify-states-php-L2" class="blob-num js-line-number" data-line-number="2"> </td>
<td id="file-wc-add-modify-states-php-LC2" class="blob-code blob-code-inner js-file-line">* Add or modify States</td>
</tr>
<tr>
<td id="file-wc-add-modify-states-php-L3" class="blob-num js-line-number" data-line-number="3"> </td>
<td id="file-wc-add-modify-states-php-LC3" class="blob-code blob-code-inner js-file-line">*/</td>
</tr>
<tr>
<td id="file-wc-add-modify-states-php-L4" class="blob-num js-line-number" data-line-number="4"> </td>
<td id="file-wc-add-modify-states-php-LC4" class="blob-code blob-code-inner js-file-line">add_filter( &#8216;woocommerce_states&#8217;, &#8216;custom_woocommerce_states&#8217; );</td>
</tr>
<tr>
<td id="file-wc-add-modify-states-php-L5" class="blob-num js-line-number" data-line-number="5"> </td>
<td id="file-wc-add-modify-states-php-LC5" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-add-modify-states-php-L6" class="blob-num js-line-number" data-line-number="6"> </td>
<td id="file-wc-add-modify-states-php-LC6" class="blob-code blob-code-inner js-file-line">function custom_woocommerce_states( $states ) {</td>
</tr>
<tr>
<td id="file-wc-add-modify-states-php-L7" class="blob-num js-line-number" data-line-number="7"> </td>
<td id="file-wc-add-modify-states-php-LC7" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-add-modify-states-php-L8" class="blob-num js-line-number" data-line-number="8"> </td>
<td id="file-wc-add-modify-states-php-LC8" class="blob-code blob-code-inner js-file-line">$states[&#8216;XX&#8217;] = array(</td>
</tr>
<tr>
<td id="file-wc-add-modify-states-php-L9" class="blob-num js-line-number" data-line-number="9"> </td>
<td id="file-wc-add-modify-states-php-LC9" class="blob-code blob-code-inner js-file-line">&#8216;XX1&#8217; =<span class="pl-kos">&gt;</span> &#8216;State 1&#8217;,</td>
</tr>
<tr>
<td id="file-wc-add-modify-states-php-L10" class="blob-num js-line-number" data-line-number="10"> </td>
<td id="file-wc-add-modify-states-php-LC10" class="blob-code blob-code-inner js-file-line">&#8216;XX2&#8217; =<span class="pl-kos">&gt;</span> &#8216;State 2&#8217;</td>
</tr>
<tr>
<td id="file-wc-add-modify-states-php-L11" class="blob-num js-line-number" data-line-number="11"> </td>
<td id="file-wc-add-modify-states-php-LC11" class="blob-code blob-code-inner js-file-line">);</td>
</tr>
<tr>
<td id="file-wc-add-modify-states-php-L12" class="blob-num js-line-number" data-line-number="12"> </td>
<td id="file-wc-add-modify-states-php-LC12" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-add-modify-states-php-L13" class="blob-num js-line-number" data-line-number="13"> </td>
<td id="file-wc-add-modify-states-php-LC13" class="blob-code blob-code-inner js-file-line">return $states;</td>
</tr>
<tr>
<td id="file-wc-add-modify-states-php-L14" class="blob-num js-line-number" data-line-number="14"> </td>
<td id="file-wc-add-modify-states-php-LC14" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div><p>The post <a href="https://help.codibu.com/blog/add-modify-states/">Add/Modify States</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://help.codibu.com/blog/add-modify-states/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Display product dimensions on archive pages</title>
		<link>https://help.codibu.com/blog/display-product-dimensions-on-archive-pages/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=display-product-dimensions-on-archive-pages</link>
					<comments>https://help.codibu.com/blog/display-product-dimensions-on-archive-pages/#respond</comments>
		
		<dc:creator><![CDATA[JN C]]></dc:creator>
		<pubDate>Mon, 09 Nov 2020 06:46:27 +0000</pubDate>
				<guid isPermaLink="false">https://help.codibu.com/kb/display-product-dimensions-on-archive-pages/</guid>

					<description><![CDATA[<p>You need to add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Please<span class="excerpt-hellip"> […]</span></p>
<p>The post <a href="https://help.codibu.com/blog/display-product-dimensions-on-archive-pages/">Display product dimensions on archive pages</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><span class="s1">You need to add this code to your child theme’s <code>functions.php</code> file or via a plugin that allows custom functions to be added, such as the <a href="https://wordpress.org/plugins/code-snippets/">Code snippets</a> plugin. Please don’t add custom code directly to your parent theme’s <code>functions.php</code> file as this will be wiped entirely when you update the theme.</span></p>
<p>Display WooCommerce product dimensions on archive pages, below the title of the product.</p>
<h2 id="section-1">WooCommerce version 3.0+</h2>
<div id="gist88125678" class="gist">
<div class="gist-file">
<div class="gist-data">
<div class="js-gist-file-update-container js-task-list-container file-box">
<div id="file-wc-display-product-dimensions-3-and-above-php" class="file my-2">
<div class="Box-body p-0 blob-wrapper data type-php  ">
<table class="highlight tab-size js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">
<tbody>
<tr>
<td id="file-wc-display-product-dimensions-3-and-above-php-L1" class="blob-num js-line-number" data-line-number="1"> </td>
<td id="file-wc-display-product-dimensions-3-and-above-php-LC1" class="blob-code blob-code-inner js-file-line">/**</td>
</tr>
<tr>
<td id="file-wc-display-product-dimensions-3-and-above-php-L2" class="blob-num js-line-number" data-line-number="2"> </td>
<td id="file-wc-display-product-dimensions-3-and-above-php-LC2" class="blob-code blob-code-inner js-file-line">* Show product dimensions on archive pages for WC 3+</td>
</tr>
<tr>
<td id="file-wc-display-product-dimensions-3-and-above-php-L3" class="blob-num js-line-number" data-line-number="3"> </td>
<td id="file-wc-display-product-dimensions-3-and-above-php-LC3" class="blob-code blob-code-inner js-file-line">*/</td>
</tr>
<tr>
<td id="file-wc-display-product-dimensions-3-and-above-php-L4" class="blob-num js-line-number" data-line-number="4"> </td>
<td id="file-wc-display-product-dimensions-3-and-above-php-LC4" class="blob-code blob-code-inner js-file-line">add_action( &#8216;woocommerce_after_shop_loop_item&#8217;, &#8216;rs_show_dimensions&#8217;, 9 );</td>
</tr>
<tr>
<td id="file-wc-display-product-dimensions-3-and-above-php-L5" class="blob-num js-line-number" data-line-number="5"> </td>
<td id="file-wc-display-product-dimensions-3-and-above-php-LC5" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-display-product-dimensions-3-and-above-php-L6" class="blob-num js-line-number" data-line-number="6"> </td>
<td id="file-wc-display-product-dimensions-3-and-above-php-LC6" class="blob-code blob-code-inner js-file-line">function rs_show_dimensions() {</td>
</tr>
<tr>
<td id="file-wc-display-product-dimensions-3-and-above-php-L7" class="blob-num js-line-number" data-line-number="7"> </td>
<td id="file-wc-display-product-dimensions-3-and-above-php-LC7" class="blob-code blob-code-inner js-file-line">global $product;</td>
</tr>
<tr>
<td id="file-wc-display-product-dimensions-3-and-above-php-L8" class="blob-num js-line-number" data-line-number="8"> </td>
<td id="file-wc-display-product-dimensions-3-and-above-php-LC8" class="blob-code blob-code-inner js-file-line">$dimensions = wc_format_dimensions($product-<span class="pl-kos">&gt;</span>get_dimensions(false));</td>
</tr>
<tr>
<td id="file-wc-display-product-dimensions-3-and-above-php-L9" class="blob-num js-line-number" data-line-number="9"> </td>
<td id="file-wc-display-product-dimensions-3-and-above-php-LC9" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-display-product-dimensions-3-and-above-php-L10" class="blob-num js-line-number" data-line-number="10"> </td>
<td id="file-wc-display-product-dimensions-3-and-above-php-LC10" class="blob-code blob-code-inner js-file-line">if ( $product-<span class="pl-kos">&gt;</span>has_dimensions() ) {</td>
</tr>
<tr>
<td id="file-wc-display-product-dimensions-3-and-above-php-L11" class="blob-num js-line-number" data-line-number="11"> </td>
<td id="file-wc-display-product-dimensions-3-and-above-php-LC11" class="blob-code blob-code-inner js-file-line">echo &#8216;<span class="pl-kos">&lt;</span><span class="pl-ent">div</span> <span class="pl-c1">class</span>=&#8221;<span class="pl-s">product-meta</span>&#8220;<span class="pl-kos">&gt;</span><span class="pl-kos">&lt;</span><span class="pl-ent">span</span> <span class="pl-c1">class</span>=&#8221;<span class="pl-s">product-meta-label</span>&#8220;<span class="pl-kos">&gt;</span>Dimensions: <span class="pl-kos">&lt;/</span><span class="pl-ent">span</span><span class="pl-kos">&gt;</span>&#8216; . $dimensions . &#8216;<span class="pl-kos">&lt;/</span><span class="pl-ent">div</span><span class="pl-kos">&gt;</span>&#8216;;</td>
</tr>
<tr>
<td id="file-wc-display-product-dimensions-3-and-above-php-L12" class="blob-num js-line-number" data-line-number="12"> </td>
<td id="file-wc-display-product-dimensions-3-and-above-php-LC12" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
<tr>
<td id="file-wc-display-product-dimensions-3-and-above-php-L13" class="blob-num js-line-number" data-line-number="13"> </td>
<td id="file-wc-display-product-dimensions-3-and-above-php-LC13" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<h2 id="section-2">WooCommerce version lower than 3.0</h2>
<div id="gist88125738" class="gist">
<div class="gist-file">
<div class="gist-data">
<div class="js-gist-file-update-container js-task-list-container file-box">
<div id="file-wc-display-product-dimensions-below-3-php" class="file my-2">
<div class="Box-body p-0 blob-wrapper data type-php  ">
<table class="highlight tab-size js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">
<tbody>
<tr>
<td id="file-wc-display-product-dimensions-below-3-php-L1" class="blob-num js-line-number" data-line-number="1"> </td>
<td id="file-wc-display-product-dimensions-below-3-php-LC1" class="blob-code blob-code-inner js-file-line">/**</td>
</tr>
<tr>
<td id="file-wc-display-product-dimensions-below-3-php-L2" class="blob-num js-line-number" data-line-number="2"> </td>
<td id="file-wc-display-product-dimensions-below-3-php-LC2" class="blob-code blob-code-inner js-file-line">* Show product dimensions on archive pages WC 3 and below</td>
</tr>
<tr>
<td id="file-wc-display-product-dimensions-below-3-php-L3" class="blob-num js-line-number" data-line-number="3"> </td>
<td id="file-wc-display-product-dimensions-below-3-php-LC3" class="blob-code blob-code-inner js-file-line">*/</td>
</tr>
<tr>
<td id="file-wc-display-product-dimensions-below-3-php-L4" class="blob-num js-line-number" data-line-number="4"> </td>
<td id="file-wc-display-product-dimensions-below-3-php-LC4" class="blob-code blob-code-inner js-file-line">add_action( &#8216;woocommerce_after_shop_loop_item_title&#8217;, &#8216;wc_show_dimensions&#8217;, 9 );</td>
</tr>
<tr>
<td id="file-wc-display-product-dimensions-below-3-php-L5" class="blob-num js-line-number" data-line-number="5"> </td>
<td id="file-wc-display-product-dimensions-below-3-php-LC5" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-display-product-dimensions-below-3-php-L6" class="blob-num js-line-number" data-line-number="6"> </td>
<td id="file-wc-display-product-dimensions-below-3-php-LC6" class="blob-code blob-code-inner js-file-line">function wc_show_dimensions() {</td>
</tr>
<tr>
<td id="file-wc-display-product-dimensions-below-3-php-L7" class="blob-num js-line-number" data-line-number="7"> </td>
<td id="file-wc-display-product-dimensions-below-3-php-LC7" class="blob-code blob-code-inner js-file-line">global $product;</td>
</tr>
<tr>
<td id="file-wc-display-product-dimensions-below-3-php-L8" class="blob-num js-line-number" data-line-number="8"> </td>
<td id="file-wc-display-product-dimensions-below-3-php-LC8" class="blob-code blob-code-inner js-file-line">$dimensions = $product-<span class="pl-kos">&gt;</span>get_dimensions();</td>
</tr>
<tr>
<td id="file-wc-display-product-dimensions-below-3-php-L9" class="blob-num js-line-number" data-line-number="9"> </td>
<td id="file-wc-display-product-dimensions-below-3-php-LC9" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-display-product-dimensions-below-3-php-L10" class="blob-num js-line-number" data-line-number="10"> </td>
<td id="file-wc-display-product-dimensions-below-3-php-LC10" class="blob-code blob-code-inner js-file-line">if ( ! empty( $dimensions ) ) {</td>
</tr>
<tr>
<td id="file-wc-display-product-dimensions-below-3-php-L11" class="blob-num js-line-number" data-line-number="11"> </td>
<td id="file-wc-display-product-dimensions-below-3-php-LC11" class="blob-code blob-code-inner js-file-line">echo &#8216;<span class="pl-kos">&lt;</span><span class="pl-ent">span</span> <span class="pl-c1">class</span>=&#8221;<span class="pl-s">dimensions</span>&#8220;<span class="pl-kos">&gt;</span>&#8216; . $dimensions . &#8216;<span class="pl-kos">&lt;/</span><span class="pl-ent">span</span><span class="pl-kos">&gt;</span>&#8216;;</td>
</tr>
<tr>
<td id="file-wc-display-product-dimensions-below-3-php-L12" class="blob-num js-line-number" data-line-number="12"> </td>
<td id="file-wc-display-product-dimensions-below-3-php-LC12" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
<tr>
<td id="file-wc-display-product-dimensions-below-3-php-L13" class="blob-num js-line-number" data-line-number="13"> </td>
<td id="file-wc-display-product-dimensions-below-3-php-LC13" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div><p>The post <a href="https://help.codibu.com/blog/display-product-dimensions-on-archive-pages/">Display product dimensions on archive pages</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://help.codibu.com/blog/display-product-dimensions-on-archive-pages/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Hide trailing zeros on prices</title>
		<link>https://help.codibu.com/blog/hide-trailing-zeros-on-prices/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=hide-trailing-zeros-on-prices</link>
					<comments>https://help.codibu.com/blog/hide-trailing-zeros-on-prices/#respond</comments>
		
		<dc:creator><![CDATA[JN C]]></dc:creator>
		<pubDate>Mon, 09 Nov 2020 06:45:57 +0000</pubDate>
				<guid isPermaLink="false">https://help.codibu.com/kb/hide-trailing-zeros-on-prices/</guid>

					<description><![CDATA[<p>The option to show trailing zeros on your prices has been removed in favor of a filter, as of WooCommerce 2.2x. If you want to hide<span class="excerpt-hellip"> […]</span></p>
<p>The post <a href="https://help.codibu.com/blog/hide-trailing-zeros-on-prices/">Hide trailing zeros on prices</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>The option to show trailing zeros on your prices has been removed in favor of a filter, as of WooCommerce 2.2x.</p>
<p>If you want to hide trailing zeros on your prices add the following code to your <em>Theme’s</em> functions.php file. After doing this your prices will not show the trailing zeros.</p>
<div id="gist92099342" class="gist">
<div class="gist-file">
<div class="gist-data">
<div class="js-gist-file-update-container js-task-list-container file-box">
<div id="file-hide-trailing-zeros-on-prices-php" class="file my-2">
<div class="Box-body p-0 blob-wrapper data type-php  ">
<table class="highlight tab-size js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">
<tbody>
<tr>
<td id="file-hide-trailing-zeros-on-prices-php-L1" class="blob-num js-line-number" data-line-number="1"> </td>
<td id="file-hide-trailing-zeros-on-prices-php-LC1" class="blob-code blob-code-inner js-file-line">/**</td>
</tr>
<tr>
<td id="file-hide-trailing-zeros-on-prices-php-L2" class="blob-num js-line-number" data-line-number="2"> </td>
<td id="file-hide-trailing-zeros-on-prices-php-LC2" class="blob-code blob-code-inner js-file-line">* Trim zeros in price decimals</td>
</tr>
<tr>
<td id="file-hide-trailing-zeros-on-prices-php-L3" class="blob-num js-line-number" data-line-number="3"> </td>
<td id="file-hide-trailing-zeros-on-prices-php-LC3" class="blob-code blob-code-inner js-file-line">**/</td>
</tr>
<tr>
<td id="file-hide-trailing-zeros-on-prices-php-L4" class="blob-num js-line-number" data-line-number="4"> </td>
<td id="file-hide-trailing-zeros-on-prices-php-LC4" class="blob-code blob-code-inner js-file-line">add_filter( &#8216;woocommerce_price_trim_zeros&#8217;, &#8216;__return_true&#8217; );</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div><p>The post <a href="https://help.codibu.com/blog/hide-trailing-zeros-on-prices/">Hide trailing zeros on prices</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://help.codibu.com/blog/hide-trailing-zeros-on-prices/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Display product attribute archive links</title>
		<link>https://help.codibu.com/blog/display-product-attribute-archive-links/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=display-product-attribute-archive-links</link>
					<comments>https://help.codibu.com/blog/display-product-attribute-archive-links/#respond</comments>
		
		<dc:creator><![CDATA[JN C]]></dc:creator>
		<pubDate>Mon, 09 Nov 2020 06:45:30 +0000</pubDate>
				<guid isPermaLink="false">https://help.codibu.com/kb/display-product-attribute-archive-links/</guid>

					<description><![CDATA[<p>You will need to add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin.<span class="excerpt-hellip"> […]</span></p>
<p>The post <a href="https://help.codibu.com/blog/display-product-attribute-archive-links/">Display product attribute archive links</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><span class="s1">You will need to add this code to your child theme’s <code>functions.php</code> file or via a plugin that allows custom functions to be added, such as the <a href="https://wordpress.org/plugins/code-snippets/">Code snippets</a> plugin. Please don’t add custom code directly to your parent theme’s <code>functions.php</code> file as this will be wiped entirely when you update the theme.</span></p>
<h2 id="section-1">Display product attribute archive links</h2>
<p>Display WooCommerce product attribute archive links on the product page, right below the add to cart button.</p>
<div id="gist88124806" class="gist">
<div class="gist-file">
<div class="gist-data">
<div class="js-gist-file-update-container js-task-list-container file-box">
<div id="file-wc-display-product-attribute-archive-links-php" class="file my-2">
<div class="Box-body p-0 blob-wrapper data type-php  ">
<table class="highlight tab-size js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">
<tbody>
<tr>
<td id="file-wc-display-product-attribute-archive-links-php-L1" class="blob-num js-line-number" data-line-number="1"> </td>
<td id="file-wc-display-product-attribute-archive-links-php-LC1" class="blob-code blob-code-inner js-file-line">/**</td>
</tr>
<tr>
<td id="file-wc-display-product-attribute-archive-links-php-L2" class="blob-num js-line-number" data-line-number="2"> </td>
<td id="file-wc-display-product-attribute-archive-links-php-LC2" class="blob-code blob-code-inner js-file-line">* Display product attribute archive links</td>
</tr>
<tr>
<td id="file-wc-display-product-attribute-archive-links-php-L3" class="blob-num js-line-number" data-line-number="3"> </td>
<td id="file-wc-display-product-attribute-archive-links-php-LC3" class="blob-code blob-code-inner js-file-line">*/</td>
</tr>
<tr>
<td id="file-wc-display-product-attribute-archive-links-php-L4" class="blob-num js-line-number" data-line-number="4"> </td>
<td id="file-wc-display-product-attribute-archive-links-php-LC4" class="blob-code blob-code-inner js-file-line">add_action( &#8216;woocommerce_product_meta_end&#8217;, &#8216;wc_show_attribute_links&#8217; );</td>
</tr>
<tr>
<td id="file-wc-display-product-attribute-archive-links-php-L5" class="blob-num js-line-number" data-line-number="5"> </td>
<td id="file-wc-display-product-attribute-archive-links-php-LC5" class="blob-code blob-code-inner js-file-line">// if you&#8217;d like to show it on archive page, replace &#8220;woocommerce_product_meta_end&#8221; with &#8220;woocommerce_shop_loop_item_title&#8221;</td>
</tr>
<tr>
<td id="file-wc-display-product-attribute-archive-links-php-L6" class="blob-num js-line-number" data-line-number="6"> </td>
<td id="file-wc-display-product-attribute-archive-links-php-LC6" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-display-product-attribute-archive-links-php-L7" class="blob-num js-line-number" data-line-number="7"> </td>
<td id="file-wc-display-product-attribute-archive-links-php-LC7" class="blob-code blob-code-inner js-file-line">function wc_show_attribute_links() {</td>
</tr>
<tr>
<td id="file-wc-display-product-attribute-archive-links-php-L8" class="blob-num js-line-number" data-line-number="8"> </td>
<td id="file-wc-display-product-attribute-archive-links-php-LC8" class="blob-code blob-code-inner js-file-line">global $post;</td>
</tr>
<tr>
<td id="file-wc-display-product-attribute-archive-links-php-L9" class="blob-num js-line-number" data-line-number="9"> </td>
<td id="file-wc-display-product-attribute-archive-links-php-LC9" class="blob-code blob-code-inner js-file-line">$attribute_names = array( &#8216;<span class="pl-kos">&lt;</span><span class="pl-ent">ATTRIBUTE</span><span class="pl-c1">_NAME</span><span class="pl-kos">&gt;</span>&#8216;, &#8216;<span class="pl-kos">&lt;</span><span class="pl-ent">ANOTHER</span><span class="pl-c1">_ATTRIBUTE_NAME</span><span class="pl-kos">&gt;</span>&#8216; ); // Add attribute names here and remember to add the pa_ prefix to the attribute name</td>
</tr>
<tr>
<td id="file-wc-display-product-attribute-archive-links-php-L10" class="blob-num js-line-number" data-line-number="10"> </td>
<td id="file-wc-display-product-attribute-archive-links-php-LC10" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-display-product-attribute-archive-links-php-L11" class="blob-num js-line-number" data-line-number="11"> </td>
<td id="file-wc-display-product-attribute-archive-links-php-LC11" class="blob-code blob-code-inner js-file-line">foreach ( $attribute_names as $attribute_name ) {</td>
</tr>
<tr>
<td id="file-wc-display-product-attribute-archive-links-php-L12" class="blob-num js-line-number" data-line-number="12"> </td>
<td id="file-wc-display-product-attribute-archive-links-php-LC12" class="blob-code blob-code-inner js-file-line">$taxonomy = get_taxonomy( $attribute_name );</td>
</tr>
<tr>
<td id="file-wc-display-product-attribute-archive-links-php-L13" class="blob-num js-line-number" data-line-number="13"> </td>
<td id="file-wc-display-product-attribute-archive-links-php-LC13" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-display-product-attribute-archive-links-php-L14" class="blob-num js-line-number" data-line-number="14"> </td>
<td id="file-wc-display-product-attribute-archive-links-php-LC14" class="blob-code blob-code-inner js-file-line">if ( $taxonomy &amp;&amp; ! is_wp_error( $taxonomy ) ) {</td>
</tr>
<tr>
<td id="file-wc-display-product-attribute-archive-links-php-L15" class="blob-num js-line-number" data-line-number="15"> </td>
<td id="file-wc-display-product-attribute-archive-links-php-LC15" class="blob-code blob-code-inner js-file-line">$terms = wp_get_post_terms( $post-<span class="pl-kos">&gt;</span>ID, $attribute_name );</td>
</tr>
<tr>
<td id="file-wc-display-product-attribute-archive-links-php-L16" class="blob-num js-line-number" data-line-number="16"> </td>
<td id="file-wc-display-product-attribute-archive-links-php-LC16" class="blob-code blob-code-inner js-file-line">$terms_array = array();</td>
</tr>
<tr>
<td id="file-wc-display-product-attribute-archive-links-php-L17" class="blob-num js-line-number" data-line-number="17"> </td>
<td id="file-wc-display-product-attribute-archive-links-php-LC17" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-display-product-attribute-archive-links-php-L18" class="blob-num js-line-number" data-line-number="18"> </td>
<td id="file-wc-display-product-attribute-archive-links-php-LC18" class="blob-code blob-code-inner js-file-line">if ( ! empty( $terms ) ) {</td>
</tr>
<tr>
<td id="file-wc-display-product-attribute-archive-links-php-L19" class="blob-num js-line-number" data-line-number="19"> </td>
<td id="file-wc-display-product-attribute-archive-links-php-LC19" class="blob-code blob-code-inner js-file-line">foreach ( $terms as $term ) {</td>
</tr>
<tr>
<td id="file-wc-display-product-attribute-archive-links-php-L20" class="blob-num js-line-number" data-line-number="20"> </td>
<td id="file-wc-display-product-attribute-archive-links-php-LC20" class="blob-code blob-code-inner js-file-line">$archive_link = get_term_link( $term-<span class="pl-kos">&gt;</span>slug, $attribute_name );</td>
</tr>
<tr>
<td id="file-wc-display-product-attribute-archive-links-php-L21" class="blob-num js-line-number" data-line-number="21"> </td>
<td id="file-wc-display-product-attribute-archive-links-php-LC21" class="blob-code blob-code-inner js-file-line">$full_line = &#8216;<span class="pl-kos">&lt;</span><span class="pl-ent">a</span> <span class="pl-c1">href</span>=&#8221;<span class="pl-s">&#8216; . $archive_link . &#8216;</span>&#8220;<span class="pl-kos">&gt;</span>&#8216;. $term-<span class="pl-kos">&gt;</span>name . &#8216;<span class="pl-kos">&lt;/</span><span class="pl-ent">a</span><span class="pl-kos">&gt;</span>&#8216;;</td>
</tr>
<tr>
<td id="file-wc-display-product-attribute-archive-links-php-L22" class="blob-num js-line-number" data-line-number="22"> </td>
<td id="file-wc-display-product-attribute-archive-links-php-LC22" class="blob-code blob-code-inner js-file-line">array_push( $terms_array, $full_line );</td>
</tr>
<tr>
<td id="file-wc-display-product-attribute-archive-links-php-L23" class="blob-num js-line-number" data-line-number="23"> </td>
<td id="file-wc-display-product-attribute-archive-links-php-LC23" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
<tr>
<td id="file-wc-display-product-attribute-archive-links-php-L24" class="blob-num js-line-number" data-line-number="24"> </td>
<td id="file-wc-display-product-attribute-archive-links-php-LC24" class="blob-code blob-code-inner js-file-line">echo $taxonomy-<span class="pl-kos">&gt;</span>labels-<span class="pl-kos">&gt;</span>name . &#8216; &#8216; . implode( $terms_array, &#8216;, &#8216; );</td>
</tr>
<tr>
<td id="file-wc-display-product-attribute-archive-links-php-L25" class="blob-num js-line-number" data-line-number="25"> </td>
<td id="file-wc-display-product-attribute-archive-links-php-LC25" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
<tr>
<td id="file-wc-display-product-attribute-archive-links-php-L26" class="blob-num js-line-number" data-line-number="26"> </td>
<td id="file-wc-display-product-attribute-archive-links-php-LC26" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
<tr>
<td id="file-wc-display-product-attribute-archive-links-php-L27" class="blob-num js-line-number" data-line-number="27"> </td>
<td id="file-wc-display-product-attribute-archive-links-php-LC27" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
<tr>
<td id="file-wc-display-product-attribute-archive-links-php-L28" class="blob-num js-line-number" data-line-number="28"> </td>
<td id="file-wc-display-product-attribute-archive-links-php-LC28" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<p>&nbsp;</p>
</div>
</div>
<p>Also remember to add the <code>pa_</code> prefix to the attribute. An example would be: <code>pa_color</code> — or it wouldn’t work.</p>
<p>If you’d like to display this on the archive page, replace the <code>add_action( 'woocommerce_product_meta_end', 'wc_show_attribute_links' );</code> with the following hook:</p>
<p><code>add_action( 'woocommerce_shop_loop_item_title', 'wc_show_attribute_links' );</code></p><p>The post <a href="https://help.codibu.com/blog/display-product-attribute-archive-links/">Display product attribute archive links</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://help.codibu.com/blog/display-product-attribute-archive-links/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Notify Admin When New Account Is Created</title>
		<link>https://help.codibu.com/blog/notify-admin-when-new-account-is-created/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=notify-admin-when-new-account-is-created</link>
					<comments>https://help.codibu.com/blog/notify-admin-when-new-account-is-created/#respond</comments>
		
		<dc:creator><![CDATA[JN C]]></dc:creator>
		<pubDate>Mon, 09 Nov 2020 06:44:56 +0000</pubDate>
				<guid isPermaLink="false">https://help.codibu.com/kb/notify-admin-when-new-account-is-created/</guid>

					<description><![CDATA[<p>Add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Avoid adding custom code<span class="excerpt-hellip"> […]</span></p>
<p>The post <a href="https://help.codibu.com/blog/notify-admin-when-new-account-is-created/">Notify Admin When New Account Is Created</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><span class="s1">Add this code to your child theme’s <code>functions.php</code> file or via a plugin that allows custom functions to be added, such as the <a href="https://wordpress.org/plugins/code-snippets/">Code snippets</a> plugin. Avoid adding custom code directly to your parent theme’s <code>functions.php</code> file, as this will be wiped entirely when you update the theme.</span></p>
<div id="gist88077621" class="gist">
<div class="gist-file">
<div class="gist-data">
<div class="js-gist-file-update-container js-task-list-container file-box">
<div id="file-wc-new-account-notify-admin-php" class="file my-2">
<div class="Box-body p-0 blob-wrapper data type-php  ">
<table class="highlight tab-size js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">
<tbody>
<tr>
<td id="file-wc-new-account-notify-admin-php-L1" class="blob-num js-line-number" data-line-number="1"> </td>
<td id="file-wc-new-account-notify-admin-php-LC1" class="blob-code blob-code-inner js-file-line">/**</td>
</tr>
<tr>
<td id="file-wc-new-account-notify-admin-php-L2" class="blob-num js-line-number" data-line-number="2"> </td>
<td id="file-wc-new-account-notify-admin-php-LC2" class="blob-code blob-code-inner js-file-line">* Notify admin when a new customer account is created</td>
</tr>
<tr>
<td id="file-wc-new-account-notify-admin-php-L3" class="blob-num js-line-number" data-line-number="3"> </td>
<td id="file-wc-new-account-notify-admin-php-LC3" class="blob-code blob-code-inner js-file-line">*/</td>
</tr>
<tr>
<td id="file-wc-new-account-notify-admin-php-L4" class="blob-num js-line-number" data-line-number="4"> </td>
<td id="file-wc-new-account-notify-admin-php-LC4" class="blob-code blob-code-inner js-file-line">add_action( &#8216;woocommerce_created_customer&#8217;, &#8216;woocommerce_created_customer_admin_notification&#8217; );</td>
</tr>
<tr>
<td id="file-wc-new-account-notify-admin-php-L5" class="blob-num js-line-number" data-line-number="5"> </td>
<td id="file-wc-new-account-notify-admin-php-LC5" class="blob-code blob-code-inner js-file-line">function woocommerce_created_customer_admin_notification( $customer_id ) {</td>
</tr>
<tr>
<td id="file-wc-new-account-notify-admin-php-L6" class="blob-num js-line-number" data-line-number="6"> </td>
<td id="file-wc-new-account-notify-admin-php-LC6" class="blob-code blob-code-inner js-file-line">wp_send_new_user_notifications( $customer_id, &#8216;admin&#8217; );</td>
</tr>
<tr>
<td id="file-wc-new-account-notify-admin-php-L7" class="blob-num js-line-number" data-line-number="7"> </td>
<td id="file-wc-new-account-notify-admin-php-LC7" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div><p>The post <a href="https://help.codibu.com/blog/notify-admin-when-new-account-is-created/">Notify Admin When New Account Is Created</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://help.codibu.com/blog/notify-admin-when-new-account-is-created/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
