• 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

Remove Duplicate Products When Using 2 Loops – WooCommerce

$75.00

Category: WooCommerce
  • Description

This code removes the same products from displaying when using 2 Product loops on the same page. In this case, we have a custom loop of products displaying before the single product and a related loop of products showing after the single product on the same page. The code removes any duplicates so only unique products are shown on the same page.

Click the following gallery to view the default loop on the left image which shows duplicate products and the image on the right, once the code is installed, which removes all products shown in the first loop from displaying in the 2nd loop.

The 2nd Loop Contains Duplicate Products as 1st Loop
Duplicate Products Included
Duplicate Products From 1st Loop Removed From 2nd Loop
Duplicate Products Removed

Demo Video

On request

Installation

There’s only 1 step :

Copy & paste the PHP code ( excluding the opening PHP tag ) from the functions.php file to the end of your child themes functions file or custom functionality 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.