• Resolved hericjr

    (@hericjr)


    I’m setting up a store with external/affiliate products and I need to click on the product on the store page to redirect it to the external product.

    What is happening is that when clicking on the product image or title you are redirected to the single product page, but when clicking the button you are redirected to the external page (which is what I need).

    I saw some threads here with the same problem but no solution.

    Some of them suggest putting this code (code below) to redirect to the external page when clicking on the product.

    <?php // Do not include this if already open!
    
    /**
     * Code goes in theme functions.php.
     */
    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;
    	}
    }

    But for SEO reasons, I don’t want to lose the store’s single product page and with this code, when you click on the link, eg: site/products/yourproduct it redirects you to the external link.

    So what I need is basically to point the external product lik on the product page instead of redirecting it.

    I don’t know how Woocommerce hasn’t made this modification yet or put an option for it, because the send button for a link and the image send for another one doesn’t make sense.

    • This topic was modified 1 year, 11 months ago by hericjr.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi,

    May I have the product link on your page, that way we can take a look?

    Also, to check into the site’s configuration, please share a copy of your site’s System Status Report: It is under WooCommerce > Status. Select “Get system report” and then “Copy for support”.?

    Thank you.

    Thread Starter hericjr

    (@hericjr)

    Hello

    My site is not published yet, but I’ll send you a link to one that does the same thing. The button link is correct but the image and title link takes you to the single product page.

    Follow the link: https://www.promosdodia.com.br/product-brands/amazon/

    But this is not a system error, it seems to be native to Woocommerce. I did the test with several themes to find out if it was some irregularity but I realized that it was native.

    There would have to be an option to be able to change that, as it makes no sense to sell an external/affiliate product by sending it to the single product page of the site and then clicking on another button and seeing the product.

    Hi there @hericjr ??

    I’m setting up a store with external/affiliate products and I need to click on the product on the store page to redirect it to the external product.

    What is happening is that when clicking on the product image or title you are redirected to the single product page, but when clicking the button you are redirected to the external page (which is what I need).

    Thanks for reaching out. Happy to help you with this!

    From what I gather, your needs fall outside the scope, and utility, of the WooCommerce plugin, since they require functionality found packaged with the most recent versions of WordPress alone.

    Feel free to learn more about the “Image Block“, the “Heading Block” and the “Buttons Block” -since they appear to be the three that are needed first and foremost. With them center-stage, the rest of the site’s content and navigation can be structured around, while easily linking to external sites.

    I trust that points you in the right direction, but if you have more questions, let us know. We’re happy to help.

    Thread Starter hericjr

    (@hericjr)

    Hello,

    I think you misunderstood my problem, I’ll try to explain it again.

    I use Woocommerce to create my store with external/affiliate products.

    Automatically, the products created are visible on the products page of the website (store).

    On the product page (in any theme) the product box links pull different links.

    The image and title of the product direct you to the single product page of the site, while the link on the button directs you to the external/affiliate link registered in the product. (which would be correct and what I need)

    I need each product in the store to be directed to the same place (external/affiliate link registered in the product). This setting is related to the woocommerce plugin.

    Did you understand the problem?

    Hi,

    Thanks for describing the problem. I was checking, but I was unable to open this link from my end:

    Follow the link:?<a href="https://www.promosdodia.com.br/product-brands/amazon/">https://www.promosdodia.com.br/product-brands/amazon/</a>

    Please let us know once that link is active, so that we can check this better for you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Link from external products directly to the page’ is closed to new replies.