Custom link

Home Forums Legacy Support Support queries Setup issues Custom link

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #370277
    Raph
    Spectator
    Hello, In my product page, I would like to custom the clic on my image product.
    #370278
    Raph
    Spectator
    This reply has been marked as private.
    #370287
    Veronica
    Moderator
    hi for that, you can search this woocommerce product image external URL you will get many links to follow I have found something: https://wordpress.org/support/topic/external-url-on-product-images/ https://www.businessbloomer.com/woocommerce-edit-external-product-image-url/
    #370392
    Raph
    Spectator
    I cannot find something is working. The link here is old (2016 or 2018) with old version of woocomerce. I think this is maybe good but how I can make it work for my product ? => 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; } } Thank you for your help.
    #370450
    Veronica
    Moderator
    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( 'your custom url here' );
    exit;
    }
    }
    add this code
    #370461
    Raph
    Spectator
    This reply has been marked as private.
    #370638
    Veronica
    Moderator
    yes no need to specify any product details add the code in wplms0costomizer.php in wplms-customizer plugin
    #372144
    Raph
    Spectator
    hello, Sorry i did not see your awnser. I have for exemple 4 product : 23678, 27890, 2145, 4567. How i can do that ? Thank you ?
    #372227
    Veronica
    Moderator
    hi means you want to redirect these products I have for exemple 4 product : 23678, 27890, 2145, 4567. to that specific page right? if yes then the above code will work
Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Custom link’ is closed to new replies.