There are no pre-requisites in order for you to be able to implement this solution.
Simply copy the pre-coded solution to your active theme’s functions.php or preferably the Code Snippets Plugin.
Need support with the snippet? We’re Here to Help You, Contact Us!
If you have grouped products set up on your site, you’ll notice the table which is output to the right of product image links all of the products which make up this grouped product. The exception being if your product is hidden from the catalogue. Linked products on a grouped product page can aid the customer experience – allowing the user to drill-down and get more specific information about the individual product. However, in some cases, this could reduce your Average Order Value (AOV) as the user may just buy the individual product. This snippet allows you to change the product links on grouped products to any other link you like. In this example specifically, we have changed the link to a simple anchor (#). In effect, this removes the links from the products, forcing the user to stay on the same page. Now, you may notice that once clicked, the user is taken to the very top of the screen – and that’s what an empty anchor typically does. If you’d like the user to stay in the same spot if they click a product name, simply add a string after the anchor which is not in use on the page. For example, returning “#reviews” will scroll the user to the reviews section on your single product page if the product link is clicked so don’t use that! Instead, you could use something like ‘#emptyanchor’. It’s not pretty, but it works. Sadly, the ‘a href’ actually wraps the filter hook so removing it doesn’t seem possible without editing the /templates/single-product/add-to-cart/grouped.php template file at the moment. In fact, removing the filter simply makes the link of the products the currently viewed grouped product which will refresh the entire page if clicked.
Join forces with UnlimitedWP for an outsourced white label web development service you can truly rely on.