Trouble using get_product_url in search results
-
In my WooCommerce store I have some external products and I use the product URL in product lists instead of the permalink because I can point the product URL to any valid URL and not to the product page.
<a href="<?php echo esc_url( $product->get_product_url() ) ?>" target="_blank"><?php the_title(); ?></a>
I’d like to do the same on search result pages, but replacing the permalink with the above code prevents the search results from displaying.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Trouble using get_product_url in search results’ is closed to new replies.