HomePage › Forums › Themeforest › Piizalian – Fast Food Restaurant WooCommerce Theme › Edit article link
- This topic has 10 replies, 2 voices, and was last updated 4 years, 3 months ago by  Supporter. Supporter.
- 
		AuthorPosts
- 
		
			
				
July 22, 2021 at 10:47 pm #3236Hello, I wanted to know if it was possible to change the link of the “add to cart” button but only for specific items? July 22, 2021 at 11:05 pm #3238Please go to edit product -> Product data -> External/Affiliate product -> Add Product URL: https://prnt.sc/1eeam4d July 23, 2021 at 12:23 am #3239Thank you July 23, 2021 at 1:00 am #3241Ok you. July 28, 2021 at 9:02 pm #3320Hello, I thought that the problem was solved but finally not. When I click on the button with the cart icon it works, but when I click on the title of the article it redirects me to the article page Blue : Works – Red : Does not work July 28, 2021 at 9:41 pm #3321Please add this php code to file functions.php ( child-theme): remove_action('woocommerce_before_shop_loop_item', 'woocommerce_template_loop_product_link_open'); add_action('woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_link_open', 15); add_action('woocommerce_before_shop_loop_item', 'woocommerce_add_aff_link_open', 10); add_action('woocommerce_before_shop_loop_item_title', 'woocommerce_add_aff_link_close', 10); function woocommerce_add_aff_link_open(){ $product = wc_get_product(get_the_ID()); if( $product->is_type( 'external' ) ) { echo '<a target="_blank" href="' . $product->get_product_url() . '" class="">'; } } function woocommerce_add_aff_link_close(){ $product = wc_get_product(get_the_ID()); if( $product->is_type( 'external' ) ) { echo '</a>'; } }July 28, 2021 at 9:49 pm #3324This reply has been marked as private.July 28, 2021 at 10:46 pm #3330HI, Please don’t edit your site, I’m checking your site. July 28, 2021 at 10:49 pm #3331I resolved this issue, please recheck. July 28, 2021 at 10:50 pm #3332Perfect, thank you very much for your help July 28, 2021 at 10:53 pm #3333OK, you are welcome! 
- 
		AuthorPosts
You must be logged in to reply to this topic.
 
		
		