Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello,

    You can achieve this by adding the following snippet:

    add_action( 'template_redirect', 'redirect_external_products' );
    
    function redirect_external_products() {
    	global $post;
    
    	if ( is_singular( 'product' ) && ! empty( $post ) && ( $product = wc_get_product( $post ) ) && $product->is_type( 'external' ) ) {
    		wp_redirect( $product->get_product_url() );
    		exit;
    	}
    }

    I would recommend using a plugin like?Code Snippets?to add the snippet to your site.

    Thread Starter shwetaarya

    (@shwetaarya)

    Hello,

    Thank you for your quick reply!

    Its code working fine.

    Besy

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘SKIP EXTERNAL AFFILIATE PRODUCT PAGE’ is closed to new replies.