• Resolved LSHanford

    (@lshanford)


    Hello – I added a ‘Continue Shopping’ button to my cart page. That worked great. However, I cannot get it to redirect to the page I want (The Lark Theater). It only takes you back to the homepage. I used this code:

    add_action('woocommerce_before_cart', 'wpslash_continue_shopping_hook');
    
    function wpslash_continue_shopping_hook() { ?>
    <a class="button wc-backward" href="<?php echo esc_url( wc_get_page_permalink( 'the-lark-theater' ) ); ?>"> <?php _e( 'Continue Shopping', 'woofood' ) ?> </a>
    
    <?php
    }

    I’ve tried the full URL for the the page I want, the page id, the permalink. I can’t get it to redirect to the correct page.

    Thank you for any ideas you have.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support omarfpg a11n

    (@omarfpg)

    Hi @lshanford,

    The function wc_get_page_permalink does work with the Slug as a parameter. The function does fallback to the home URL by default if it can’t find the slug, however I see you’re using it correctly and the slug you’re feeding it exists.

    This is unusual and it may mean something else is interferring with your plugin. Could you try with the basic get_permalink function and feed it the page ID instead?

    In the meantime, I’d like to understand your site properly to learn what may be conflicting with here. Please share with us the necessary information below for us to investigate the issue further:

    • System Status Report which you can find via WooCommerce > Status > Get system report > Copy for support.
    • Fatal error logs (if any) under WooCommerce > Status > Logs.

    You could copy and paste your reply here or paste it via https://gist.github.com/ and send the link here.

    Once we have more information, we’ll be able to assist you further.

    Thanks!
    -OP

    Plugin Support omarfpg a11n

    (@omarfpg)

    Hi there 👋 ,

    We haven’t heard from you in a while, so I’m going to mark this as resolved. Feel free to start a new thread if you have any more questions.

    All the best,
    Omar

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Continue Shopping Custom Redirect’ is closed to new replies.