Viewing 3 replies - 1 through 3 (of 3 total)
  • Try something like this in functions.php for your child theme:

    <?php
     add_filter( 'woocommerce_order_item_permalink', 'my_product_link' );
     function my_product_link( $product_link ) {
       if ( is_cart() ) {
         $product_link = 'https://www.my-site.com/another-page';
       }
       return $product_link;
      }
    

    Sorry, untested.

    Thread Starter semiombra

    (@semiombra)

    It looks not working, if I add the code to functions.php in the child theme I recive back an error.

    I tried to add the same code in woocommerce child folder to the content-single-product.php file but I received back another error.

    any other suggestion pls?

    thanks

    It definitely goes in functions.php for your child theme.

    What error did you receive?

    Make sure the entire contents of functions.php is valid PHP using a service like this:
    https://phpcodechecker.com/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘custom link from cart page’ is closed to new replies.