Greetings:
I noticed that you moved content-product code to functions in version 4.5.5. Unfortunately for me, I was changing this little bit:
<a href="<?php the_permalink(); ?>"
To This:
<a href="<?php echo esc_url( $product->get_product_url() ) ?>
In the past you helped me with point image URLs from permalink to the product URL. This is the code:
function custom_shop_functions(){
function custom_kad_woocommerce_image_link_open() {
global $product;
if($product->product_type == 'external') {
$link = $product->get_product_url();
} else {
$link = get_the_permalink();
}
echo '<a href="'.esc_url( $link).'" class="product_item_link product_img_link">';
}
add_action( 'woocommerce_before_shop_loop_item_title', 'custom_kad_woocommerce_image_link_open', 5 );
remove_action( 'woocommerce_before_shop_loop_item_title', 'kad_woocommerce_image_link_open', 5 );
}
add_action('init', 'custom_shop_functions');
Would you kindly help me change the product title URL from permalink to product URL with a similar function?
Thanks!
*Login to see link is the “store” page. If you would like to see in action.