WooCommerce: Hide “Showing x-y of z results” @ Shop Page

This is quite an annoying thing in WooCommerce when you have just a few products.

Besides, if you only have 1 product in a given category, the notice “Showing the Single Result” will appear on top of the category page.

So, how do we remove the whole “Showing 1–15 of 178 results” element from the Shop, Category, Tag and product loop? Here’s the fix. enjoy!

Continue reading WooCommerce: Hide “Showing x-y of z results” @ Shop Page

WooCommerce: Import California Tax Rates (.csv)

It took me ages to find a way to import ALL California tax rates into WooCommerce. I started by hand, and after a while I said to myself “California is crazy! I wouldn’t want to be an accountant there!”.

As usual, I looked for existing free and premium plugins, but I decided to do it my way. this tutorial gives you a ready-made CSV with all California US tax rates (as of 9 August 2014). Yes, it’s out of date, but you can download it, see how it is built, revise it with the correct rates, and follow the tutorial. Continue reading WooCommerce: Import California Tax Rates (.csv)

WooCommerce: Remove Additional Information Tab @ Single Product

The “Additional Information” tab on the single product page is somewhat annoying and, honestly, quite useless.

There are 2 simple methods to “hide” it or delete it completely: a CSS and a PHP solution. In the first case, you can input the code in your style.css; in the second case use your child theme’s functions.php.

However, Always remember that PHP is better than CSS: with CSS you load the element and then hide it, while with PHP you stop the element from loading. Clearly, PHP is a better way to do it!

Continue reading WooCommerce: Remove Additional Information Tab @ Single Product

WooCommerce: Show Number Of Products Sold @ Product Page

WooCommerce database already stores the number of products sold for you.

Therefore, you may want to show such number on the product page, close to the Add To Cart button. As we’ve seen in my book Ecommerce and Beyond, showing the number of sales for each product can increase your sales conversion rate.

All you need is pasting the following code in your functions.php. Enjoy!

Continue reading WooCommerce: Show Number Of Products Sold @ Product Page

WooCommerce: Hide Price & Add to Cart for Logged Out Users

You may want to force users to login in order to see prices and add products to cart. That means you must hide add to cart buttons and prices on the Shop and Single Product pages when a user is logged out.

All you need is pasting the following code in your functions.php (please note: your theme may have overwritten some default WooCommerce functions, hence the code below may not work. Contact me if you need custom code). Enjoy!

Continue reading WooCommerce: Hide Price & Add to Cart for Logged Out Users

WooCommerce: Disable Variable Product Price Range $$$-$$$

You may want to disable the WooCommerce variable product price range which usually looks like $100-$999 when variations have different prices (min $100 and max $999 in this case).

With this snippet you will be able to hide the highest price, and add a “From: ” prefix in front of the minimum price. At the same time, variable products with a single price (i.e. all variations have the same price) will keep their original format, so won’t display the “From: ” prefix.

Simply paste the following code in your child theme’s functions.php and enjoy!

Continue reading WooCommerce: Disable Variable Product Price Range $$$-$$$

WooCommerce: Hide Shipping Rates if Free Shipping Available

If Free Shipping is available, you possibly don’t want to show the other premium shipping options. WooCommerce shows by default all shipping rates that match a given shipping zone, so it’s not possible to achieve this from the settings alone.

Thankfully, the “woocommerce_package_rates” filter allows us to manipulate the shipping rates before they are returned to the frontend. In this example, we will disable all shipping methods but “Free Shipping” so that free shipping remains the only possible choice.

Here’s the code to add to your functions.php. Enjoy!

Continue reading WooCommerce: Hide Shipping Rates if Free Shipping Available