Posted on

WooCommerce: Display “NEW” Badge on Recent Products

We already have a nice “SALE” badge by default with WooCommerce (as well as the “OUT OF STOCK”) one. These show on the shop page once certain conditions are met.

Now, what if we wanted to show a “NEW” badge for products added in the last 30 days? This would certainly grab the customer attention, and also communicate the fact your shop is constantly updating with new products and content (well, good for Google too, right?).

So, how do they do it? (Sounds like one of those Discovery Channel shows…)

Well, here’s a simple snippet for you; simply copy/paste into your functions.php and magically a “NEW” badge will show (note: CSS is not provided, you’ll need to adjust it based on your current theme and custom styles). Continue reading WooCommerce: Display “NEW” Badge on Recent Products

Posted on

WooCommerce: Change Product Permalinks @ Shop / Loop Pages

A BloomerArmada fan asked me a very interesting question: how can I link each product in the shop page to its own custom landing page as opposed to the default permalink?

Of course this applies when you don’t want to use the default single product page for all or some products. Clearly, you could set up a 301 redirect from the single product page to the landing page – that will help for SEO as well. But if this is temporary, or you need to still give access to the single product page later on, then a redirect is no good.

So, here’s how you can override the default permalink. Continue reading WooCommerce: Change Product Permalinks @ Shop / Loop Pages

Posted on

WooCommerce: Show In Stock Products First @ Shop

We’ve already seen how to add a custom “Product Sorting” option to the “Default Sorting” dropdown in the Shop page.

The task I was presented with, however, was to display items based on a custom “meta key”. Now, if you have no idea what a “meta key” is, don’t worry too much. For example, “stock status” is one of these keys, and therefore you can sort products by that.

Anyway, let’s abandon the Japanese for now (hey, unless you speak Japanese!) and get into the coding – as usual, simply copy/paste this little plugin in your functions.php and you’ll get the wanted result ๐Ÿ™‚ Continue reading WooCommerce: Show In Stock Products First @ Shop

Posted on

WooCommerce: How to Display Custom Product Badges (e.g. %OFF, NEW, FREE)?

You would know by now ecommerce customers buy products for different reasons. Your store products might be cheaper than your competitors, maybe you offer better shipping rates, possibly you restock products more quickly than anyone else – or simply you’ve got a great product people keep buying.

One way to display your product features and benefits on the Shop page is by using “product badges”, a series of display messages that are able to communicate with the user immediately.

You’re probably already familiar with the “SALE!” badge that WooCommerce gives us by default. What if you wanted to show the exact percentage amount of that offer?

You’re also aware of the “Featured” option for WooCommerce products. Yes, they show in the “Featured” product shortcode, but what if you wanted the shop to display these special products in a different way, i.e. by using a special badge?

Well, there are millions of examples on how you could improve your products page (and single product page) by making the most of product badges. Thankfully there are snippets and plugins that can help you with that.

A little investment might mean better click-through rates and therefore higher conversion rates! Continue reading WooCommerce: How to Display Custom Product Badges (e.g. %OFF, NEW, FREE)?

Posted on

WooCommerce: Remove, Rename, Add “Default Sorting” Options @ Shop

We’ve seen in the past how to completely remove the “Default Sorting” dropdown that shows in the WooCommerce Shop, Category and Product Archive pages.

Sometimes, however, you might just need to remove one of the default options, rename a sorting option accordingly to your needs or even add a brand new sorting method. As usual, a few lines of PHP are sufficient to achieve anything, thanks to WooCommerce hooks and filters. Continue reading WooCommerce: Remove, Rename, Add “Default Sorting” Options @ Shop

Posted on

WooCommerce: Detect if Current Category Page is a Subcategory

A client of mine had to style a WooCommerce product category page but ONLY if it was a subcategory. So I decided to add a “subcategory” class to the HTML body, so that they could target this in their custom CSS.

As usual, the PHP is quite easy: I check if the current page is a product category, then if the category has “parents” and only in this case add a body class. Pretty easy! Continue reading WooCommerce: Detect if Current Category Page is a Subcategory

Posted on

WooCommerce: Display YITH Wishlist Buttons @ Shop Page

This week’s snippet is about one of the most popular WooCommerce plugins on the WordPress repository: YITH WooCommerce Wishlist developed by YITHEMES.

With over 500,000+ active installations, you can probably understand why this is extremely on demand. Having a “wishlist” on your WooCommerce website is a great idea: customers can save their desired products and get back later to complete the purchase.

One of the most requested customizations of such plugin is to display the wishlist buttons on the shop (also called product archive or product loop) pages, under each product’s add to cart button. And the fix is extremely simple! Continue reading WooCommerce: Display YITH Wishlist Buttons @ Shop Page

Posted on

WooCommerce: Display Variations’ Name & Stock @ Shop Page

Thanks to the various requests I get from Business Bloomer fans, this week I’m going to show you a simple PHP snippet to echo the variations’ name and stock quantity on the shop, categories and loop pages. Continue reading WooCommerce: Display Variations’ Name & Stock @ Shop Page

Posted on

WooCommerce: Check if User Has Already Purchased Product

A WooCommerce client, for different reasons, needed to detect if a given logged in user had already purchased a certain product ID. In your case, you can use this little “trick” for marketing (i.e. “Buy More of This!”) or to show special notices on the loop or single product page. Continue reading WooCommerce: Check if User Has Already Purchased Product

Posted on

WooCommerce: Display Stock Quantity on Shop Page

In this tutorial, my goal is to show the “stock quantity” under each product in the shop, category and archive pages (wherever there is a loop). Enjoy, and feel free to leave a comment for any support request ๐Ÿ™‚ Continue reading WooCommerce: Display Stock Quantity on Shop Page

Posted on

WooCommerce: Show Product Subcategories @ Shop Page

A client of mine has a category called “Brand”. Each product is assigned to a specific Brand subcategory e.g. Nike, Adidas, etc. The goal of this task was to show the “Brand” subcategories in the shop/category/loop pages as a way to help the user identify the brand name. Continue reading WooCommerce: Show Product Subcategories @ Shop Page

Posted on

WooCommerce: Remove SALE! Badge Everywhere

Here’s yet another WooCommerce simple PHP snippet if you wish to completely remove / hide the SALE! badges on the homepage, shop page, category pages and single product pages. Once again, wit a few lines of code you can achieve anything you want! Continue reading WooCommerce: Remove SALE! Badge Everywhere

Posted on

WooCommerce: Show “Sold Out” on Archive/Product Page

Another simple snippet that can easily help user experience and make sure the sold out badge shows on every product in the category & shop page. Not all themes allow this so you can use the snippet below to make it happen! Continue reading WooCommerce: Show “Sold Out” on Archive/Product Page

Posted on

WooCommerce: Hide Product Loop @ Shop Page

A client wanted to show only featured products on the shop page. While adding featured products is very easy (just use the WooCommerce shortcode in the page content), it seems very difficult to remove the “other” products. Here’s what I did. Continue reading WooCommerce: Hide Product Loop @ Shop Page

Posted on

WooCommerce: How to change Shop Page SEO Meta Title (“Products Archive”)

Just say thanks to YOAST SEO plugin, that’s all you need to know. No PHP, no editing template files… just a simple setting in YOAST SEO for WordPress. That’s it ๐Ÿ™‚ Continue reading WooCommerce: How to change Shop Page SEO Meta Title (“Products Archive”)

Posted on

WooCommerce: Hide Prices on the Shop & Category Pages

Interesting WooCommerce customization here. A client of mine asked me to hide/remove prices from the shop page and category pages as she wanted to drive more customers to the single product pages (i.e. increasing the click-through rate).

As usual, a simple PHP snippet does the trick. I never recommend to use CSS to “hide” prices, as they would still be visible in the code – PHP stops the prices from loading, so they’re invisible to the user. Continue reading WooCommerce: Hide Prices on the Shop & Category Pages

Posted on

WooCommerce: How to Remove the “Default Sorting” Dropdown

If the WooCommerce product sorting functionality (“Default Sorting” dropdown) is a waste of space or you don’t need that select box at all, you may want to remove it.

This PHP solution is simply cleaner than CSS – and no matter if you code or not, you just need to copy/paste my snippet in your theme’s functions.php. Continue reading WooCommerce: How to Remove the “Default Sorting” Dropdown

Posted on

WooCommerce: Remove “Showing the Single Result”

This is quite an annoying thing in WooCommerce. Basically, if you only have 1 product in a given category, the notice “Showing the Single Result” will appear on top of the product in the category page. So, how do we remove it? Continue reading WooCommerce: Remove “Showing the Single Result”