Below is a snippet of code, and a simple video explanation, which shows you how to edit the output of WooCommerce related products (shown at the bottom of the single product page) in order to not use product category and only use product tags as a mechanism for measuring “relatedness”.
The Code Snippet
[gist id=”cb297a299ebe8eb8b405e32230e3c013″]
NOTE – delete your transients or you won’t see this take effect! See the video below to hear about this… To delete transients, add plugin Transients Manager, and remove all transients using this. Then reload your page. Otherwise, it will look like nothing changed. You can also remove transients using WooCommerce > Status > Tools.
Where to put this code
Add this code into a child theme functions.php file, or a custom plugin, or (as in the video) a snippets plugin which holds only this piece of code.
The video guide
The video below explains how to use this code, what it does, and where to place it into your WooCommerce store.
In this video, toy products are shown connected together using the product tag “Cap Guns” – but this rule can apply nicely to most stores, to build more relevant “related” products. In case you’d like to check the output in real time, this is the product in the video.
Get more like this for your WooCommerce store
Book Silicon Dales – contact us here – and we can make your WooCommerce store stand out from the crowd, become more useful, and, ultimately, assist sales.
