I managed to solve with a tip from the author himself of the plugin Woocommerce.
The same answered me:
remove_action( 'woocommerce_before_shop_loop_item',
'woocommerce_template_loop_product_link_open', 10 );
add_action( 'woocommerce_before_shop_loop_item', 'YOUR_CUSTOM_FUNCTION_NAME', 10 );
With that I went to the functions.php
of my son theme and added the following code:
remove_action( 'woocommerce_before_shop_loop_item',
'woocommerce_template_loop_product_link_open', 10 );
add_action( 'woocommerce_before_shop_loop_item',
'woocommerce_template_loop_product_link_open_personalizado', 10 );
function woocommerce_template_loop_product_link_open_personalizado() {
echo '<a href="' . get_the_permalink() . '" class="woocommerce-LoopProduct-link" target="_parent">';
}
This solved my question, I do not know if it is the best option, but it was the tip that one of the authors of Woocommerce sent. Follow the response link: https://goo.gl/6rVM9z
I tried to use this code but it didn’t work;
– Wendell