• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2785

Original Genesis & WooCommerce Tutorials & 6000+ Guaranteed Code

Snippets

  • Checkout
  • Cart
  • Videos

Show Products From Same Taxonomy Term As Single Product – WooCommerce

$75.00

Category: WooCommerce
  • Description

This code modifies the WooCommerce product shortcode so it only displays products from the same taxonomy term as the single product.

The code also handles multiple taxonomies by excluding out of stock products so only products related to the same taxonomy term, which are “in stock”, are shown. And it also removes the current single product from the list avoiding duplicates.

The code also works with plugins like YITH which generate custom taxonomy terms for brands however you can use the code with tax terms generated by code or any other plugin.

Demo Video

On request

Installation

There’s only 1 step :

Copy & paste the PHP code to the end of your child themes functions.php file or custom functionality plugin.

Taxonomy

Swap out all 3 instances of yith_product_brand in the code with the taxonomy slug of your taxonomy.

The code was written to replace the YITH WooCommerce Brands Addon and match existing taxonomy, terms & products used with the plugin.

Primary Sidebar

Cart

Code written by Brad Dalton specialist for WooCommerce with more than 10 years of experience.

Advertise · WPEngine · Genesis · Log in

  • Code Snippets
  • Tutorials
  • Videos
  • Account
  • Checkout
  • Cart
 

Loading Comments...
 

You must be logged in to post a comment.