<?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>Frontend Snippets - CODIBU</title>
	<atom:link href="https://help.codibu.com/kbtopic/frontend-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:32:39 +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>Frontend Snippets - CODIBU</title>
	<link>https://help.codibu.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Remove product content based on category</title>
		<link>https://help.codibu.com/blog/remove-product-content-based-on-category/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=remove-product-content-based-on-category</link>
					<comments>https://help.codibu.com/blog/remove-product-content-based-on-category/#respond</comments>
		
		<dc:creator><![CDATA[JN C]]></dc:creator>
		<pubDate>Mon, 09 Nov 2020 06:32:39 +0000</pubDate>
				<guid isPermaLink="false">https://help.codibu.com/kb/remove-product-content-based-on-category/</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/remove-product-content-based-on-category/">Remove product content based on category</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>
<p>The following code will remove product images on single product pages within the ‘Cookware’ category:</p>
<div id="gist88075574" 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-remove-product-content-category-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-remove-product-content-category-php-L1" class="blob-num js-line-number" data-line-number="1"> </td>
<td id="file-wc-remove-product-content-category-php-LC1" class="blob-code blob-code-inner js-file-line">/**</td>
</tr>
<tr>
<td id="file-wc-remove-product-content-category-php-L2" class="blob-num js-line-number" data-line-number="2"> </td>
<td id="file-wc-remove-product-content-category-php-LC2" class="blob-code blob-code-inner js-file-line">* Remove product content based on category</td>
</tr>
<tr>
<td id="file-wc-remove-product-content-category-php-L3" class="blob-num js-line-number" data-line-number="3"> </td>
<td id="file-wc-remove-product-content-category-php-LC3" class="blob-code blob-code-inner js-file-line">*/</td>
</tr>
<tr>
<td id="file-wc-remove-product-content-category-php-L4" class="blob-num js-line-number" data-line-number="4"> </td>
<td id="file-wc-remove-product-content-category-php-LC4" class="blob-code blob-code-inner js-file-line">add_action( &#8216;wp&#8217;, &#8216;remove_product_content&#8217; );</td>
</tr>
<tr>
<td id="file-wc-remove-product-content-category-php-L5" class="blob-num js-line-number" data-line-number="5"> </td>
<td id="file-wc-remove-product-content-category-php-LC5" class="blob-code blob-code-inner js-file-line">function remove_product_content() {</td>
</tr>
<tr>
<td id="file-wc-remove-product-content-category-php-L6" class="blob-num js-line-number" data-line-number="6"> </td>
<td id="file-wc-remove-product-content-category-php-LC6" class="blob-code blob-code-inner js-file-line">// If a product in the &#8216;Cookware&#8217; category is being viewed…</td>
</tr>
<tr>
<td id="file-wc-remove-product-content-category-php-L7" class="blob-num js-line-number" data-line-number="7"> </td>
<td id="file-wc-remove-product-content-category-php-LC7" class="blob-code blob-code-inner js-file-line">if ( is_product() &amp;&amp; has_term( &#8216;Cookware&#8217;, &#8216;product_cat&#8217; ) ) {</td>
</tr>
<tr>
<td id="file-wc-remove-product-content-category-php-L8" class="blob-num js-line-number" data-line-number="8"> </td>
<td id="file-wc-remove-product-content-category-php-LC8" class="blob-code blob-code-inner js-file-line">//… Remove the images</td>
</tr>
<tr>
<td id="file-wc-remove-product-content-category-php-L9" class="blob-num js-line-number" data-line-number="9"> </td>
<td id="file-wc-remove-product-content-category-php-LC9" class="blob-code blob-code-inner js-file-line">remove_action( &#8216;woocommerce_before_single_product_summary&#8217;, &#8216;woocommerce_show_product_images&#8217;, 20 );</td>
</tr>
<tr>
<td id="file-wc-remove-product-content-category-php-L10" class="blob-num js-line-number" data-line-number="10"> </td>
<td id="file-wc-remove-product-content-category-php-LC10" class="blob-code blob-code-inner js-file-line">// For a full list of what can be removed please see woocommerce-hooks.php</td>
</tr>
<tr>
<td id="file-wc-remove-product-content-category-php-L11" class="blob-num js-line-number" data-line-number="11"> </td>
<td id="file-wc-remove-product-content-category-php-LC11" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
<tr>
<td id="file-wc-remove-product-content-category-php-L12" class="blob-num js-line-number" data-line-number="12"> </td>
<td id="file-wc-remove-product-content-category-php-LC12" 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/remove-product-content-based-on-category/">Remove product content based on category</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://help.codibu.com/blog/remove-product-content-based-on-category/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Hide sub-category product count in product archives</title>
		<link>https://help.codibu.com/blog/hide-sub-category-product-count-in-product-archives/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=hide-sub-category-product-count-in-product-archives</link>
					<comments>https://help.codibu.com/blog/hide-sub-category-product-count-in-product-archives/#respond</comments>
		
		<dc:creator><![CDATA[JN C]]></dc:creator>
		<pubDate>Mon, 09 Nov 2020 06:32:08 +0000</pubDate>
				<guid isPermaLink="false">https://help.codibu.com/kb/hide-sub-category-product-count-in-product-archives/</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. Please don’t add custom<span class="excerpt-hellip"> […]</span></p>
<p>The post <a href="https://help.codibu.com/blog/hide-sub-category-product-count-in-product-archives/">Hide sub-category product count in product archives</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. 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>
<div id="gist88074753" 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-subcategory-product-count-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-subcategory-product-count-php-L1" class="blob-num js-line-number" data-line-number="1"> </td>
<td id="file-wc-subcategory-product-count-php-LC1" class="blob-code blob-code-inner js-file-line">/**</td>
</tr>
<tr>
<td id="file-wc-subcategory-product-count-php-L2" class="blob-num js-line-number" data-line-number="2"> </td>
<td id="file-wc-subcategory-product-count-php-LC2" class="blob-code blob-code-inner js-file-line">* Hide category product count in product archives</td>
</tr>
<tr>
<td id="file-wc-subcategory-product-count-php-L3" class="blob-num js-line-number" data-line-number="3"> </td>
<td id="file-wc-subcategory-product-count-php-LC3" class="blob-code blob-code-inner js-file-line">*/</td>
</tr>
<tr>
<td id="file-wc-subcategory-product-count-php-L4" class="blob-num js-line-number" data-line-number="4"> </td>
<td id="file-wc-subcategory-product-count-php-LC4" class="blob-code blob-code-inner js-file-line">add_filter( &#8216;woocommerce_subcategory_count_html&#8217;, &#8216;__return_false&#8217; );</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<p>&nbsp;</p>
</div>
</div>
<p>Turns this:</p>
<p><span class="s1"><a href="https://help.codibu.com/wp-content/uploads/2020/11/Screen-Shot-2013-03-14-at-11.36.21.png"><img fetchpriority="high" decoding="async" class="aligncenter size-full wp-image-10732" src="https://help.codibu.com/wp-content/uploads/2020/11/Screen-Shot-2013-03-14-at-11.36.21.png" alt="" width="322" height="390" /></a></span></p>
<p>Into this:</p>
<p><span class="s1"><a href="https://help.codibu.com/wp-content/uploads/2020/11/Screen-Shot-2013-03-14-at-11.36.13.png"><img decoding="async" class="aligncenter size-full wp-image-10731" src="https://help.codibu.com/wp-content/uploads/2020/11/Screen-Shot-2013-03-14-at-11.36.13.png" alt="" width="330" height="378" /></a></span></p><p>The post <a href="https://help.codibu.com/blog/hide-sub-category-product-count-in-product-archives/">Hide sub-category product count in product archives</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://help.codibu.com/blog/hide-sub-category-product-count-in-product-archives/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Editing product data tabs</title>
		<link>https://help.codibu.com/blog/editing-product-data-tabs/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=editing-product-data-tabs</link>
					<comments>https://help.codibu.com/blog/editing-product-data-tabs/#respond</comments>
		
		<dc:creator><![CDATA[JN C]]></dc:creator>
		<pubDate>Mon, 09 Nov 2020 06:31:33 +0000</pubDate>
				<guid isPermaLink="false">https://help.codibu.com/kb/editing-product-data-tabs/</guid>

					<description><![CDATA[<p>You need to add the 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/editing-product-data-tabs/">Editing product data tabs</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 the 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">Removing Tabs</h2>
<p>Use the following snippet to remove specific tabs</p>
<div id="gist88073979" 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-remove-tabs-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-remove-tabs-php-L1" class="blob-num js-line-number" data-line-number="1"> </td>
<td id="file-wc-remove-tabs-php-LC1" class="blob-code blob-code-inner js-file-line">/**</td>
</tr>
<tr>
<td id="file-wc-remove-tabs-php-L2" class="blob-num js-line-number" data-line-number="2"> </td>
<td id="file-wc-remove-tabs-php-LC2" class="blob-code blob-code-inner js-file-line">* Remove product data tabs</td>
</tr>
<tr>
<td id="file-wc-remove-tabs-php-L3" class="blob-num js-line-number" data-line-number="3"> </td>
<td id="file-wc-remove-tabs-php-LC3" class="blob-code blob-code-inner js-file-line">*/</td>
</tr>
<tr>
<td id="file-wc-remove-tabs-php-L4" class="blob-num js-line-number" data-line-number="4"> </td>
<td id="file-wc-remove-tabs-php-LC4" class="blob-code blob-code-inner js-file-line">add_filter( &#8216;woocommerce_product_tabs&#8217;, &#8216;woo_remove_product_tabs&#8217;, 98 );</td>
</tr>
<tr>
<td id="file-wc-remove-tabs-php-L5" class="blob-num js-line-number" data-line-number="5"> </td>
<td id="file-wc-remove-tabs-php-LC5" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-remove-tabs-php-L6" class="blob-num js-line-number" data-line-number="6"> </td>
<td id="file-wc-remove-tabs-php-LC6" class="blob-code blob-code-inner js-file-line">function woo_remove_product_tabs( $tabs ) {</td>
</tr>
<tr>
<td id="file-wc-remove-tabs-php-L7" class="blob-num js-line-number" data-line-number="7"> </td>
<td id="file-wc-remove-tabs-php-LC7" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-remove-tabs-php-L8" class="blob-num js-line-number" data-line-number="8"> </td>
<td id="file-wc-remove-tabs-php-LC8" class="blob-code blob-code-inner js-file-line">unset( $tabs[&#8216;description&#8217;] ); // Remove the description tab</td>
</tr>
<tr>
<td id="file-wc-remove-tabs-php-L9" class="blob-num js-line-number" data-line-number="9"> </td>
<td id="file-wc-remove-tabs-php-LC9" class="blob-code blob-code-inner js-file-line">unset( $tabs[&#8216;reviews&#8217;] ); // Remove the reviews tab</td>
</tr>
<tr>
<td id="file-wc-remove-tabs-php-L10" class="blob-num js-line-number" data-line-number="10"> </td>
<td id="file-wc-remove-tabs-php-LC10" class="blob-code blob-code-inner js-file-line">unset( $tabs[&#8216;additional_information&#8217;] ); // Remove the additional information tab</td>
</tr>
<tr>
<td id="file-wc-remove-tabs-php-L11" class="blob-num js-line-number" data-line-number="11"> </td>
<td id="file-wc-remove-tabs-php-LC11" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-remove-tabs-php-L12" class="blob-num js-line-number" data-line-number="12"> </td>
<td id="file-wc-remove-tabs-php-LC12" class="blob-code blob-code-inner js-file-line">return $tabs;</td>
</tr>
<tr>
<td id="file-wc-remove-tabs-php-L13" class="blob-num js-line-number" data-line-number="13"> </td>
<td id="file-wc-remove-tabs-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">Renaming Tabs</h2>
<p>Use the following snippet to rename tabs.</p>
<div id="gist88074067" 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-tabs-php" class="file my-2">
<div class="Box-body p-0 blob-wrapper data type-hack  ">
<table class="highlight tab-size js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">
<tbody>
<tr>
<td id="file-wc-rename-tabs-php-L1" class="blob-num js-line-number" data-line-number="1"> </td>
<td id="file-wc-rename-tabs-php-LC1" class="blob-code blob-code-inner js-file-line"><span class="pl-c">/**</span></td>
</tr>
<tr>
<td id="file-wc-rename-tabs-php-L2" class="blob-num js-line-number" data-line-number="2"> </td>
<td id="file-wc-rename-tabs-php-LC2" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Rename product data tabs</span></td>
</tr>
<tr>
<td id="file-wc-rename-tabs-php-L3" class="blob-num js-line-number" data-line-number="3"> </td>
<td id="file-wc-rename-tabs-php-LC3" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> */</span></td>
</tr>
<tr>
<td id="file-wc-rename-tabs-php-L4" class="blob-num js-line-number" data-line-number="4"> </td>
<td id="file-wc-rename-tabs-php-LC4" class="blob-code blob-code-inner js-file-line"><span class="pl-en">add_filter</span>( <span class="pl-s"><span class="pl-pds">&#8216;</span>woocommerce_product_tabs<span class="pl-pds">&#8216;</span></span>, <span class="pl-s"><span class="pl-pds">&#8216;</span>woo_rename_tabs<span class="pl-pds">&#8216;</span></span>, <span class="pl-c1">98</span> );</td>
</tr>
<tr>
<td id="file-wc-rename-tabs-php-L5" class="blob-num js-line-number" data-line-number="5"> </td>
<td id="file-wc-rename-tabs-php-LC5" class="blob-code blob-code-inner js-file-line"><span class="pl-k">function</span> <span class="pl-en">woo_rename_tabs</span>( <span class="pl-smi">$tabs</span> ) {</td>
</tr>
<tr>
<td id="file-wc-rename-tabs-php-L6" class="blob-num js-line-number" data-line-number="6"> </td>
<td id="file-wc-rename-tabs-php-LC6" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-rename-tabs-php-L7" class="blob-num js-line-number" data-line-number="7"> </td>
<td id="file-wc-rename-tabs-php-LC7" class="blob-code blob-code-inner js-file-line"><span class="pl-smi">$tabs</span>[<span class="pl-s"><span class="pl-pds">&#8216;</span>description<span class="pl-pds">&#8216;</span></span>][<span class="pl-s"><span class="pl-pds">&#8216;</span>title<span class="pl-pds">&#8216;</span></span>] <span class="pl-k">=</span> <span class="pl-en">__</span>( <span class="pl-s"><span class="pl-pds">&#8216;</span>More Information<span class="pl-pds">&#8216;</span></span> ); <span class="pl-c">// Rename the description tab</span></td>
</tr>
<tr>
<td id="file-wc-rename-tabs-php-L8" class="blob-num js-line-number" data-line-number="8"> </td>
<td id="file-wc-rename-tabs-php-LC8" class="blob-code blob-code-inner js-file-line"><span class="pl-smi">$tabs</span>[<span class="pl-s"><span class="pl-pds">&#8216;</span>reviews<span class="pl-pds">&#8216;</span></span>][<span class="pl-s"><span class="pl-pds">&#8216;</span>title<span class="pl-pds">&#8216;</span></span>] <span class="pl-k">=</span> <span class="pl-en">__</span>( <span class="pl-s"><span class="pl-pds">&#8216;</span>Ratings<span class="pl-pds">&#8216;</span></span> ); <span class="pl-c">// Rename the reviews tab</span></td>
</tr>
<tr>
<td id="file-wc-rename-tabs-php-L9" class="blob-num js-line-number" data-line-number="9"> </td>
<td id="file-wc-rename-tabs-php-LC9" class="blob-code blob-code-inner js-file-line"><span class="pl-smi">$tabs</span>[<span class="pl-s"><span class="pl-pds">&#8216;</span>additional_information<span class="pl-pds">&#8216;</span></span>][<span class="pl-s"><span class="pl-pds">&#8216;</span>title<span class="pl-pds">&#8216;</span></span>] <span class="pl-k">=</span> <span class="pl-en">__</span>( <span class="pl-s"><span class="pl-pds">&#8216;</span>Product Data<span class="pl-pds">&#8216;</span></span> ); <span class="pl-c">// Rename the additional information tab</span></td>
</tr>
<tr>
<td id="file-wc-rename-tabs-php-L10" class="blob-num js-line-number" data-line-number="10"> </td>
<td id="file-wc-rename-tabs-php-LC10" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-rename-tabs-php-L11" class="blob-num js-line-number" data-line-number="11"> </td>
<td id="file-wc-rename-tabs-php-LC11" class="blob-code blob-code-inner js-file-line"><span class="pl-k">return</span> <span class="pl-smi">$tabs</span>;</td>
</tr>
<tr>
<td id="file-wc-rename-tabs-php-L12" class="blob-num js-line-number" data-line-number="12"> </td>
<td id="file-wc-rename-tabs-php-LC12" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-rename-tabs-php-L13" class="blob-num js-line-number" data-line-number="13"> </td>
<td id="file-wc-rename-tabs-php-LC13" 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>
<h2 id="section-3">Re-ordering Tabs</h2>
<p>Use the following snippet to change the tab order</p>
<div id="gist88074092" 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-reorder-tabs-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-reorder-tabs-php-L1" class="blob-num js-line-number" data-line-number="1"> </td>
<td id="file-wc-reorder-tabs-php-LC1" class="blob-code blob-code-inner js-file-line">/**</td>
</tr>
<tr>
<td id="file-wc-reorder-tabs-php-L2" class="blob-num js-line-number" data-line-number="2"> </td>
<td id="file-wc-reorder-tabs-php-LC2" class="blob-code blob-code-inner js-file-line">* Reorder product data tabs</td>
</tr>
<tr>
<td id="file-wc-reorder-tabs-php-L3" class="blob-num js-line-number" data-line-number="3"> </td>
<td id="file-wc-reorder-tabs-php-LC3" class="blob-code blob-code-inner js-file-line">*/</td>
</tr>
<tr>
<td id="file-wc-reorder-tabs-php-L4" class="blob-num js-line-number" data-line-number="4"> </td>
<td id="file-wc-reorder-tabs-php-LC4" class="blob-code blob-code-inner js-file-line">add_filter( &#8216;woocommerce_product_tabs&#8217;, &#8216;woo_reorder_tabs&#8217;, 98 );</td>
</tr>
<tr>
<td id="file-wc-reorder-tabs-php-L5" class="blob-num js-line-number" data-line-number="5"> </td>
<td id="file-wc-reorder-tabs-php-LC5" class="blob-code blob-code-inner js-file-line">function woo_reorder_tabs( $tabs ) {</td>
</tr>
<tr>
<td id="file-wc-reorder-tabs-php-L6" class="blob-num js-line-number" data-line-number="6"> </td>
<td id="file-wc-reorder-tabs-php-LC6" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-reorder-tabs-php-L7" class="blob-num js-line-number" data-line-number="7"> </td>
<td id="file-wc-reorder-tabs-php-LC7" class="blob-code blob-code-inner js-file-line">$tabs[&#8216;reviews&#8217;][&#8216;priority&#8217;] = 5; // Reviews first</td>
</tr>
<tr>
<td id="file-wc-reorder-tabs-php-L8" class="blob-num js-line-number" data-line-number="8"> </td>
<td id="file-wc-reorder-tabs-php-LC8" class="blob-code blob-code-inner js-file-line">$tabs[&#8216;description&#8217;][&#8216;priority&#8217;] = 10; // Description second</td>
</tr>
<tr>
<td id="file-wc-reorder-tabs-php-L9" class="blob-num js-line-number" data-line-number="9"> </td>
<td id="file-wc-reorder-tabs-php-LC9" class="blob-code blob-code-inner js-file-line">$tabs[&#8216;additional_information&#8217;][&#8216;priority&#8217;] = 15; // Additional information third</td>
</tr>
<tr>
<td id="file-wc-reorder-tabs-php-L10" class="blob-num js-line-number" data-line-number="10"> </td>
<td id="file-wc-reorder-tabs-php-LC10" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-reorder-tabs-php-L11" class="blob-num js-line-number" data-line-number="11"> </td>
<td id="file-wc-reorder-tabs-php-LC11" class="blob-code blob-code-inner js-file-line">return $tabs;</td>
</tr>
<tr>
<td id="file-wc-reorder-tabs-php-L12" class="blob-num js-line-number" data-line-number="12"> </td>
<td id="file-wc-reorder-tabs-php-LC12" 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>
<h2 id="section-4">Customize a tab</h2>
<p>The following snippet will replace the description tab with a custom function</p>
<div id="gist88074148" 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-custom-tab-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-custom-tab-php-L1" class="blob-num js-line-number" data-line-number="1"> </td>
<td id="file-wc-custom-tab-php-LC1" class="blob-code blob-code-inner js-file-line">/**</td>
</tr>
<tr>
<td id="file-wc-custom-tab-php-L2" class="blob-num js-line-number" data-line-number="2"> </td>
<td id="file-wc-custom-tab-php-LC2" class="blob-code blob-code-inner js-file-line">* Customize product data tabs</td>
</tr>
<tr>
<td id="file-wc-custom-tab-php-L3" class="blob-num js-line-number" data-line-number="3"> </td>
<td id="file-wc-custom-tab-php-LC3" class="blob-code blob-code-inner js-file-line">*/</td>
</tr>
<tr>
<td id="file-wc-custom-tab-php-L4" class="blob-num js-line-number" data-line-number="4"> </td>
<td id="file-wc-custom-tab-php-LC4" class="blob-code blob-code-inner js-file-line">add_filter( &#8216;woocommerce_product_tabs&#8217;, &#8216;woo_custom_description_tab&#8217;, 98 );</td>
</tr>
<tr>
<td id="file-wc-custom-tab-php-L5" class="blob-num js-line-number" data-line-number="5"> </td>
<td id="file-wc-custom-tab-php-LC5" class="blob-code blob-code-inner js-file-line">function woo_custom_description_tab( $tabs ) {</td>
</tr>
<tr>
<td id="file-wc-custom-tab-php-L6" class="blob-num js-line-number" data-line-number="6"> </td>
<td id="file-wc-custom-tab-php-LC6" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-custom-tab-php-L7" class="blob-num js-line-number" data-line-number="7"> </td>
<td id="file-wc-custom-tab-php-LC7" class="blob-code blob-code-inner js-file-line">$tabs[&#8216;description&#8217;][&#8216;callback&#8217;] = &#8216;woo_custom_description_tab_content&#8217;; // Custom description callback</td>
</tr>
<tr>
<td id="file-wc-custom-tab-php-L8" class="blob-num js-line-number" data-line-number="8"> </td>
<td id="file-wc-custom-tab-php-LC8" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-custom-tab-php-L9" class="blob-num js-line-number" data-line-number="9"> </td>
<td id="file-wc-custom-tab-php-LC9" class="blob-code blob-code-inner js-file-line">return $tabs;</td>
</tr>
<tr>
<td id="file-wc-custom-tab-php-L10" class="blob-num js-line-number" data-line-number="10"> </td>
<td id="file-wc-custom-tab-php-LC10" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
<tr>
<td id="file-wc-custom-tab-php-L11" class="blob-num js-line-number" data-line-number="11"> </td>
<td id="file-wc-custom-tab-php-LC11" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-custom-tab-php-L12" class="blob-num js-line-number" data-line-number="12"> </td>
<td id="file-wc-custom-tab-php-LC12" class="blob-code blob-code-inner js-file-line">function woo_custom_description_tab_content() {</td>
</tr>
<tr>
<td id="file-wc-custom-tab-php-L13" class="blob-num js-line-number" data-line-number="13"> </td>
<td id="file-wc-custom-tab-php-LC13" class="blob-code blob-code-inner js-file-line">echo &#8216;<span class="pl-kos">&lt;</span><span class="pl-ent">h2</span><span class="pl-kos">&gt;</span>Custom Description<span class="pl-kos">&lt;/</span><span class="pl-ent">h2</span><span class="pl-kos">&gt;</span>&#8216;;</td>
</tr>
<tr>
<td id="file-wc-custom-tab-php-L14" class="blob-num js-line-number" data-line-number="14"> </td>
<td id="file-wc-custom-tab-php-LC14" class="blob-code blob-code-inner js-file-line">echo &#8216;<span class="pl-kos">&lt;</span><span class="pl-ent">p</span><span class="pl-kos">&gt;</span>Here&#8217;s a custom description<span class="pl-kos">&lt;/</span><span class="pl-ent">p</span><span class="pl-kos">&gt;</span>&#8216;;</td>
</tr>
<tr>
<td id="file-wc-custom-tab-php-L15" class="blob-num js-line-number" data-line-number="15"> </td>
<td id="file-wc-custom-tab-php-LC15" 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>
<h2 id="section-5">Add a custom tab</h2>
<p>Use the following snippet to add a custom global product tab</p>
<div id="gist88074182" 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-custom-tab-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-custom-tab-php-L1" class="blob-num js-line-number" data-line-number="1"> </td>
<td id="file-wc-add-custom-tab-php-LC1" class="blob-code blob-code-inner js-file-line">/**</td>
</tr>
<tr>
<td id="file-wc-add-custom-tab-php-L2" class="blob-num js-line-number" data-line-number="2"> </td>
<td id="file-wc-add-custom-tab-php-LC2" class="blob-code blob-code-inner js-file-line">* Add a custom product data tab</td>
</tr>
<tr>
<td id="file-wc-add-custom-tab-php-L3" class="blob-num js-line-number" data-line-number="3"> </td>
<td id="file-wc-add-custom-tab-php-LC3" class="blob-code blob-code-inner js-file-line">*/</td>
</tr>
<tr>
<td id="file-wc-add-custom-tab-php-L4" class="blob-num js-line-number" data-line-number="4"> </td>
<td id="file-wc-add-custom-tab-php-LC4" class="blob-code blob-code-inner js-file-line">add_filter( &#8216;woocommerce_product_tabs&#8217;, &#8216;woo_new_product_tab&#8217; );</td>
</tr>
<tr>
<td id="file-wc-add-custom-tab-php-L5" class="blob-num js-line-number" data-line-number="5"> </td>
<td id="file-wc-add-custom-tab-php-LC5" class="blob-code blob-code-inner js-file-line">function woo_new_product_tab( $tabs ) {</td>
</tr>
<tr>
<td id="file-wc-add-custom-tab-php-L6" class="blob-num js-line-number" data-line-number="6"> </td>
<td id="file-wc-add-custom-tab-php-LC6" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-add-custom-tab-php-L7" class="blob-num js-line-number" data-line-number="7"> </td>
<td id="file-wc-add-custom-tab-php-LC7" class="blob-code blob-code-inner js-file-line">// Adds the new tab</td>
</tr>
<tr>
<td id="file-wc-add-custom-tab-php-L8" class="blob-num js-line-number" data-line-number="8"> </td>
<td id="file-wc-add-custom-tab-php-LC8" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-add-custom-tab-php-L9" class="blob-num js-line-number" data-line-number="9"> </td>
<td id="file-wc-add-custom-tab-php-LC9" class="blob-code blob-code-inner js-file-line">$tabs[&#8216;test_tab&#8217;] = array(</td>
</tr>
<tr>
<td id="file-wc-add-custom-tab-php-L10" class="blob-num js-line-number" data-line-number="10"> </td>
<td id="file-wc-add-custom-tab-php-LC10" class="blob-code blob-code-inner js-file-line">&#8216;title&#8217; =<span class="pl-kos">&gt;</span> __( &#8216;New Product Tab&#8217;, &#8216;woocommerce&#8217; ),</td>
</tr>
<tr>
<td id="file-wc-add-custom-tab-php-L11" class="blob-num js-line-number" data-line-number="11"> </td>
<td id="file-wc-add-custom-tab-php-LC11" class="blob-code blob-code-inner js-file-line">&#8216;priority&#8217; =<span class="pl-kos">&gt;</span> 50,</td>
</tr>
<tr>
<td id="file-wc-add-custom-tab-php-L12" class="blob-num js-line-number" data-line-number="12"> </td>
<td id="file-wc-add-custom-tab-php-LC12" class="blob-code blob-code-inner js-file-line">&#8216;callback&#8217; =<span class="pl-kos">&gt;</span> &#8216;woo_new_product_tab_content&#8217;</td>
</tr>
<tr>
<td id="file-wc-add-custom-tab-php-L13" class="blob-num js-line-number" data-line-number="13"> </td>
<td id="file-wc-add-custom-tab-php-LC13" class="blob-code blob-code-inner js-file-line">);</td>
</tr>
<tr>
<td id="file-wc-add-custom-tab-php-L14" class="blob-num js-line-number" data-line-number="14"> </td>
<td id="file-wc-add-custom-tab-php-LC14" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-add-custom-tab-php-L15" class="blob-num js-line-number" data-line-number="15"> </td>
<td id="file-wc-add-custom-tab-php-LC15" class="blob-code blob-code-inner js-file-line">return $tabs;</td>
</tr>
<tr>
<td id="file-wc-add-custom-tab-php-L16" class="blob-num js-line-number" data-line-number="16"> </td>
<td id="file-wc-add-custom-tab-php-LC16" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-add-custom-tab-php-L17" class="blob-num js-line-number" data-line-number="17"> </td>
<td id="file-wc-add-custom-tab-php-LC17" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
<tr>
<td id="file-wc-add-custom-tab-php-L18" class="blob-num js-line-number" data-line-number="18"> </td>
<td id="file-wc-add-custom-tab-php-LC18" class="blob-code blob-code-inner js-file-line">function woo_new_product_tab_content() {</td>
</tr>
<tr>
<td id="file-wc-add-custom-tab-php-L19" class="blob-num js-line-number" data-line-number="19"> </td>
<td id="file-wc-add-custom-tab-php-LC19" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-add-custom-tab-php-L20" class="blob-num js-line-number" data-line-number="20"> </td>
<td id="file-wc-add-custom-tab-php-LC20" class="blob-code blob-code-inner js-file-line">// The new tab content</td>
</tr>
<tr>
<td id="file-wc-add-custom-tab-php-L21" class="blob-num js-line-number" data-line-number="21"> </td>
<td id="file-wc-add-custom-tab-php-LC21" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-add-custom-tab-php-L22" class="blob-num js-line-number" data-line-number="22"> </td>
<td id="file-wc-add-custom-tab-php-LC22" class="blob-code blob-code-inner js-file-line">echo &#8216;<span class="pl-kos">&lt;</span><span class="pl-ent">h2</span><span class="pl-kos">&gt;</span>New Product Tab<span class="pl-kos">&lt;/</span><span class="pl-ent">h2</span><span class="pl-kos">&gt;</span>&#8216;;</td>
</tr>
<tr>
<td id="file-wc-add-custom-tab-php-L23" class="blob-num js-line-number" data-line-number="23"> </td>
<td id="file-wc-add-custom-tab-php-LC23" class="blob-code blob-code-inner js-file-line">echo &#8216;<span class="pl-kos">&lt;</span><span class="pl-ent">p</span><span class="pl-kos">&gt;</span>Here&#8217;s your new product tab.<span class="pl-kos">&lt;/</span><span class="pl-ent">p</span><span class="pl-kos">&gt;</span>&#8216;;</td>
</tr>
<tr>
<td id="file-wc-add-custom-tab-php-L24" class="blob-num js-line-number" data-line-number="24"> </td>
<td id="file-wc-add-custom-tab-php-LC24" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-add-custom-tab-php-L25" class="blob-num js-line-number" data-line-number="25"> </td>
<td id="file-wc-add-custom-tab-php-LC25" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
</tbody>
</table>
</div>
<p>&nbsp;</p>
</div>
</div>
</div>
</div>
</div>
<h2 id="section-6">The Additional Information tab</h2>
<p>Please note that the “<strong>Additional Information</strong>” tab will only show if the product has weight, dimensions or attributes (with “Visible on the product page” checked). If you try to apply a change to that tab and if the product does not have weight, dimensions or attribute, you will get an error message similar to :</p>
<p><b>Warning</b>: call_user_func() expects parameter 1 to be a valid callback, no array or string given in <b>/mysite/wp-content/plugins/woocommerce/templates/single-product/tabs/tabs.php</b> on line <b>35</b></p>
<p>In that case, you have to use WooCommerce conditional tags:</p>
<ul>
<li><code>has_attributes()</code></li>
<li><code>has_dimensions()</code></li>
<li><code>has_weight()</code></li>
</ul>
<div id="gist88074242" 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-additional-information-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-additional-information-php-L1" class="blob-num js-line-number" data-line-number="1"> </td>
<td id="file-wc-add-additional-information-php-LC1" class="blob-code blob-code-inner js-file-line">/**</td>
</tr>
<tr>
<td id="file-wc-add-additional-information-php-L2" class="blob-num js-line-number" data-line-number="2"> </td>
<td id="file-wc-add-additional-information-php-LC2" class="blob-code blob-code-inner js-file-line">* Check if product has attributes, dimensions or weight to override the call_user_func() expects parameter 1 to be a valid callback error when changing the additional tab</td>
</tr>
<tr>
<td id="file-wc-add-additional-information-php-L3" class="blob-num js-line-number" data-line-number="3"> </td>
<td id="file-wc-add-additional-information-php-LC3" class="blob-code blob-code-inner js-file-line">*/</td>
</tr>
<tr>
<td id="file-wc-add-additional-information-php-L4" class="blob-num js-line-number" data-line-number="4"> </td>
<td id="file-wc-add-additional-information-php-LC4" class="blob-code blob-code-inner js-file-line">add_filter( &#8216;woocommerce_product_tabs&#8217;, &#8216;woo_rename_tabs&#8217;, 98 );</td>
</tr>
<tr>
<td id="file-wc-add-additional-information-php-L5" class="blob-num js-line-number" data-line-number="5"> </td>
<td id="file-wc-add-additional-information-php-LC5" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-add-additional-information-php-L6" class="blob-num js-line-number" data-line-number="6"> </td>
<td id="file-wc-add-additional-information-php-LC6" class="blob-code blob-code-inner js-file-line">function woo_rename_tabs( $tabs ) {</td>
</tr>
<tr>
<td id="file-wc-add-additional-information-php-L7" class="blob-num js-line-number" data-line-number="7"> </td>
<td id="file-wc-add-additional-information-php-LC7" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-add-additional-information-php-L8" class="blob-num js-line-number" data-line-number="8"> </td>
<td id="file-wc-add-additional-information-php-LC8" class="blob-code blob-code-inner js-file-line">global $product;</td>
</tr>
<tr>
<td id="file-wc-add-additional-information-php-L9" class="blob-num js-line-number" data-line-number="9"> </td>
<td id="file-wc-add-additional-information-php-LC9" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-add-additional-information-php-L10" class="blob-num js-line-number" data-line-number="10"> </td>
<td id="file-wc-add-additional-information-php-LC10" class="blob-code blob-code-inner js-file-line">if( $product-<span class="pl-kos">&gt;</span>has_attributes() || $product-<span class="pl-kos">&gt;</span>has_dimensions() || $product-<span class="pl-kos">&gt;</span>has_weight() ) { // Check if product has attributes, dimensions or weight</td>
</tr>
<tr>
<td id="file-wc-add-additional-information-php-L11" class="blob-num js-line-number" data-line-number="11"> </td>
<td id="file-wc-add-additional-information-php-LC11" class="blob-code blob-code-inner js-file-line">$tabs[&#8216;additional_information&#8217;][&#8216;title&#8217;] = __( &#8216;Product Data&#8217; ); // Rename the additional information tab</td>
</tr>
<tr>
<td id="file-wc-add-additional-information-php-L12" class="blob-num js-line-number" data-line-number="12"> </td>
<td id="file-wc-add-additional-information-php-LC12" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
<tr>
<td id="file-wc-add-additional-information-php-L13" class="blob-num js-line-number" data-line-number="13"> </td>
<td id="file-wc-add-additional-information-php-LC13" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-add-additional-information-php-L14" class="blob-num js-line-number" data-line-number="14"> </td>
<td id="file-wc-add-additional-information-php-LC14" class="blob-code blob-code-inner js-file-line">return $tabs;</td>
</tr>
<tr>
<td id="file-wc-add-additional-information-php-L15" class="blob-num js-line-number" data-line-number="15"> </td>
<td id="file-wc-add-additional-information-php-LC15" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-add-additional-information-php-L16" class="blob-num js-line-number" data-line-number="16"> </td>
<td id="file-wc-add-additional-information-php-LC16" 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/editing-product-data-tabs/">Editing product data tabs</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://help.codibu.com/blog/editing-product-data-tabs/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Make price widget draggable on touch devices</title>
		<link>https://help.codibu.com/blog/make-price-widget-draggable-on-touch-devices/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=make-price-widget-draggable-on-touch-devices</link>
					<comments>https://help.codibu.com/blog/make-price-widget-draggable-on-touch-devices/#respond</comments>
		
		<dc:creator><![CDATA[JN C]]></dc:creator>
		<pubDate>Mon, 09 Nov 2020 06:30:48 +0000</pubDate>
				<guid isPermaLink="false">https://help.codibu.com/kb/make-price-widget-draggable-on-touch-devices/</guid>

					<description><![CDATA[<p>Resources Grab this script and save it to the JS folder in your theme directory. Installation Add code to your child theme’s functions.php file or via a plugin that allows<span class="excerpt-hellip"> […]</span></p>
<p>The post <a href="https://help.codibu.com/blog/make-price-widget-draggable-on-touch-devices/">Make price widget draggable on touch devices</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></description>
										<content:encoded><![CDATA[<h2 id="section-1">Resources</h2>
<p>Grab this script and save it to the JS folder in your theme directory.</p>
<h2 id="section-2">Installation</h2>
<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>Remember to make sure the path matches your theme structure) to enqueue it.</p>
<div id="gist88073835" 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-draggable-price-widget-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-draggable-price-widget-php-L1" class="blob-num js-line-number" data-line-number="1"> </td>
<td id="file-wc-draggable-price-widget-php-LC1" class="blob-code blob-code-inner js-file-line">/**</td>
</tr>
<tr>
<td id="file-wc-draggable-price-widget-php-L2" class="blob-num js-line-number" data-line-number="2"> </td>
<td id="file-wc-draggable-price-widget-php-LC2" class="blob-code blob-code-inner js-file-line">* Make price widget draggable on touch devices</td>
</tr>
<tr>
<td id="file-wc-draggable-price-widget-php-L3" class="blob-num js-line-number" data-line-number="3"> </td>
<td id="file-wc-draggable-price-widget-php-LC3" class="blob-code blob-code-inner js-file-line">*/</td>
</tr>
<tr>
<td id="file-wc-draggable-price-widget-php-L4" class="blob-num js-line-number" data-line-number="4"> </td>
<td id="file-wc-draggable-price-widget-php-LC4" class="blob-code blob-code-inner js-file-line">add_action( &#8216;wp_enqueue_scripts&#8217;, &#8216;load_touch_punch_js&#8217; , 35 );</td>
</tr>
<tr>
<td id="file-wc-draggable-price-widget-php-L5" class="blob-num js-line-number" data-line-number="5"> </td>
<td id="file-wc-draggable-price-widget-php-LC5" class="blob-code blob-code-inner js-file-line">function load_touch_punch_js() {</td>
</tr>
<tr>
<td id="file-wc-draggable-price-widget-php-L6" class="blob-num js-line-number" data-line-number="6"> </td>
<td id="file-wc-draggable-price-widget-php-LC6" class="blob-code blob-code-inner js-file-line">global $version;</td>
</tr>
<tr>
<td id="file-wc-draggable-price-widget-php-L7" class="blob-num js-line-number" data-line-number="7"> </td>
<td id="file-wc-draggable-price-widget-php-LC7" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-draggable-price-widget-php-L8" class="blob-num js-line-number" data-line-number="8"> </td>
<td id="file-wc-draggable-price-widget-php-LC8" class="blob-code blob-code-inner js-file-line">wp_enqueue_script( &#8216;jquery-ui-widget&#8217; );</td>
</tr>
<tr>
<td id="file-wc-draggable-price-widget-php-L9" class="blob-num js-line-number" data-line-number="9"> </td>
<td id="file-wc-draggable-price-widget-php-LC9" class="blob-code blob-code-inner js-file-line">wp_enqueue_script( &#8216;jquery-ui-mouse&#8217; );</td>
</tr>
<tr>
<td id="file-wc-draggable-price-widget-php-L10" class="blob-num js-line-number" data-line-number="10"> </td>
<td id="file-wc-draggable-price-widget-php-LC10" class="blob-code blob-code-inner js-file-line">wp_enqueue_script( &#8216;jquery-ui-slider&#8217; );</td>
</tr>
<tr>
<td id="file-wc-draggable-price-widget-php-L11" class="blob-num js-line-number" data-line-number="11"> </td>
<td id="file-wc-draggable-price-widget-php-LC11" class="blob-code blob-code-inner js-file-line">wp_register_script( &#8216;woo-jquery-touch-punch&#8217;, get_stylesheet_directory_uri() . &#8220;/js/jquery.ui.touch-punch.min.js&#8221;, array(&#8216;jquery&#8217;), $version, true );</td>
</tr>
<tr>
<td id="file-wc-draggable-price-widget-php-L12" class="blob-num js-line-number" data-line-number="12"> </td>
<td id="file-wc-draggable-price-widget-php-LC12" class="blob-code blob-code-inner js-file-line">wp_enqueue_script( &#8216;woo-jquery-touch-punch&#8217; );</td>
</tr>
<tr>
<td id="file-wc-draggable-price-widget-php-L13" class="blob-num js-line-number" data-line-number="13"> </td>
<td id="file-wc-draggable-price-widget-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/make-price-widget-draggable-on-touch-devices/">Make price widget draggable on touch devices</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://help.codibu.com/blog/make-price-widget-draggable-on-touch-devices/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Set a custom add to cart URL to redirect to</title>
		<link>https://help.codibu.com/blog/set-a-custom-add-to-cart-url-to-redirect-to/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=set-a-custom-add-to-cart-url-to-redirect-to</link>
					<comments>https://help.codibu.com/blog/set-a-custom-add-to-cart-url-to-redirect-to/#respond</comments>
		
		<dc:creator><![CDATA[JN C]]></dc:creator>
		<pubDate>Mon, 09 Nov 2020 06:30:11 +0000</pubDate>
				<guid isPermaLink="false">https://help.codibu.com/kb/set-a-custom-add-to-cart-url-to-redirect-to/</guid>

					<description><![CDATA[<p>To redirect users to a custom URL, we recommend the Add To Cart Redirect extension. Read documentation for this product.</p>
<p>The post <a href="https://help.codibu.com/blog/set-a-custom-add-to-cart-url-to-redirect-to/">Set a custom add to cart URL to redirect to</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>To redirect users to a custom URL, we recommend the Add To Cart Redirect extension.</p>
<p>Read <a href="https://help.codibu.com/blog/kb/add-to-cart-redirect">documentation for this product</a>.</p><p>The post <a href="https://help.codibu.com/blog/set-a-custom-add-to-cart-url-to-redirect-to/">Set a custom add to cart URL to redirect to</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://help.codibu.com/blog/set-a-custom-add-to-cart-url-to-redirect-to/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Custom sorting options (asc/desc)</title>
		<link>https://help.codibu.com/blog/custom-sorting-options-asc-desc/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=custom-sorting-options-asc-desc</link>
					<comments>https://help.codibu.com/blog/custom-sorting-options-asc-desc/#respond</comments>
		
		<dc:creator><![CDATA[JN C]]></dc:creator>
		<pubDate>Mon, 09 Nov 2020 06:29:33 +0000</pubDate>
				<guid isPermaLink="false">https://help.codibu.com/kb/custom-sorting-options-asc-desc/</guid>

					<description><![CDATA[<p>This example code shows how you can add an order option for ‘random’, but this also works in similar ways for other ways to order your<span class="excerpt-hellip"> […]</span></p>
<p>The post <a href="https://help.codibu.com/blog/custom-sorting-options-asc-desc/">Custom sorting options (asc/desc)</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>This example code shows how you can add an order option for ‘random’, but this also works in similar ways for other ways to order your products on the catalog page. To learn more about the default ‘orderby’ options please see the <a title="WordPress Class Reference - Orderby" href="http://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters">WordPress Codex Class Reference</a>.</p>
<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>
<div id="gist87972371" 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-custom-sorting-options-asc-dec-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-custom-sorting-options-asc-dec-php-L1" class="blob-num js-line-number" data-line-number="1"> </td>
<td id="file-wc-custom-sorting-options-asc-dec-php-LC1" class="blob-code blob-code-inner js-file-line">/**</td>
</tr>
<tr>
<td id="file-wc-custom-sorting-options-asc-dec-php-L2" class="blob-num js-line-number" data-line-number="2"> </td>
<td id="file-wc-custom-sorting-options-asc-dec-php-LC2" class="blob-code blob-code-inner js-file-line">* Add custom sorting options (asc/desc)</td>
</tr>
<tr>
<td id="file-wc-custom-sorting-options-asc-dec-php-L3" class="blob-num js-line-number" data-line-number="3"> </td>
<td id="file-wc-custom-sorting-options-asc-dec-php-LC3" class="blob-code blob-code-inner js-file-line">*/</td>
</tr>
<tr>
<td id="file-wc-custom-sorting-options-asc-dec-php-L4" class="blob-num js-line-number" data-line-number="4"> </td>
<td id="file-wc-custom-sorting-options-asc-dec-php-LC4" class="blob-code blob-code-inner js-file-line">add_filter( &#8216;woocommerce_get_catalog_ordering_args&#8217;, &#8216;custom_woocommerce_get_catalog_ordering_args&#8217; );</td>
</tr>
<tr>
<td id="file-wc-custom-sorting-options-asc-dec-php-L5" class="blob-num js-line-number" data-line-number="5"> </td>
<td id="file-wc-custom-sorting-options-asc-dec-php-LC5" class="blob-code blob-code-inner js-file-line">function custom_woocommerce_get_catalog_ordering_args( $args ) {</td>
</tr>
<tr>
<td id="file-wc-custom-sorting-options-asc-dec-php-L6" class="blob-num js-line-number" data-line-number="6"> </td>
<td id="file-wc-custom-sorting-options-asc-dec-php-LC6" class="blob-code blob-code-inner js-file-line">$orderby_value = isset( $_GET[&#8216;orderby&#8217;] ) ? wc_clean( $_GET[&#8216;orderby&#8217;] ) : apply_filters( &#8216;woocommerce_default_catalog_orderby&#8217;, get_option( &#8216;woocommerce_default_catalog_orderby&#8217; ) );</td>
</tr>
<tr>
<td id="file-wc-custom-sorting-options-asc-dec-php-L7" class="blob-num js-line-number" data-line-number="7"> </td>
<td id="file-wc-custom-sorting-options-asc-dec-php-LC7" class="blob-code blob-code-inner js-file-line">if ( &#8216;random_list&#8217; == $orderby_value ) {</td>
</tr>
<tr>
<td id="file-wc-custom-sorting-options-asc-dec-php-L8" class="blob-num js-line-number" data-line-number="8"> </td>
<td id="file-wc-custom-sorting-options-asc-dec-php-LC8" class="blob-code blob-code-inner js-file-line">$args[&#8216;orderby&#8217;] = &#8216;rand&#8217;;</td>
</tr>
<tr>
<td id="file-wc-custom-sorting-options-asc-dec-php-L9" class="blob-num js-line-number" data-line-number="9"> </td>
<td id="file-wc-custom-sorting-options-asc-dec-php-LC9" class="blob-code blob-code-inner js-file-line">$args[&#8216;order&#8217;] = &#8221;;</td>
</tr>
<tr>
<td id="file-wc-custom-sorting-options-asc-dec-php-L10" class="blob-num js-line-number" data-line-number="10"> </td>
<td id="file-wc-custom-sorting-options-asc-dec-php-LC10" class="blob-code blob-code-inner js-file-line">$args[&#8216;meta_key&#8217;] = &#8221;;</td>
</tr>
<tr>
<td id="file-wc-custom-sorting-options-asc-dec-php-L11" class="blob-num js-line-number" data-line-number="11"> </td>
<td id="file-wc-custom-sorting-options-asc-dec-php-LC11" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
<tr>
<td id="file-wc-custom-sorting-options-asc-dec-php-L12" class="blob-num js-line-number" data-line-number="12"> </td>
<td id="file-wc-custom-sorting-options-asc-dec-php-LC12" class="blob-code blob-code-inner js-file-line">return $args;</td>
</tr>
<tr>
<td id="file-wc-custom-sorting-options-asc-dec-php-L13" class="blob-num js-line-number" data-line-number="13"> </td>
<td id="file-wc-custom-sorting-options-asc-dec-php-LC13" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
<tr>
<td id="file-wc-custom-sorting-options-asc-dec-php-L14" class="blob-num js-line-number" data-line-number="14"> </td>
<td id="file-wc-custom-sorting-options-asc-dec-php-LC14" class="blob-code blob-code-inner js-file-line">add_filter( &#8216;woocommerce_default_catalog_orderby_options&#8217;, &#8216;custom_woocommerce_catalog_orderby&#8217; );</td>
</tr>
<tr>
<td id="file-wc-custom-sorting-options-asc-dec-php-L15" class="blob-num js-line-number" data-line-number="15"> </td>
<td id="file-wc-custom-sorting-options-asc-dec-php-LC15" class="blob-code blob-code-inner js-file-line">add_filter( &#8216;woocommerce_catalog_orderby&#8217;, &#8216;custom_woocommerce_catalog_orderby&#8217; );</td>
</tr>
<tr>
<td id="file-wc-custom-sorting-options-asc-dec-php-L16" class="blob-num js-line-number" data-line-number="16"> </td>
<td id="file-wc-custom-sorting-options-asc-dec-php-LC16" class="blob-code blob-code-inner js-file-line">function custom_woocommerce_catalog_orderby( $sortby ) {</td>
</tr>
<tr>
<td id="file-wc-custom-sorting-options-asc-dec-php-L17" class="blob-num js-line-number" data-line-number="17"> </td>
<td id="file-wc-custom-sorting-options-asc-dec-php-LC17" class="blob-code blob-code-inner js-file-line">$sortby[&#8216;random_list&#8217;] = &#8216;Random&#8217;;</td>
</tr>
<tr>
<td id="file-wc-custom-sorting-options-asc-dec-php-L18" class="blob-num js-line-number" data-line-number="18"> </td>
<td id="file-wc-custom-sorting-options-asc-dec-php-LC18" class="blob-code blob-code-inner js-file-line">return $sortby;</td>
</tr>
<tr>
<td id="file-wc-custom-sorting-options-asc-dec-php-L19" class="blob-num js-line-number" data-line-number="19"> </td>
<td id="file-wc-custom-sorting-options-asc-dec-php-LC19" 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/custom-sorting-options-asc-desc/">Custom sorting options (asc/desc)</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://help.codibu.com/blog/custom-sorting-options-asc-desc/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Change the default state and country on the checkout</title>
		<link>https://help.codibu.com/blog/change-the-default-state-and-country-on-the-checkout/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=change-the-default-state-and-country-on-the-checkout</link>
					<comments>https://help.codibu.com/blog/change-the-default-state-and-country-on-the-checkout/#respond</comments>
		
		<dc:creator><![CDATA[JN C]]></dc:creator>
		<pubDate>Mon, 09 Nov 2020 06:28:58 +0000</pubDate>
				<guid isPermaLink="false">https://help.codibu.com/kb/change-the-default-state-and-country-on-the-checkout/</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-the-default-state-and-country-on-the-checkout/">Change the default state and country on the checkout</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="gist87972343" 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-default-state-country-php" class="file my-2">
<div class="Box-body p-0 blob-wrapper data type-hack  ">
<table class="highlight tab-size js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">
<tbody>
<tr>
<td id="file-wc-change-default-state-country-php-L1" class="blob-num js-line-number" data-line-number="1"> </td>
<td id="file-wc-change-default-state-country-php-LC1" class="blob-code blob-code-inner js-file-line"><span class="pl-c">/**</span></td>
</tr>
<tr>
<td id="file-wc-change-default-state-country-php-L2" class="blob-num js-line-number" data-line-number="2"> </td>
<td id="file-wc-change-default-state-country-php-LC2" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> * Change the default state and country on the checkout page</span></td>
</tr>
<tr>
<td id="file-wc-change-default-state-country-php-L3" class="blob-num js-line-number" data-line-number="3"> </td>
<td id="file-wc-change-default-state-country-php-LC3" class="blob-code blob-code-inner js-file-line"><span class="pl-c"> */</span></td>
</tr>
<tr>
<td id="file-wc-change-default-state-country-php-L4" class="blob-num js-line-number" data-line-number="4"> </td>
<td id="file-wc-change-default-state-country-php-LC4" class="blob-code blob-code-inner js-file-line"><span class="pl-en">add_filter</span>( <span class="pl-s"><span class="pl-pds">&#8216;</span>default_checkout_billing_country<span class="pl-pds">&#8216;</span></span>, <span class="pl-s"><span class="pl-pds">&#8216;</span>change_default_checkout_country<span class="pl-pds">&#8216;</span></span> );</td>
</tr>
<tr>
<td id="file-wc-change-default-state-country-php-L5" class="blob-num js-line-number" data-line-number="5"> </td>
<td id="file-wc-change-default-state-country-php-LC5" class="blob-code blob-code-inner js-file-line"><span class="pl-en">add_filter</span>( <span class="pl-s"><span class="pl-pds">&#8216;</span>default_checkout_billing_state<span class="pl-pds">&#8216;</span></span>, <span class="pl-s"><span class="pl-pds">&#8216;</span>change_default_checkout_state<span class="pl-pds">&#8216;</span></span> );</td>
</tr>
<tr>
<td id="file-wc-change-default-state-country-php-L6" class="blob-num js-line-number" data-line-number="6"> </td>
<td id="file-wc-change-default-state-country-php-LC6" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-change-default-state-country-php-L7" class="blob-num js-line-number" data-line-number="7"> </td>
<td id="file-wc-change-default-state-country-php-LC7" class="blob-code blob-code-inner js-file-line"><span class="pl-k">function</span> <span class="pl-en">change_default_checkout_country</span>() {</td>
</tr>
<tr>
<td id="file-wc-change-default-state-country-php-L8" class="blob-num js-line-number" data-line-number="8"> </td>
<td id="file-wc-change-default-state-country-php-LC8" class="blob-code blob-code-inner js-file-line"><span class="pl-k">return</span> <span class="pl-s"><span class="pl-pds">&#8216;</span>XX<span class="pl-pds">&#8216;</span></span>; <span class="pl-c">// country code</span></td>
</tr>
<tr>
<td id="file-wc-change-default-state-country-php-L9" class="blob-num js-line-number" data-line-number="9"> </td>
<td id="file-wc-change-default-state-country-php-LC9" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
<tr>
<td id="file-wc-change-default-state-country-php-L10" class="blob-num js-line-number" data-line-number="10"> </td>
<td id="file-wc-change-default-state-country-php-LC10" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-change-default-state-country-php-L11" class="blob-num js-line-number" data-line-number="11"> </td>
<td id="file-wc-change-default-state-country-php-LC11" class="blob-code blob-code-inner js-file-line"><span class="pl-k">function</span> <span class="pl-en">change_default_checkout_state</span>() {</td>
</tr>
<tr>
<td id="file-wc-change-default-state-country-php-L12" class="blob-num js-line-number" data-line-number="12"> </td>
<td id="file-wc-change-default-state-country-php-LC12" class="blob-code blob-code-inner js-file-line"><span class="pl-k">return</span> <span class="pl-s"><span class="pl-pds">&#8216;</span>XX<span class="pl-pds">&#8216;</span></span>; <span class="pl-c">// state code</span></td>
</tr>
<tr>
<td id="file-wc-change-default-state-country-php-L13" class="blob-num js-line-number" data-line-number="13"> </td>
<td id="file-wc-change-default-state-country-php-LC13" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<p>&nbsp;</p>
</div>
</div>
<p>Note that the <code>default_checkout_billing_country</code> filter affects both existing and non-existing users. If you want to only change the default for non-existing users, then you can use this:</p>
<div id="gist89204619" 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-default-country-non-existing-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-default-country-non-existing-php-L1" class="blob-num js-line-number" data-line-number="1"> </td>
<td id="file-wc-change-default-country-non-existing-php-LC1" class="blob-code blob-code-inner js-file-line">/**</td>
</tr>
<tr>
<td id="file-wc-change-default-country-non-existing-php-L2" class="blob-num js-line-number" data-line-number="2"> </td>
<td id="file-wc-change-default-country-non-existing-php-LC2" class="blob-code blob-code-inner js-file-line">* Change the default country on the checkout for non-existing users only</td>
</tr>
<tr>
<td id="file-wc-change-default-country-non-existing-php-L3" class="blob-num js-line-number" data-line-number="3"> </td>
<td id="file-wc-change-default-country-non-existing-php-LC3" class="blob-code blob-code-inner js-file-line">*/</td>
</tr>
<tr>
<td id="file-wc-change-default-country-non-existing-php-L4" class="blob-num js-line-number" data-line-number="4"> </td>
<td id="file-wc-change-default-country-non-existing-php-LC4" class="blob-code blob-code-inner js-file-line">add_filter( &#8216;default_checkout_billing_country&#8217;, &#8216;change_default_checkout_country&#8217;, 10, 1 );</td>
</tr>
<tr>
<td id="file-wc-change-default-country-non-existing-php-L5" class="blob-num js-line-number" data-line-number="5"> </td>
<td id="file-wc-change-default-country-non-existing-php-LC5" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-change-default-country-non-existing-php-L6" class="blob-num js-line-number" data-line-number="6"> </td>
<td id="file-wc-change-default-country-non-existing-php-LC6" class="blob-code blob-code-inner js-file-line">function change_default_checkout_country( $country ) {</td>
</tr>
<tr>
<td id="file-wc-change-default-country-non-existing-php-L7" class="blob-num js-line-number" data-line-number="7"> </td>
<td id="file-wc-change-default-country-non-existing-php-LC7" class="blob-code blob-code-inner js-file-line">// If the user already exists, don&#8217;t override country</td>
</tr>
<tr>
<td id="file-wc-change-default-country-non-existing-php-L8" class="blob-num js-line-number" data-line-number="8"> </td>
<td id="file-wc-change-default-country-non-existing-php-LC8" class="blob-code blob-code-inner js-file-line">if ( WC()-<span class="pl-kos">&gt;</span>customer-<span class="pl-kos">&gt;</span>get_is_paying_customer() ) {</td>
</tr>
<tr>
<td id="file-wc-change-default-country-non-existing-php-L9" class="blob-num js-line-number" data-line-number="9"> </td>
<td id="file-wc-change-default-country-non-existing-php-LC9" class="blob-code blob-code-inner js-file-line">return $country;</td>
</tr>
<tr>
<td id="file-wc-change-default-country-non-existing-php-L10" class="blob-num js-line-number" data-line-number="10"> </td>
<td id="file-wc-change-default-country-non-existing-php-LC10" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
<tr>
<td id="file-wc-change-default-country-non-existing-php-L11" class="blob-num js-line-number" data-line-number="11"> </td>
<td id="file-wc-change-default-country-non-existing-php-LC11" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-change-default-country-non-existing-php-L12" class="blob-num js-line-number" data-line-number="12"> </td>
<td id="file-wc-change-default-country-non-existing-php-LC12" class="blob-code blob-code-inner js-file-line">return &#8216;DE&#8217;; // Override default to Germany (an example)</td>
</tr>
<tr>
<td id="file-wc-change-default-country-non-existing-php-L13" class="blob-num js-line-number" data-line-number="13"> </td>
<td id="file-wc-change-default-country-non-existing-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/change-the-default-state-and-country-on-the-checkout/">Change the default state and country on the checkout</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://help.codibu.com/blog/change-the-default-state-and-country-on-the-checkout/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Override loop template and show quantities next to add to cart buttons.</title>
		<link>https://help.codibu.com/blog/override-loop-template-and-show-quantities-next-to-add-to-cart-buttons/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=override-loop-template-and-show-quantities-next-to-add-to-cart-buttons</link>
					<comments>https://help.codibu.com/blog/override-loop-template-and-show-quantities-next-to-add-to-cart-buttons/#respond</comments>
		
		<dc:creator><![CDATA[JN C]]></dc:creator>
		<pubDate>Mon, 09 Nov 2020 06:28:19 +0000</pubDate>
				<guid isPermaLink="false">https://help.codibu.com/kb/override-loop-template-and-show-quantities-next-to-add-to-cart-buttons/</guid>

					<description><![CDATA[<p>To display quantity input fields for simple products within your shop archive pages, use the following code:   /**   * Override loop template and show<span class="excerpt-hellip"> […]</span></p>
<p>The post <a href="https://help.codibu.com/blog/override-loop-template-and-show-quantities-next-to-add-to-cart-buttons/">Override loop template and show quantities next to add to cart buttons.</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>To display quantity input fields for simple products within your shop archive pages, use the following code:</p>
<div id="gist87972321" 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-override-loop-show-cart-buttons-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-override-loop-show-cart-buttons-php-L1" class="blob-num js-line-number" data-line-number="1"> </td>
<td id="file-wc-override-loop-show-cart-buttons-php-LC1" class="blob-code blob-code-inner js-file-line">/**</td>
</tr>
<tr>
<td id="file-wc-override-loop-show-cart-buttons-php-L2" class="blob-num js-line-number" data-line-number="2"> </td>
<td id="file-wc-override-loop-show-cart-buttons-php-LC2" class="blob-code blob-code-inner js-file-line">* Override loop template and show quantities next to add to cart buttons</td>
</tr>
<tr>
<td id="file-wc-override-loop-show-cart-buttons-php-L3" class="blob-num js-line-number" data-line-number="3"> </td>
<td id="file-wc-override-loop-show-cart-buttons-php-LC3" class="blob-code blob-code-inner js-file-line">*/</td>
</tr>
<tr>
<td id="file-wc-override-loop-show-cart-buttons-php-L4" class="blob-num js-line-number" data-line-number="4"> </td>
<td id="file-wc-override-loop-show-cart-buttons-php-LC4" class="blob-code blob-code-inner js-file-line">add_filter( &#8216;woocommerce_loop_add_to_cart_link&#8217;, &#8216;quantity_inputs_for_woocommerce_loop_add_to_cart_link&#8217;, 10, 2 );</td>
</tr>
<tr>
<td id="file-wc-override-loop-show-cart-buttons-php-L5" class="blob-num js-line-number" data-line-number="5"> </td>
<td id="file-wc-override-loop-show-cart-buttons-php-LC5" class="blob-code blob-code-inner js-file-line">function quantity_inputs_for_woocommerce_loop_add_to_cart_link( $html, $product ) {</td>
</tr>
<tr>
<td id="file-wc-override-loop-show-cart-buttons-php-L6" class="blob-num js-line-number" data-line-number="6"> </td>
<td id="file-wc-override-loop-show-cart-buttons-php-LC6" class="blob-code blob-code-inner js-file-line">if ( $product &amp;&amp; $product-<span class="pl-kos">&gt;</span>is_type( &#8216;simple&#8217; ) &amp;&amp; $product-<span class="pl-kos">&gt;</span>is_purchasable() &amp;&amp; $product-<span class="pl-kos">&gt;</span>is_in_stock() &amp;&amp; ! $product-<span class="pl-kos">&gt;</span>is_sold_individually() ) {</td>
</tr>
<tr>
<td id="file-wc-override-loop-show-cart-buttons-php-L7" class="blob-num js-line-number" data-line-number="7"> </td>
<td id="file-wc-override-loop-show-cart-buttons-php-LC7" class="blob-code blob-code-inner js-file-line">$html = &#8216;<span class="pl-kos">&lt;</span><span class="pl-ent">form</span> <span class="pl-c1">action</span>=&#8221;<span class="pl-s">&#8216; . esc_url( $product-&gt;add_to_cart_url() ) . &#8216;</span>&#8221; <span class="pl-c1">class</span>=&#8221;<span class="pl-s">cart</span>&#8221; <span class="pl-c1">method</span>=&#8221;<span class="pl-s">post</span>&#8221; <span class="pl-c1">enctype</span>=&#8221;<span class="pl-s">multipart/form-data</span>&#8220;<span class="pl-kos">&gt;</span>&#8216;;</td>
</tr>
<tr>
<td id="file-wc-override-loop-show-cart-buttons-php-L8" class="blob-num js-line-number" data-line-number="8"> </td>
<td id="file-wc-override-loop-show-cart-buttons-php-LC8" class="blob-code blob-code-inner js-file-line">$html .= woocommerce_quantity_input( array(), $product, false );</td>
</tr>
<tr>
<td id="file-wc-override-loop-show-cart-buttons-php-L9" class="blob-num js-line-number" data-line-number="9"> </td>
<td id="file-wc-override-loop-show-cart-buttons-php-LC9" class="blob-code blob-code-inner js-file-line">$html .= &#8216;<span class="pl-kos">&lt;</span><span class="pl-ent">button</span> <span class="pl-c1">type</span>=&#8221;<span class="pl-s">submit</span>&#8221; <span class="pl-c1">class</span>=&#8221;<span class="pl-s">button alt</span>&#8220;<span class="pl-kos">&gt;</span>&#8216; . esc_html( $product-<span class="pl-kos">&gt;</span>add_to_cart_text() ) . &#8216;<span class="pl-kos">&lt;/</span><span class="pl-ent">button</span><span class="pl-kos">&gt;</span>&#8216;;</td>
</tr>
<tr>
<td id="file-wc-override-loop-show-cart-buttons-php-L10" class="blob-num js-line-number" data-line-number="10"> </td>
<td id="file-wc-override-loop-show-cart-buttons-php-LC10" class="blob-code blob-code-inner js-file-line">$html .= &#8216;<span class="pl-kos">&lt;/</span><span class="pl-ent">form</span><span class="pl-kos">&gt;</span>&#8216;;</td>
</tr>
<tr>
<td id="file-wc-override-loop-show-cart-buttons-php-L11" class="blob-num js-line-number" data-line-number="11"> </td>
<td id="file-wc-override-loop-show-cart-buttons-php-LC11" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
<tr>
<td id="file-wc-override-loop-show-cart-buttons-php-L12" class="blob-num js-line-number" data-line-number="12"> </td>
<td id="file-wc-override-loop-show-cart-buttons-php-LC12" class="blob-code blob-code-inner js-file-line">return $html;</td>
</tr>
<tr>
<td id="file-wc-override-loop-show-cart-buttons-php-L13" class="blob-num js-line-number" data-line-number="13"> </td>
<td id="file-wc-override-loop-show-cart-buttons-php-LC13" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
</tbody>
</table>
</div>
<p>&nbsp;</p>
</div>
</div>
</div>
</div>
</div>
<p class="p1"> </p>
<div class="woo-sc-box note   ">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.</div><p>The post <a href="https://help.codibu.com/blog/override-loop-template-and-show-quantities-next-to-add-to-cart-buttons/">Override loop template and show quantities next to add to cart buttons.</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://help.codibu.com/blog/override-loop-template-and-show-quantities-next-to-add-to-cart-buttons/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Allow HTML in term (category, tag) descriptions</title>
		<link>https://help.codibu.com/blog/allow-html-in-term-category-tag-descriptions/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=allow-html-in-term-category-tag-descriptions</link>
					<comments>https://help.codibu.com/blog/allow-html-in-term-category-tag-descriptions/#respond</comments>
		
		<dc:creator><![CDATA[JN C]]></dc:creator>
		<pubDate>Mon, 09 Nov 2020 06:27:38 +0000</pubDate>
				<guid isPermaLink="false">https://help.codibu.com/kb/allow-html-in-term-category-tag-descriptions/</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/allow-html-in-term-category-tag-descriptions/">Allow HTML in term (category, tag) descriptions</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>By default, WordPress strips HTML from category descriptions. This code will prevent that from happening.</p>
<div id="gist87972284" 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-allow-html-in-terms-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-allow-html-in-terms-php-L1" class="blob-num js-line-number" data-line-number="1"> </td>
<td id="file-wc-allow-html-in-terms-php-LC1" class="blob-code blob-code-inner js-file-line">/**</td>
</tr>
<tr>
<td id="file-wc-allow-html-in-terms-php-L2" class="blob-num js-line-number" data-line-number="2"> </td>
<td id="file-wc-allow-html-in-terms-php-LC2" class="blob-code blob-code-inner js-file-line">* Allow HTML in term (category, tag) descriptions</td>
</tr>
<tr>
<td id="file-wc-allow-html-in-terms-php-L3" class="blob-num js-line-number" data-line-number="3"> </td>
<td id="file-wc-allow-html-in-terms-php-LC3" class="blob-code blob-code-inner js-file-line">*/</td>
</tr>
<tr>
<td id="file-wc-allow-html-in-terms-php-L4" class="blob-num js-line-number" data-line-number="4"> </td>
<td id="file-wc-allow-html-in-terms-php-LC4" class="blob-code blob-code-inner js-file-line">foreach ( array( &#8216;pre_term_description&#8217; ) as $filter ) {</td>
</tr>
<tr>
<td id="file-wc-allow-html-in-terms-php-L5" class="blob-num js-line-number" data-line-number="5"> </td>
<td id="file-wc-allow-html-in-terms-php-LC5" class="blob-code blob-code-inner js-file-line">remove_filter( $filter, &#8216;wp_filter_kses&#8217; );</td>
</tr>
<tr>
<td id="file-wc-allow-html-in-terms-php-L6" class="blob-num js-line-number" data-line-number="6"> </td>
<td id="file-wc-allow-html-in-terms-php-LC6" class="blob-code blob-code-inner js-file-line">if ( ! current_user_can( &#8216;unfiltered_html&#8217; ) ) {</td>
</tr>
<tr>
<td id="file-wc-allow-html-in-terms-php-L7" class="blob-num js-line-number" data-line-number="7"> </td>
<td id="file-wc-allow-html-in-terms-php-LC7" class="blob-code blob-code-inner js-file-line">add_filter( $filter, &#8216;wp_filter_post_kses&#8217; );</td>
</tr>
<tr>
<td id="file-wc-allow-html-in-terms-php-L8" class="blob-num js-line-number" data-line-number="8"> </td>
<td id="file-wc-allow-html-in-terms-php-LC8" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
<tr>
<td id="file-wc-allow-html-in-terms-php-L9" class="blob-num js-line-number" data-line-number="9"> </td>
<td id="file-wc-allow-html-in-terms-php-LC9" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
<tr>
<td id="file-wc-allow-html-in-terms-php-L10" class="blob-num js-line-number" data-line-number="10"> </td>
<td id="file-wc-allow-html-in-terms-php-LC10" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-allow-html-in-terms-php-L11" class="blob-num js-line-number" data-line-number="11"> </td>
<td id="file-wc-allow-html-in-terms-php-LC11" class="blob-code blob-code-inner js-file-line">foreach ( array( &#8216;term_description&#8217; ) as $filter ) {</td>
</tr>
<tr>
<td id="file-wc-allow-html-in-terms-php-L12" class="blob-num js-line-number" data-line-number="12"> </td>
<td id="file-wc-allow-html-in-terms-php-LC12" class="blob-code blob-code-inner js-file-line">remove_filter( $filter, &#8216;wp_kses_data&#8217; );</td>
</tr>
<tr>
<td id="file-wc-allow-html-in-terms-php-L13" class="blob-num js-line-number" data-line-number="13"> </td>
<td id="file-wc-allow-html-in-terms-php-LC13" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
</tbody>
</table>
</div>
<p>&nbsp;</p>
</div>
</div>
</div>
</div>
</div>
<p>The first part prevents HTML from being stripped from term descriptions.</p>
<p>The second part prevents HTML being stripped out when using the term description function (http://codex.wordpress.org/Function_Reference/term_description).</p><p>The post <a href="https://help.codibu.com/blog/allow-html-in-term-category-tag-descriptions/">Allow HTML in term (category, tag) descriptions</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://help.codibu.com/blog/allow-html-in-term-category-tag-descriptions/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Custom tracking code for the thanks page</title>
		<link>https://help.codibu.com/blog/custom-tracking-code-for-the-thanks-page/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=custom-tracking-code-for-the-thanks-page</link>
					<comments>https://help.codibu.com/blog/custom-tracking-code-for-the-thanks-page/#respond</comments>
		
		<dc:creator><![CDATA[JN C]]></dc:creator>
		<pubDate>Mon, 09 Nov 2020 06:27:03 +0000</pubDate>
				<guid isPermaLink="false">https://help.codibu.com/kb/custom-tracking-code-for-the-thanks-page/</guid>

					<description><![CDATA[<p>This snippet is for adding tracking for a separate piece of analytic software you may have installed. The order object contains all the order data you<span class="excerpt-hellip"> […]</span></p>
<p>The post <a href="https://help.codibu.com/blog/custom-tracking-code-for-the-thanks-page/">Custom tracking code for the thanks page</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>This snippet is for adding tracking for a separate piece of analytic software you may have installed. The order object contains all the order data you should need, including line items.</p>
<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>
<div id="gist87972239" 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-custom-tracking-code-for-thanks-page-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-custom-tracking-code-for-thanks-page-php-L1" class="blob-num js-line-number" data-line-number="1"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC1" class="blob-code blob-code-inner js-file-line">/**</td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L2" class="blob-num js-line-number" data-line-number="2"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC2" class="blob-code blob-code-inner js-file-line">* Add custom tracking code to the thank-you page</td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L3" class="blob-num js-line-number" data-line-number="3"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC3" class="blob-code blob-code-inner js-file-line">*/</td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L4" class="blob-num js-line-number" data-line-number="4"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC4" class="blob-code blob-code-inner js-file-line">add_action( &#8216;woocommerce_thankyou&#8217;, &#8216;my_custom_tracking&#8217; );</td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L5" class="blob-num js-line-number" data-line-number="5"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC5" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L6" class="blob-num js-line-number" data-line-number="6"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC6" class="blob-code blob-code-inner js-file-line">function my_custom_tracking( $order_id ) {</td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L7" class="blob-num js-line-number" data-line-number="7"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC7" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L8" class="blob-num js-line-number" data-line-number="8"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC8" class="blob-code blob-code-inner js-file-line">// Lets grab the order</td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L9" class="blob-num js-line-number" data-line-number="9"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC9" class="blob-code blob-code-inner js-file-line">$order = wc_get_order( $order_id );</td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L10" class="blob-num js-line-number" data-line-number="10"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC10" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L11" class="blob-num js-line-number" data-line-number="11"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC11" class="blob-code blob-code-inner js-file-line">/**</td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L12" class="blob-num js-line-number" data-line-number="12"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC12" class="blob-code blob-code-inner js-file-line">* Put your tracking code here</td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L13" class="blob-num js-line-number" data-line-number="13"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC13" class="blob-code blob-code-inner js-file-line">* You can get the order total etc e.g. $order-<span class="pl-kos">&gt;</span>get_total();</td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L14" class="blob-num js-line-number" data-line-number="14"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC14" class="blob-code blob-code-inner js-file-line">*/</td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L15" class="blob-num js-line-number" data-line-number="15"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC15" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L16" class="blob-num js-line-number" data-line-number="16"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC16" class="blob-code blob-code-inner js-file-line">// This is the order total</td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L17" class="blob-num js-line-number" data-line-number="17"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC17" class="blob-code blob-code-inner js-file-line">$order-<span class="pl-kos">&gt;</span>get_total();</td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L18" class="blob-num js-line-number" data-line-number="18"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC18" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L19" class="blob-num js-line-number" data-line-number="19"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC19" class="blob-code blob-code-inner js-file-line">// This is how to grab line items from the order</td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L20" class="blob-num js-line-number" data-line-number="20"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC20" class="blob-code blob-code-inner js-file-line">$line_items = $order-<span class="pl-kos">&gt;</span>get_items();</td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L21" class="blob-num js-line-number" data-line-number="21"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC21" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L22" class="blob-num js-line-number" data-line-number="22"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC22" class="blob-code blob-code-inner js-file-line">// This loops over line items</td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L23" class="blob-num js-line-number" data-line-number="23"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC23" class="blob-code blob-code-inner js-file-line">foreach ( $line_items as $item ) {</td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L24" class="blob-num js-line-number" data-line-number="24"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC24" class="blob-code blob-code-inner js-file-line">// This will be a product</td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L25" class="blob-num js-line-number" data-line-number="25"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC25" class="blob-code blob-code-inner js-file-line">$product = $order-<span class="pl-kos">&gt;</span>get_product_from_item( $item );</td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L26" class="blob-num js-line-number" data-line-number="26"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC26" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L27" class="blob-num js-line-number" data-line-number="27"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC27" class="blob-code blob-code-inner js-file-line">// This is the products SKU</td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L28" class="blob-num js-line-number" data-line-number="28"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC28" class="blob-code blob-code-inner js-file-line">$sku = $product-<span class="pl-kos">&gt;</span>get_sku();</td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L29" class="blob-num js-line-number" data-line-number="29"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC29" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L30" class="blob-num js-line-number" data-line-number="30"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC30" class="blob-code blob-code-inner js-file-line">// This is the qty purchased</td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L31" class="blob-num js-line-number" data-line-number="31"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC31" class="blob-code blob-code-inner js-file-line">$qty = $item[&#8216;qty&#8217;];</td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L32" class="blob-num js-line-number" data-line-number="32"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC32" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L33" class="blob-num js-line-number" data-line-number="33"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC33" class="blob-code blob-code-inner js-file-line">// Line item total cost including taxes and rounded</td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L34" class="blob-num js-line-number" data-line-number="34"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC34" class="blob-code blob-code-inner js-file-line">$total = $order-<span class="pl-kos">&gt;</span>get_line_total( $item, true, true );</td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L35" class="blob-num js-line-number" data-line-number="35"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC35" class="blob-code blob-code-inner js-file-line"> </td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L36" class="blob-num js-line-number" data-line-number="36"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC36" class="blob-code blob-code-inner js-file-line">// Line item subtotal (before discounts)</td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L37" class="blob-num js-line-number" data-line-number="37"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC37" class="blob-code blob-code-inner js-file-line">$subtotal = $order-<span class="pl-kos">&gt;</span>get_line_subtotal( $item, true, true );</td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L38" class="blob-num js-line-number" data-line-number="38"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC38" class="blob-code blob-code-inner js-file-line">}</td>
</tr>
<tr>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-L39" class="blob-num js-line-number" data-line-number="39"> </td>
<td id="file-wc-custom-tracking-code-for-thanks-page-php-LC39" 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/custom-tracking-code-for-the-thanks-page/">Custom tracking code for the thanks page</a> first appeared on <a href="https://help.codibu.com">CODIBU</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://help.codibu.com/blog/custom-tracking-code-for-the-thanks-page/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
