WooCommerce: Top Product Recommendation Plugins

If you’re running an ecommerce site and haven’t spent any time thinking about the product recommendation experience your customers are having, then it’s incumbent on you to start doing so immediately.

Just think where Amazon would be without its robust recommendation engine. Certainly not where it is today.

You might not be able to make recommendations as precise as those of Amazon (that’s almost a certainty when you lack access to the mountains of data Amazon is harvesting to make ever-relevant suggestions), but you might as well work with what you have.

What you have, after all, as a merchant using the WooCommerce platform, is the fruits of countless hours of labor spent on all manner of tools and plugins, including those focused on (no surprise!) product recommendations. 

Product recommendations can come in many forms. There is upselling, which involves attempting to sell a product that is more expensive than that being purchased; there is downselling, which involves attempting to sell a product that is cheaper than that being purchased; and there is cross-selling, which involves attempting to sell a product around the same price as that being purchased.

Upsells, downsells, and cross-sells typically take place during the checkout or post-checkout process. It is assumed that one or more items are already in the cart by the time the product recommendation is made. To be sure, there are many plugins that perform this sort of function, most famously CartFlows. However, in this blogpost, we are not so concerned with these kinds of product recommendation tools. Instead, we will focus our attention on those plugins that let merchants make recommendations on product and cart pages, regardless of whether the shopper has loaded the cart with anything. 

Continue reading WooCommerce: Top Product Recommendation Plugins

WooCommerce: Check If Product Belongs to Category / Tag

We’ve studied “conditional logic” extensively over the previous Business Bloomer posts. In today’s spin-off, I want to clarify how you can check if a given product belongs to a category, tag or custom taxonomy because this is one of the most used conditional logic scenarios.

It’s important to know that a product can be inside the “loop” (e.g. the shop page or a list of products), alternatively you may be on the single product page or have the product unique ID, or even you can check if a product category is inside the Cart. Finally, you can even run the product category check within an Order or an Order Email.

Either way, the function is always the same. You simply need to understand how to use it. Enjoy!

Continue reading WooCommerce: Check If Product Belongs to Category / Tag

WooCommerce: Open External Product Link In New Tab

Today I start a personal WooCommerce customization marathon as I try to relaunch my personal project A Piece of Sicily (a Sicilian products marketplace, WPML friendly, with products uploaded by vendors and external (affiliate) products).

Each week I will share a snippet I’ve personally coded, so that you can follow me along the going-live path and actually see the results on the live site.

This time, we’ll talk about External Products, and specifically at how to Open the external add to cart URL in a new tab, so that users stay on your WooCommerce website even after visiting the affiliate link. Enjoy!

Continue reading WooCommerce: Open External Product Link In New Tab

WooCommerce: Exclude Product From Discount Coupons

WooCommerce coupon settings allow you to define allowed products (or product categories). What’s missing, however, is the other way around: how to set up a product so that it can never be discounted?

Thankfully, a handy WooCommerce filter comes to the rescue (“woocommerce_coupon_is_valid_for_product“) and we can therefore make all coupons “invalid” when a given product is in the cart. Enjoy!

Continue reading WooCommerce: Exclude Product From Discount Coupons

WooCommerce: “Explode” Product Tabs

If you like the Amazon single product page layout, you probably dislike the default WooCommerce single product page tabs layout. This is the section where, by default, “Description”, “Reviews”, “Additional Information” and other custom content show… as tabs below the image & short description.

Thankfully, there is a super easy way to remove such tabs and display each tab on top of each other, without hiding any content. If it’s good for your users, then I recommend you make use of this super simple snippet.

In this tutorial, you will learn about “pluggable functions”. Basically, where provided, you can simply redeclare a custom plugin (WooCommerce) function without having to use hooks or overrides. WordPress will just “listen” to your new version and not the original one any longer.

So, enjoy!

Continue reading WooCommerce: “Explode” Product Tabs

WooCommerce: Find Products With No Weight @ WP Admin

If your shipping rates depend on product weight, it is very likely you’ve forgotten to add weight to ALL your products. In this way, some shipping rates may be underestimated on the WooCommerce Checkout page.

So, here’s how to print a notice on the WordPress Dashboard > Products screen with a list of products that have no weight, together with the links to edit them quickly.

This is a handy snippet you can reuse for other case scenarios such as easily finding products with no dimensions, no prices, no images, no custom field value, or even a specific weight or given price. Enjoy!

Continue reading WooCommerce: Find Products With No Weight @ WP Admin

WooCommerce: Conditionally Force Product Quantity 1 @ Cart

There are times when the WooCommerce product settings alone are not enough. You can already tick the “Sold individually” checkbox in the “Inventory” product data tab in the single product edit page to force quantity 1 for whatever product: “Enable this to only allow one of this item to be bought in a single order“.

Problem is, you may need to set this “programmatically” (via code), based on certain conditions. One reason is that you may not want to edit hundreds of products one by one (or in bulk) – another is that you may want to “override” whatever settings based on certain conditions (for example, you set “Sold Individually”, but if the Cart total is greater than 100 you want to allow quantities greater than 1).

As you can see, in this post we will cover, once again, the magic of “conditional logic“. Enjoy!

Continue reading WooCommerce: Conditionally Force Product Quantity 1 @ Cart

WooCommerce: Show Product Stock @ Cart Page

We’ve already seen how to display stock quantity and status on the Shop Page – today we’ll do something similar, but this time we’ll work on the Cart product table, so that we can visually display stock status and quantity to WooCommerce customers who are about to checkout.

Please note – in order for the snippet to work you must have “stock management” enabled, and also each single product in the cart must have “managing stock” checked and, if on backorder, “allow but notify customer” must be selected, otherwise you will see nothing. Enjoy!

Continue reading WooCommerce: Show Product Stock @ Cart Page

WooCommerce: Edit Product Layout If Logged In

Logged in customers often require different UX, communication and website layout. You can hide add to cart buttons for logged out users, yes, but you can also completely remodel the single product page layout. For example, you can remove the featured image, the add to cart button (because maybe you only want them to purchase one product), the sale badge, the price, product tabs, and so on – while also adding logged-in only information such as custom buttons, banners and media.

In this tutorial we’ll see how to target logged in customers who purchased the current product, how to remove some default layout elements and how to add some custom HTML and CSS to the single product page. Enjoy!

Continue reading WooCommerce: Edit Product Layout If Logged In

WooCommerce: Set / Override Product Price Programmatically

There are times when the edit product page settings are not enough. Yes, you usually set regular and sale price via the price fields under “Product Data”; however sometimes you may have to override those prices via code, because you’re running a special promotion, you don’t want to manually change thousands of prices or maybe you need to show different values to logged in customers only.

Either way, “setting” the product price programmatically consists of two distinct operations. First, you need to change the “display” of the product price on single and loop pages; second, you actually need to set a “cart item” price, because the previous code does not really alter price values.

As usual, easier coded than said, so let’s see how it’s done. Enjoy!

Continue reading WooCommerce: Set / Override Product Price Programmatically

WooCommerce: View Product/Order Hidden Custom Fields (“Protected Meta”)

I was working on a WooCommerce project recently and I didn’t want to waste time searching through all the hidden product post meta.

Post meta are basically product custom fields that are added via the update_post_meta() WordPress function by WooCommerce itself, a custom plugin, a snippet, a theme. For example, “total_sales” is a default WooCommerce product custom field that updates every time the product is purchased. You can “get” total sales with the get_post_meta() WordPress function.

In the same way, there are dozens of default and third party product custom fields that are stored inside the WooCommerce product meta. If the product custom field “meta key” starts with an underscore (“_”), however, this won’t be visible in the “Custom Fields” section of the edit product page screen. Which is a bummer.

So, today, I’ll show you a quick trick so you can always know what the values for product meta keys are without having to mess with print_r() or error_log() in your PHP functions. In the image below, you see the final outcome.

Please note this also shows order hidden meta.

Enjoy!

Continue reading WooCommerce: View Product/Order Hidden Custom Fields (“Protected Meta”)

WooCommerce: Display Product Reviews @ Custom Page (Shortcode)

WooCommerce product reviews shows by default in the “Reviews” tab in the single product page. But what if, like me, you’re using custom sales pages and need to show such reviews elsewhere – by using a shortcode?

I’ve spent some time doing this for two Business Bloomer pages, the contact page (beside the request a quote form) and the Business Bloomer Club sales page (just above the pricing table), so I thought it would have been great sharing the snippet with you. Enjoy!

Continue reading WooCommerce: Display Product Reviews @ Custom Page (Shortcode)

WooCommerce: Set Min Purchase Amount for Specific Product

We already studied how to set min/max WooCommerce add to cart quantity programmatically. That was an easy one. This time, I want to expand on the topic, and define a “minimum order amount on a per-product basis”.

Which, translated in plain English, would be something along the lines of “set the minimum purchase amount for product XYZ to $50”. And once we do that, I expect that the add to cart quantity does non start from 1 – instead it defaults to “$50 divided by product price”. If product price is $10, I would want to set the minimum add to cart quantity to “5” on the single product and cart pages.

Makes sense? Great – here’s how it’s done.

Continue reading WooCommerce: Set Min Purchase Amount for Specific Product

WooCommerce: Product Attachment Plugin Review

While running an eCommerce store makes the operational part of your business a lot smoother, it does not give the facilities, such as asking dozens of questions about the product, seeing it physically, etc. to your customers. This could become a disadvantage if your online shop does not render sufficient information – text and visual – about the products you are selling. So, how will you prevent this situation?

Well, we have a quick and reliable solution. 

Adding the relevant and crisp information on the product page, alongside the product, should solve your concern in some cases. However, when there is a lot of detail to be specified, just do not render it all on the page. Using attachments will keep your shop user-friendly and performance-oriented. 

To do so, you can install Product Attachment for WooCommerce Plugin on your store.

In this article, we are going to review this WooCommerce plugin bit by bit. 

Continue reading WooCommerce: Product Attachment Plugin Review

WooCommerce: Disable Out of Stock Variations @ Variable Product Dropdown

A nice way to avoid user frustration is to never let them pick a product / variation that is out of stock, only to realize later they can’t purchase it.

A variable product comes with a “select dropdown” on the single product page, from which customers can pick their favorite variation. Problem is that ONLY after selecting this they will find out about price, stock status and may be able to add to cart.

Today, we’ll completely disable (grey-out) those select dropdown options (variations) that are out of stock, so that users don’t waste time and only pick one of those that are in stock. Enjoy!

Continue reading WooCommerce: Disable Out of Stock Variations @ Variable Product Dropdown

WooCommerce: Add Product Table Columns @ Admin

The default WooCommerce Dashboard Products page (/wp-admin/edit.php?post_type=product page) shows the list of products in a table. Default fields are: Image, SKU, Stock, Price, Categories, Tags, Featured and Date.

Sometimes, these columns are not enough and you need more. For example, you might want to quickly take a look at a product custom field, such as “visibility” (whether the product is hidden or not).

So, here’s the snippet for that. Of course, you can adapt it to show your own custom field, an ACF field or whatever product-related information you require.

Continue reading WooCommerce: Add Product Table Columns @ Admin

WooCommerce: Custom Related Products

WooCommerce picks related products on the Single Product Page based on product categories and/or product tags. Related products are very important to the shopping experience, and sometimes this is not enough – what if you want to automatically show certain products based on different criteria?

So, here’s a quick snippet to e.g. get related products with the same product title of the current one. A very strange example, but you can use this as reference in case you want to get products based on different criteria.

The get_posts() function, in fact, can be customized to get products with a given stock, specific price range, same custom field value, search term, and so on.

Continue reading WooCommerce: Custom Related Products

WooCommerce: Calculate Sales by Product ID (Shortcode)

Let’s say you’re developing a custom sales page or a landing page. A great way to increase your conversion rate is by showing the number of purchases close to the “add to cart” button.

We’ve already seen how to do this on the single product page, but what if you need to show this on a custom page, and therefore you need a shortcode?

Well, this is super easy and I’m currently using the snippet below on my own website, and specifically in the pricing table of my #CustomizeWoo online course sales page. So, here you go – enjoy!

Continue reading WooCommerce: Calculate Sales by Product ID (Shortcode)