by clicking on products, open directly amazon url
-
Hi! I need help in my wordpress site to, when I click on the product, I don’t want it do not open the store. I want to open directly, in a new tab, amazon product.
Wordpress version: 5.0.2
Woocommerce version: 3.5.2Looking for a solution, I find this code:
remove_action( ‘woocommerce_before_shop_loop_item’, ‘woocommerce_template_loop_product_link_open’, 10 );
add_action( ‘woocommerce_before_shop_loop_item’, ‘tsa_woocommerce_link_nofollow’, 10 );
function tsa_woocommerce_link_nofollow() {
global $product;
if ( $product->is_type(‘external’) ) {
echo ‘get_product_url() . ‘”>’;
}else{
echo ‘‘;
}
}But just work, when I click on the image of product(Redirect to amazon new tab). If I click on the title, or in the “Buy” button, redirect to the store.
I really appreciate your help.
Wainting for your response.
Thanks and regards.
- The topic ‘by clicking on products, open directly amazon url’ is closed to new replies.