At the moment, all the products from the directory opened in the same window. Is there a solution to open internal products from the catalog in a new window?
It would be great to have this feature implemented through a plugin or code. Do you already have the practice of solving this issue?
Unfortunately, we didn't understand each other. At the moment, all products from catalogue open on the same window. I would like to be able to open products from the catalog on the new window by default.
I have tried to add this code to file functions.php but unfortunately it doesn't work.
Code:
/* Open Products in New Tab Woocommerce-DevelopingSense */
remove_action( 'woocommerce_before_shop_loop_item','woocommerce_template_loop_product_link_open', 10 ); // add a hook to my custom function add_action ( 'woocommerce_before_shop_loop_item', 'ami_function_open_new_tab', 10 ); function ami_function_open_new_tab() { echo '<a target="_blank" href="' . get_the_permalink() . '" class="woocommerce-LoopProduct-link">'; }
To do this you will need to replace laborator_woocommerce.php which is under /inc (within the theme folder), after you've done that go to the functions.php file of your child theme and add this code at the end of it:
If you don't know how to do it then please share your site credentials here, because we need to login to your site and see this issue live. Your information is safe (private) in this thread.
To include your credentials click Insert Credentials button in editor toolbar. (See how)
Hi there!
At the moment, all the products from the directory opened in the same window. Is there a solution to open internal products from the catalog in a new window?
It would be great to have this feature implemented through a plugin or code. Do you already have the practice of solving this issue?
_
Timur
Hi Timur,
Are you talking about the products in shop so when you click them, they open on a new window or tab.
Best regards,
Laborator Team
Dear Art.
Unfortunately, we didn't understand each other. At the moment, all products from catalogue open on the same window. I would like to be able to open products from the catalog on the new window by default.
I have tried to add this code to file functions.php but unfortunately it doesn't work.
Code:
/* Open Products in New Tab Woocommerce-DevelopingSense */
remove_action( 'woocommerce_before_shop_loop_item','woocommerce_template_loop_product_link_open', 10 );
// add a hook to my custom function
add_action ( 'woocommerce_before_shop_loop_item', 'ami_function_open_new_tab', 10 );
function ami_function_open_new_tab() {
echo '<a target="_blank" href="' . get_the_permalink() . '" class="woocommerce-LoopProduct-link">';
}
_
Timur
Hi Timur,
To do this you will need to replace laborator_woocommerce.php which is under /inc (within the theme folder), after you've done that go to the functions.php file of your child theme and add this code at the end of it:
If you don't know how to do it then please share your site credentials here, because we need to login to your site and see this issue live. Your information is safe (private) in this thread.
To include your credentials click Insert Credentials button in editor toolbar. (See how)
Best regards,
Laborator Team
Hi Timur,
I have added the following code in functions.php:
and now products are open in new tab:https://d.pr/v/rpEjtT