ACF: post query, hide duplicate values [closed]

You could pass all the fields into an array during your while loop, strip the array of duplicates, and then run a foreach loop on that array. It would look something like this:

<?php 
$designers = array();
while ( $the_query->have_posts() ) : $the_query->the_post();
     $designers[] = get_field('products_page_designer_name');
endwhile;

// This will strip out any values that are identical.
$designers = array_unique( $designers );

// Run through your unique array of designers
foreach ( $designers as $designer ) { ?>
    <li class="category-menu-item">
        <a href="https://wordpress.stackexchange.com/shop/?view_type=default&product_search=<?php
            $remove = array(" ", ",","https://wordpress.stackexchange.com/", ".", ":", "-", "–", "—", "!", "?", ";");
            echo strtolower(str_replace($remove, "+", $designer)); ?>">
            <?php echo $designer; ?>
        </a>
    </li>
<?php } ?>

Note that I haven’t tested the syntax or the code.

Good luck!