Change Product order
-
Hello,
I am unfortunately a little helpless.
We sell rugs on our website and are now starting to add rugs from other rug dealers to our website as well.
However, we don’t want the first rugs to be the newest rugs (the rugs from the other dealers).
It would be good if these are somehow mixed.
We use the filter plugin “Product Filter by WooBeWoo” which works really great for us.
I added a snippet the other day that shuffled the order of all products:
add_action( ‘pre_get_posts’, ‘shop_default_orderby_rand’ );
function shop_default_orderby_rand( $query ) {
if ( is_shop() && ( ! isset($_GET[‘orderby’]) || ‘menu_order’ === $_GET[‘orderby’] ) ) {
$query->set( ‘orderby’, ‘rand’ );
}
}The problem here is that when you use filters and you open the next product page in the catalog, again the products are shuffled and so you see some products that you have already seen on the page before, or sometimes products are not shown at all because they are randomly selected.
Is there a better solution here?
I also tried to export all products and randomly generate the product IDs in Excel and then upload them again and update the products, but unfortunately this does not work, because the product is of course not found if the ID has been changed…
I hope someone has a good suggestion.
Thanks in advance.
The page I need help with: [log in to see the link]
The topic ‘Change Product order’ is closed to new replies.