Home Forums WoodMart support forum Remove single product pages

Remove single product pages

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #384842

    cesaicumpar
    Participant

    Hello! I have an online shop with only affiliate products. Every product is redirected to the original website.

    This is an example of a category page: https://cesaicumpar.ro/categorie/idei-cadouri-femei/cadouri-mama/

    How can I make the product preview title and image send the client directly on the affiliate website, without entering the single product page? Right now only the blue button does this (Cumpără acum)

    #384843

    cesaicumpar
    Participant

    I would like the link to be opened in a new tab

    #384984

    Hello,

    Sorry but there is no option in Theme Settings available for that.

    It requires customizations and this is beyond our limitations and support policy.

    Best Regards

    #385115

    cesaicumpar
    Participant

    I have managed to find the code on another forum. It works fine, but it doesn’t open in another tab:

    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;
    	}
    }

    Could you at least help me open it in another tab? It doesn’t seem that hard, but I have 0 experience in this kind of stuff

    #385259

    Hello,

    Sorry but we could not help you with third party code snippets this is out of our theme support scope.

    Best Regards

Viewing 5 posts - 1 through 5 (of 5 total)