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

WP SITES

2764

Original Genesis Tutorials & 6000+ Guaranteed Code

Snippets

  • Shop
  • Checkout
  • Cart

Multiple Related Products Loops Include All Levels of Children – WooCommerce

$300.00

— OR —

  • Description

Description

This code displays 3 related product loops on every single product page.

  1. If the single product is out of stock, Loop 1 displays related products by category before the product.
  2. Regardless of stock status, Loop 2 displays related products by category.
  3. Regardless of stock status, Loop 3 displays related products by brand.

The download includes code to create a custom taxonomy named brands.

  • Only instock products are included.
  • Products in all loops are unique as all product ids on the single product page are checked and duplicates are removed.
  • The code enables you to display x number of products based on how many products are included in each taxonomy or term.

Installation

There’s only 1 step. Copy & paste the PHP code to the end of your child themes functions file or custom functionality plugin and remember to clear caching & re-save permalinks.

Note : If your installation already includes code or a plugin which creates a custom taxonomy for brands, only copy of the code from line 45 of functions.php and swap out the value for the taxonomy parameter on line 260 & 380 from brands with the name ( slug ) of your taxonomy.

Primary Sidebar

Cart

Advertise · WPEngine · Genesis · Log in

  • Account
  • Checkout
  • Cart