Does anyone know how to add an affiliate link to a product after removing the product detail page in WooCommerce

  divi, php, woocommerce, wordpress

I am making an affiliate website and I would like to remove the single product page, so that you only can see the product with the title and prices. And when you click on it, I want that the product is redirected to the affiliate page. However it does not work.

i have switched of the product detail page with the following code:

remove_action(
‘woocommerce_before_shop_loop_item’,
‘woocommerce_template_loop_product_link_open’,
10
);

remove_action(
‘woocommerce_after_shop_loop_item’,
‘woocommerce_template_loop_product_link_close’,
5
);

But now I am unable to redirect my products to another site by using my affiliate link. I don’t know where to add the link. Can someone maybe help me?

Source: Ask PHP

LEAVE A COMMENT